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.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
fs
/
ext3
/
ialloc.c
diff --git
a/fs/ext3/ialloc.c
b/fs/ext3/ialloc.c
index
ac238b2
..
f30a4f4
100644
(file)
--- a/
fs/ext3/ialloc.c
+++ b/
fs/ext3/ialloc.c
@@
-22,6
+22,7
@@
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/random.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/random.h>
+#include <linux/vs_dlimit.h>
#include <asm/bitops.h>
#include <asm/byteorder.h>
#include <asm/bitops.h>
#include <asm/byteorder.h>
@@
-124,6
+125,7
@@
void ext3_free_inode (handle_t *handle, struct inode * inode)
*/
DQUOT_INIT(inode);
ext3_xattr_delete_inode(handle, inode);
*/
DQUOT_INIT(inode);
ext3_xattr_delete_inode(handle, inode);
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
@@
-444,6
+446,16
@@
struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
inode = new_inode(sb);
if (!inode)
return ERR_PTR(-ENOMEM);
inode = new_inode(sb);
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 out;
+ }
ei = EXT3_I(inode);
sbi = EXT3_SB(sb);
ei = EXT3_I(inode);
sbi = EXT3_SB(sb);
@@
-567,7
+579,8
@@
got:
ei->i_dir_start_lookup = 0;
ei->i_disksize = 0;
ei->i_dir_start_lookup = 0;
ei->i_disksize = 0;
- ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL;
+ ei->i_flags = EXT3_I(dir)->i_flags &
+ ~(EXT3_INDEX_FL|EXT3_IUNLINK_FL|EXT3_BARRIER_FL);
if (S_ISLNK(mode))
ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
/* dirsync only applies to directories */
if (S_ISLNK(mode))
ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
/* dirsync only applies to directories */
@@
-618,6
+631,7
@@
got:
ext3_debug("allocating inode %lu\n", inode->i_ino);
goto really_out;
fail:
ext3_debug("allocating inode %lu\n", inode->i_ino);
goto really_out;
fail:
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
ext3_std_error(sb, err);
out:
iput(inode);
ext3_std_error(sb, err);
out:
iput(inode);
@@
-627,6
+641,7
@@
really_out:
return ret;
fail2:
return ret;
fail2:
+ DLIMIT_FREE_INODE(sb, inode->i_xid);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
iput(inode);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
iput(inode);