git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
fs
/
ext2
/
ialloc.c
diff --git
a/fs/ext2/ialloc.c
b/fs/ext2/ialloc.c
index
cbd6ae8
..
3d9fa57
100644
(file)
--- a/
fs/ext2/ialloc.c
+++ b/
fs/ext2/ialloc.c
@@
-18,6
+18,9
@@
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
#include <linux/random.h>
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
#include <linux/random.h>
+#include <linux/vs_base.h>
+#include <linux/vs_dlimit.h>
+
#include "ext2.h"
#include "xattr.h"
#include "acl.h"
#include "ext2.h"
#include "xattr.h"
#include "acl.h"
@@
-57,8
+60,8
@@
read_inode_bitmap(struct super_block * sb, unsigned long block_group)
if (!bh)
ext2_error(sb, "read_inode_bitmap",
"Cannot read inode bitmap - "
if (!bh)
ext2_error(sb, "read_inode_bitmap",
"Cannot read inode bitmap - "
- "block_group = %lu, inode_bitmap = %
l
u",
- block_group,
(unsigned long) desc->bg_inode_bitmap
);
+ "block_group = %lu, inode_bitmap = %u",
+ block_group,
le32_to_cpu(desc->bg_inode_bitmap)
);
error_out:
return bh;
}
error_out:
return bh;
}
@@
-124,6
+127,7
@@
void ext2_free_inode (struct inode * inode)
if (!is_bad_inode(inode)) {
/* Quota is already initialized in iput() */
ext2_xattr_delete_inode(inode);
if (!is_bad_inode(inode)) {
/* Quota is already initialized in iput() */
ext2_xattr_delete_inode(inode);
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
}
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
}
@@
-465,6
+469,15
@@
struct inode *ext2_new_inode(struct inode *dir, int mode)
if (!inode)
return ERR_PTR(-ENOMEM);
if (!inode)
return ERR_PTR(-ENOMEM);
+ if (sb->s_flags & MS_TAGXID)
+ inode->i_xid = current->xid;
+ else
+ inode->i_xid = 0;
+
+ if (DLIMIT_ALLOC_INODE(sb, inode->i_xid)) {
+ err = -ENOSPC;
+ goto fail_dlim;
+ }
ei = EXT2_I(inode);
sbi = EXT2_SB(sb);
es = sbi->s_es;
ei = EXT2_I(inode);
sbi = EXT2_SB(sb);
es = sbi->s_es;
@@
-579,7
+592,8
@@
got:
inode->i_blocks = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
memset(ei->i_data, 0, sizeof(ei->i_data));
inode->i_blocks = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
memset(ei->i_data, 0, sizeof(ei->i_data));
- ei->i_flags = EXT2_I(dir)->i_flags & ~EXT2_BTREE_FL;
+ ei->i_flags = EXT2_I(dir)->i_flags &
+ ~(EXT2_BTREE_FL|EXT2_IUNLINK_FL|EXT2_BARRIER_FL);
if (S_ISLNK(mode))
ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL);
/* dirsync is only applied to directories */
if (S_ISLNK(mode))
ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL);
/* dirsync is only applied to directories */
@@
-620,12
+634,15
@@
got:
return inode;
fail2:
return inode;
fail2:
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
iput(inode);
return ERR_PTR(err);
fail:
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
iput(inode);
return ERR_PTR(err);
fail:
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
+fail_dlim:
make_bad_inode(inode);
iput(inode);
return ERR_PTR(err);
make_bad_inode(inode);
iput(inode);
return ERR_PTR(err);
@@
-663,7
+680,7
@@
unsigned long ext2_count_free_inodes (struct super_block * sb)
}
brelse(bitmap_bh);
printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
}
brelse(bitmap_bh);
printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
- percpu_counter_read(EXT2_SB(sb)->s_freeinodes_counter),
+ percpu_counter_read(
&
EXT2_SB(sb)->s_freeinodes_counter),
desc_count, bitmap_count);
unlock_super(sb);
return desc_count;
desc_count, bitmap_count);
unlock_super(sb);
return desc_count;
@@
-724,7
+741,7
@@
void ext2_check_inodes_bitmap (struct super_block * sb)
bitmap_count += x;
}
brelse(bitmap_bh);
bitmap_count += x;
}
brelse(bitmap_bh);
- if (percpu_counter_read(EXT2_SB(sb)->s_freeinodes_counter) !=
+ if (percpu_counter_read(
&
EXT2_SB(sb)->s_freeinodes_counter) !=
bitmap_count)
ext2_error(sb, "ext2_check_inodes_bitmap",
"Wrong free inodes count in super block, "
bitmap_count)
ext2_error(sb, "ext2_check_inodes_bitmap",
"Wrong free inodes count in super block, "