Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jack/linux-quota-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6: (27 commits)
  ext2: Zero our b_size in ext2_quota_read()
  trivial: fix typos/grammar errors in fs/Kconfig
  quota: Coding style fixes
  quota: Remove superfluous inlines
  quota: Remove uppercase aliases for quota functions.
  nfsd: Use lowercase names of quota functions
  jfs: Use lowercase names of quota functions
  udf: Use lowercase names of quota functions
  ufs: Use lowercase names of quota functions
  reiserfs: Use lowercase names of quota functions
  ext4: Use lowercase names of quota functions
  ext3: Use lowercase names of quota functions
  ext2: Use lowercase names of quota functions
  ramfs: Remove quota call
  vfs: Use lowercase names of quota functions
  quota: Remove dqbuf_t and other cleanups
  quota: Remove NODQUOT macro
  quota: Make global quota locks cacheline aligned
  quota: Move quota files into separate directory
  ext4: quota reservation for delayed allocation
  ...
  • Loading branch information
Linus Torvalds committed Mar 27, 2009
2 parents 805de02 + c16831b commit 2c9e15a
Show file tree
Hide file tree
Showing 58 changed files with 902 additions and 697 deletions.
56 changes: 1 addition & 55 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,61 +56,7 @@ endif # BLOCK

source "fs/notify/Kconfig"

config QUOTA
bool "Quota support"
help
If you say Y here, you will be able to set per user limits for disk
usage (also called disk quotas). Currently, it works for the
ext2, ext3, and reiserfs file system. ext3 also supports journalled
quotas for which you don't need to run quotacheck(8) after an unclean
shutdown.
For further details, read the Quota mini-HOWTO, available from
<http://www.tldp.org/docs.html#howto>, or the documentation provided
with the quota tools. Probably the quota support is only useful for
multi user systems. If unsure, say N.

config QUOTA_NETLINK_INTERFACE
bool "Report quota messages through netlink interface"
depends on QUOTA && NET
help
If you say Y here, quota warnings (about exceeding softlimit, reaching
hardlimit, etc.) will be reported through netlink interface. If unsure,
say Y.

config PRINT_QUOTA_WARNING
bool "Print quota warnings to console (OBSOLETE)"
depends on QUOTA
default y
help
If you say Y here, quota warnings (about exceeding softlimit, reaching
hardlimit, etc.) will be printed to the process' controlling terminal.
Note that this behavior is currently deprecated and may go away in
future. Please use notification via netlink socket instead.

# Generic support for tree structured quota files. Seleted when needed.
config QUOTA_TREE
tristate

config QFMT_V1
tristate "Old quota format support"
depends on QUOTA
help
This quota format was (is) used by kernels earlier than 2.4.22. If
you have quota working and you don't want to convert to new quota
format say Y here.

config QFMT_V2
tristate "Quota format v2 support"
depends on QUOTA
select QUOTA_TREE
help
This quota format allows using quotas with 32-bit UIDs/GIDs. If you
need this functionality say Y here.

config QUOTACTL
bool
depends on XFS_QUOTA || QUOTA
default y
source "fs/quota/Kconfig"

source "fs/autofs/Kconfig"
source "fs/autofs4/Kconfig"
Expand Down
6 changes: 1 addition & 5 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ obj-$(CONFIG_FS_POSIX_ACL) += posix_acl.o xattr_acl.o
obj-$(CONFIG_NFS_COMMON) += nfs_common/
obj-$(CONFIG_GENERIC_ACL) += generic_acl.o

obj-$(CONFIG_QUOTA) += dquot.o
obj-$(CONFIG_QFMT_V1) += quota_v1.o
obj-$(CONFIG_QFMT_V2) += quota_v2.o
obj-$(CONFIG_QUOTA_TREE) += quota_tree.o
obj-$(CONFIG_QUOTACTL) += quota.o
obj-y += quota/

obj-$(CONFIG_PROC_FS) += proc/
obj-y += partitions/
Expand Down
3 changes: 2 additions & 1 deletion fs/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
if (!error) {
if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
error = vfs_dq_transfer(inode, attr) ?
-EDQUOT : 0;
if (!error)
error = inode_setattr(inode, attr);
}
Expand Down
8 changes: 4 additions & 4 deletions fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
error_return:
brelse(bitmap_bh);
release_blocks(sb, freed);
DQUOT_FREE_BLOCK(inode, freed);
vfs_dq_free_block(inode, freed);
}

/**
Expand Down Expand Up @@ -1247,7 +1247,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
/*
* Check quota for allocation of this block.
*/
if (DQUOT_ALLOC_BLOCK(inode, num)) {
if (vfs_dq_alloc_block(inode, num)) {
*errp = -EDQUOT;
return 0;
}
Expand Down Expand Up @@ -1409,7 +1409,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,

*errp = 0;
brelse(bitmap_bh);
DQUOT_FREE_BLOCK(inode, *count-num);
vfs_dq_free_block(inode, *count-num);
*count = num;
return ret_block;

Expand All @@ -1420,7 +1420,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
* Undo the block allocation
*/
if (!performed_allocation)
DQUOT_FREE_BLOCK(inode, *count);
vfs_dq_free_block(inode, *count);
brelse(bitmap_bh);
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions fs/ext2/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void ext2_free_inode (struct inode * inode)
if (!is_bad_inode(inode)) {
/* Quota is already initialized in iput() */
ext2_xattr_delete_inode(inode);
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
vfs_dq_free_inode(inode);
vfs_dq_drop(inode);
}

es = EXT2_SB(sb)->s_es;
Expand Down Expand Up @@ -586,7 +586,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
goto fail_drop;
}

if (DQUOT_ALLOC_INODE(inode)) {
if (vfs_dq_alloc_inode(inode)) {
err = -EDQUOT;
goto fail_drop;
}
Expand All @@ -605,10 +605,10 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
return inode;

fail_free_drop:
DQUOT_FREE_INODE(inode);
vfs_dq_free_inode(inode);

fail_drop:
DQUOT_DROP(inode);
vfs_dq_drop(inode);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
unlock_new_inode(inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
return error;
if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
(iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
error = vfs_dq_transfer(inode, iattr) ? -EDQUOT : 0;
if (error)
return error;
}
Expand Down
1 change: 1 addition & 0 deletions fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data,
sb->s_blocksize - offset : toread;

tmp_bh.b_state = 0;
tmp_bh.b_size = sb->s_blocksize;
err = ext2_get_block(inode, blk, &tmp_bh, 0);
if (err < 0)
return err;
Expand Down
8 changes: 4 additions & 4 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
ea_bdebug(new_bh, "reusing block");

error = -EDQUOT;
if (DQUOT_ALLOC_BLOCK(inode, 1)) {
if (vfs_dq_alloc_block(inode, 1)) {
unlock_buffer(new_bh);
goto cleanup;
}
Expand Down Expand Up @@ -699,7 +699,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
* as if nothing happened and cleanup the unused block */
if (error && error != -ENOSPC) {
if (new_bh && new_bh != old_bh)
DQUOT_FREE_BLOCK(inode, 1);
vfs_dq_free_block(inode, 1);
goto cleanup;
}
} else
Expand Down Expand Up @@ -731,7 +731,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
le32_add_cpu(&HDR(old_bh)->h_refcount, -1);
if (ce)
mb_cache_entry_release(ce);
DQUOT_FREE_BLOCK(inode, 1);
vfs_dq_free_block(inode, 1);
mark_buffer_dirty(old_bh);
ea_bdebug(old_bh, "refcount now=%d",
le32_to_cpu(HDR(old_bh)->h_refcount));
Expand Down Expand Up @@ -794,7 +794,7 @@ ext2_xattr_delete_inode(struct inode *inode)
mark_buffer_dirty(bh);
if (IS_SYNC(inode))
sync_dirty_buffer(bh);
DQUOT_FREE_BLOCK(inode, 1);
vfs_dq_free_block(inode, 1);
}
EXT2_I(inode)->i_file_acl = 0;

Expand Down
8 changes: 4 additions & 4 deletions fs/ext3/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void ext3_free_blocks(handle_t *handle, struct inode *inode,
}
ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
if (dquot_freed_blocks)
DQUOT_FREE_BLOCK(inode, dquot_freed_blocks);
vfs_dq_free_block(inode, dquot_freed_blocks);
return;
}

Expand Down Expand Up @@ -1502,7 +1502,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
/*
* Check quota for allocation of this block.
*/
if (DQUOT_ALLOC_BLOCK(inode, num)) {
if (vfs_dq_alloc_block(inode, num)) {
*errp = -EDQUOT;
return 0;
}
Expand Down Expand Up @@ -1714,7 +1714,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,

*errp = 0;
brelse(bitmap_bh);
DQUOT_FREE_BLOCK(inode, *count-num);
vfs_dq_free_block(inode, *count-num);
*count = num;
return ret_block;

Expand All @@ -1729,7 +1729,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
* Undo the block allocation
*/
if (!performed_allocation)
DQUOT_FREE_BLOCK(inode, *count);
vfs_dq_free_block(inode, *count);
brelse(bitmap_bh);
return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions fs/ext3/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
* Note: we must free any quota before locking the superblock,
* as writing the quota to disk may need the lock as well.
*/
DQUOT_INIT(inode);
vfs_dq_init(inode);
ext3_xattr_delete_inode(handle, inode);
DQUOT_FREE_INODE(inode);
DQUOT_DROP(inode);
vfs_dq_free_inode(inode);
vfs_dq_drop(inode);

is_directory = S_ISDIR(inode->i_mode);

Expand Down Expand Up @@ -589,7 +589,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0;

ret = inode;
if(DQUOT_ALLOC_INODE(inode)) {
if (vfs_dq_alloc_inode(inode)) {
err = -EDQUOT;
goto fail_drop;
}
Expand Down Expand Up @@ -620,10 +620,10 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
return ret;

fail_free_drop:
DQUOT_FREE_INODE(inode);
vfs_dq_free_inode(inode);

fail_drop:
DQUOT_DROP(inode);
vfs_dq_drop(inode);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
unlock_new_inode(inode);
Expand Down
6 changes: 3 additions & 3 deletions fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3063,7 +3063,7 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
error = PTR_ERR(handle);
goto err_out;
}
error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
error = vfs_dq_transfer(inode, attr) ? -EDQUOT : 0;
if (error) {
ext3_journal_stop(handle);
return error;
Expand Down Expand Up @@ -3154,7 +3154,7 @@ static int ext3_writepage_trans_blocks(struct inode *inode)
ret = 2 * (bpp + indirects) + 2;

#ifdef CONFIG_QUOTA
/* We know that structure was already allocated during DQUOT_INIT so
/* We know that structure was already allocated during vfs_dq_init so
* we will be updating only the data blocks + inodes */
ret += 2*EXT3_QUOTA_TRANS_BLOCKS(inode->i_sb);
#endif
Expand Down Expand Up @@ -3245,7 +3245,7 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
* i_size has been changed by generic_commit_write() and we thus need
* to include the updated inode in the current transaction.
*
* Also, DQUOT_ALLOC_SPACE() will always dirty the inode when blocks
* Also, vfs_dq_alloc_space() will always dirty the inode when blocks
* are allocated to the file.
*
* If the inode is marked synchronous, we don't honour that here - doing
Expand Down
6 changes: 3 additions & 3 deletions fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ static int ext3_rmdir (struct inode * dir, struct dentry *dentry)

/* Initialize quotas before so that eventual writes go in
* separate transaction */
DQUOT_INIT(dentry->d_inode);
vfs_dq_init(dentry->d_inode);
handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb));
if (IS_ERR(handle))
return PTR_ERR(handle);
Expand Down Expand Up @@ -2108,7 +2108,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry)

/* Initialize quotas before so that eventual writes go
* in separate transaction */
DQUOT_INIT(dentry->d_inode);
vfs_dq_init(dentry->d_inode);
handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb));
if (IS_ERR(handle))
return PTR_ERR(handle);
Expand Down Expand Up @@ -2272,7 +2272,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
/* Initialize quotas before so that eventual writes go
* in separate transaction */
if (new_dentry->d_inode)
DQUOT_INIT(new_dentry->d_inode);
vfs_dq_init(new_dentry->d_inode);
handle = ext3_journal_start(old_dir, 2 *
EXT3_DATA_TRANS_BLOCKS(old_dir->i_sb) +
EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2);
Expand Down
Loading

0 comments on commit 2c9e15a

Please sign in to comment.