diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-03-03 09:05:07 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-03-04 18:20:30 -0500 |
commit | 871a293155a24554e153538d36e3a80fa169aefb (patch) | |
tree | 7e38f5a2f9e87f63cbc4bc1077a4bb49dde441b0 /fs/ext3 | |
parent | 907f4554e2521cb28b0009d17167760650a9561c (diff) |
dquot: cleanup dquot initialize routine
Get rid of the initialize dquot operation - it is now always called from
the filesystem and if a filesystem really needs it's own (which none
currently does) it can just call into it's own routine directly.
Rename the now static low-level dquot_initialize helper to __dquot_initialize
and vfs_dq_init to dquot_initialize to have a consistent namespace.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/file.c | 1 | ||||
-rw-r--r-- | fs/ext3/ialloc.c | 4 | ||||
-rw-r--r-- | fs/ext3/inode.c | 6 | ||||
-rw-r--r-- | fs/ext3/namei.c | 24 | ||||
-rw-r--r-- | fs/ext3/super.c | 5 |
5 files changed, 20 insertions, 20 deletions
diff --git a/fs/ext3/file.c b/fs/ext3/file.c index 3c7fb11a3b2..f55df0e61cb 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/time.h> | 21 | #include <linux/time.h> |
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
23 | #include <linux/jbd.h> | 23 | #include <linux/jbd.h> |
24 | #include <linux/quotaops.h> | ||
24 | #include <linux/ext3_fs.h> | 25 | #include <linux/ext3_fs.h> |
25 | #include <linux/ext3_jbd.h> | 26 | #include <linux/ext3_jbd.h> |
26 | #include "xattr.h" | 27 | #include "xattr.h" |
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index 7d7238f9f6f..ef9008b885b 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c | |||
@@ -123,7 +123,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode) | |||
123 | * Note: we must free any quota before locking the superblock, | 123 | * Note: we must free any quota before locking the superblock, |
124 | * as writing the quota to disk may need the lock as well. | 124 | * as writing the quota to disk may need the lock as well. |
125 | */ | 125 | */ |
126 | vfs_dq_init(inode); | 126 | dquot_initialize(inode); |
127 | ext3_xattr_delete_inode(handle, inode); | 127 | ext3_xattr_delete_inode(handle, inode); |
128 | dquot_free_inode(inode); | 128 | dquot_free_inode(inode); |
129 | dquot_drop(inode); | 129 | dquot_drop(inode); |
@@ -588,7 +588,7 @@ got: | |||
588 | sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0; | 588 | sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0; |
589 | 589 | ||
590 | ret = inode; | 590 | ret = inode; |
591 | vfs_dq_init(inode); | 591 | dquot_initialize(inode); |
592 | err = dquot_alloc_inode(inode); | 592 | err = dquot_alloc_inode(inode); |
593 | if (err) | 593 | if (err) |
594 | goto fail_drop; | 594 | goto fail_drop; |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index d7962b0c57b..ffbbc65e3f6 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -197,7 +197,7 @@ void ext3_delete_inode (struct inode * inode) | |||
197 | handle_t *handle; | 197 | handle_t *handle; |
198 | 198 | ||
199 | if (!is_bad_inode(inode)) | 199 | if (!is_bad_inode(inode)) |
200 | vfs_dq_init(inode); | 200 | dquot_initialize(inode); |
201 | 201 | ||
202 | truncate_inode_pages(&inode->i_data, 0); | 202 | truncate_inode_pages(&inode->i_data, 0); |
203 | 203 | ||
@@ -3152,7 +3152,7 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr) | |||
3152 | return error; | 3152 | return error; |
3153 | 3153 | ||
3154 | if (ia_valid & ATTR_SIZE) | 3154 | if (ia_valid & ATTR_SIZE) |
3155 | vfs_dq_init(inode); | 3155 | dquot_initialize(inode); |
3156 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 3156 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
3157 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { | 3157 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { |
3158 | handle_t *handle; | 3158 | handle_t *handle; |
@@ -3250,7 +3250,7 @@ static int ext3_writepage_trans_blocks(struct inode *inode) | |||
3250 | ret = 2 * (bpp + indirects) + 2; | 3250 | ret = 2 * (bpp + indirects) + 2; |
3251 | 3251 | ||
3252 | #ifdef CONFIG_QUOTA | 3252 | #ifdef CONFIG_QUOTA |
3253 | /* We know that structure was already allocated during vfs_dq_init so | 3253 | /* We know that structure was already allocated during dquot_initialize so |
3254 | * we will be updating only the data blocks + inodes */ | 3254 | * we will be updating only the data blocks + inodes */ |
3255 | ret += EXT3_MAXQUOTAS_TRANS_BLOCKS(inode->i_sb); | 3255 | ret += EXT3_MAXQUOTAS_TRANS_BLOCKS(inode->i_sb); |
3256 | #endif | 3256 | #endif |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index a492b371b13..ee184084ca4 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1696,7 +1696,7 @@ static int ext3_create (struct inode * dir, struct dentry * dentry, int mode, | |||
1696 | struct inode * inode; | 1696 | struct inode * inode; |
1697 | int err, retries = 0; | 1697 | int err, retries = 0; |
1698 | 1698 | ||
1699 | vfs_dq_init(dir); | 1699 | dquot_initialize(dir); |
1700 | 1700 | ||
1701 | retry: | 1701 | retry: |
1702 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + | 1702 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -1732,7 +1732,7 @@ static int ext3_mknod (struct inode * dir, struct dentry *dentry, | |||
1732 | if (!new_valid_dev(rdev)) | 1732 | if (!new_valid_dev(rdev)) |
1733 | return -EINVAL; | 1733 | return -EINVAL; |
1734 | 1734 | ||
1735 | vfs_dq_init(dir); | 1735 | dquot_initialize(dir); |
1736 | 1736 | ||
1737 | retry: | 1737 | retry: |
1738 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + | 1738 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -1770,7 +1770,7 @@ static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode) | |||
1770 | if (dir->i_nlink >= EXT3_LINK_MAX) | 1770 | if (dir->i_nlink >= EXT3_LINK_MAX) |
1771 | return -EMLINK; | 1771 | return -EMLINK; |
1772 | 1772 | ||
1773 | vfs_dq_init(dir); | 1773 | dquot_initialize(dir); |
1774 | 1774 | ||
1775 | retry: | 1775 | retry: |
1776 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + | 1776 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -2066,8 +2066,8 @@ static int ext3_rmdir (struct inode * dir, struct dentry *dentry) | |||
2066 | 2066 | ||
2067 | /* Initialize quotas before so that eventual writes go in | 2067 | /* Initialize quotas before so that eventual writes go in |
2068 | * separate transaction */ | 2068 | * separate transaction */ |
2069 | vfs_dq_init(dir); | 2069 | dquot_initialize(dir); |
2070 | vfs_dq_init(dentry->d_inode); | 2070 | dquot_initialize(dentry->d_inode); |
2071 | 2071 | ||
2072 | handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2072 | handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2073 | if (IS_ERR(handle)) | 2073 | if (IS_ERR(handle)) |
@@ -2127,8 +2127,8 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry) | |||
2127 | 2127 | ||
2128 | /* Initialize quotas before so that eventual writes go | 2128 | /* Initialize quotas before so that eventual writes go |
2129 | * in separate transaction */ | 2129 | * in separate transaction */ |
2130 | vfs_dq_init(dir); | 2130 | dquot_initialize(dir); |
2131 | vfs_dq_init(dentry->d_inode); | 2131 | dquot_initialize(dentry->d_inode); |
2132 | 2132 | ||
2133 | handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2133 | handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2134 | if (IS_ERR(handle)) | 2134 | if (IS_ERR(handle)) |
@@ -2184,7 +2184,7 @@ static int ext3_symlink (struct inode * dir, | |||
2184 | if (l > dir->i_sb->s_blocksize) | 2184 | if (l > dir->i_sb->s_blocksize) |
2185 | return -ENAMETOOLONG; | 2185 | return -ENAMETOOLONG; |
2186 | 2186 | ||
2187 | vfs_dq_init(dir); | 2187 | dquot_initialize(dir); |
2188 | 2188 | ||
2189 | retry: | 2189 | retry: |
2190 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + | 2190 | handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -2241,7 +2241,7 @@ static int ext3_link (struct dentry * old_dentry, | |||
2241 | if (inode->i_nlink >= EXT3_LINK_MAX) | 2241 | if (inode->i_nlink >= EXT3_LINK_MAX) |
2242 | return -EMLINK; | 2242 | return -EMLINK; |
2243 | 2243 | ||
2244 | vfs_dq_init(dir); | 2244 | dquot_initialize(dir); |
2245 | 2245 | ||
2246 | /* | 2246 | /* |
2247 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing | 2247 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing |
@@ -2293,15 +2293,15 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry, | |||
2293 | struct ext3_dir_entry_2 * old_de, * new_de; | 2293 | struct ext3_dir_entry_2 * old_de, * new_de; |
2294 | int retval, flush_file = 0; | 2294 | int retval, flush_file = 0; |
2295 | 2295 | ||
2296 | vfs_dq_init(old_dir); | 2296 | dquot_initialize(old_dir); |
2297 | vfs_dq_init(new_dir); | 2297 | dquot_initialize(new_dir); |
2298 | 2298 | ||
2299 | old_bh = new_bh = dir_bh = NULL; | 2299 | old_bh = new_bh = dir_bh = NULL; |
2300 | 2300 | ||
2301 | /* Initialize quotas before so that eventual writes go | 2301 | /* Initialize quotas before so that eventual writes go |
2302 | * in separate transaction */ | 2302 | * in separate transaction */ |
2303 | if (new_dentry->d_inode) | 2303 | if (new_dentry->d_inode) |
2304 | vfs_dq_init(new_dentry->d_inode); | 2304 | dquot_initialize(new_dentry->d_inode); |
2305 | handle = ext3_journal_start(old_dir, 2 * | 2305 | handle = ext3_journal_start(old_dir, 2 * |
2306 | EXT3_DATA_TRANS_BLOCKS(old_dir->i_sb) + | 2306 | EXT3_DATA_TRANS_BLOCKS(old_dir->i_sb) + |
2307 | EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2); | 2307 | EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2); |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 0163d0dae12..e844accbf55 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -752,7 +752,6 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type, | |||
752 | const char *data, size_t len, loff_t off); | 752 | const char *data, size_t len, loff_t off); |
753 | 753 | ||
754 | static const struct dquot_operations ext3_quota_operations = { | 754 | static const struct dquot_operations ext3_quota_operations = { |
755 | .initialize = dquot_initialize, | ||
756 | .write_dquot = ext3_write_dquot, | 755 | .write_dquot = ext3_write_dquot, |
757 | .acquire_dquot = ext3_acquire_dquot, | 756 | .acquire_dquot = ext3_acquire_dquot, |
758 | .release_dquot = ext3_release_dquot, | 757 | .release_dquot = ext3_release_dquot, |
@@ -1480,7 +1479,7 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1480 | } | 1479 | } |
1481 | 1480 | ||
1482 | list_add(&EXT3_I(inode)->i_orphan, &EXT3_SB(sb)->s_orphan); | 1481 | list_add(&EXT3_I(inode)->i_orphan, &EXT3_SB(sb)->s_orphan); |
1483 | vfs_dq_init(inode); | 1482 | dquot_initialize(inode); |
1484 | if (inode->i_nlink) { | 1483 | if (inode->i_nlink) { |
1485 | printk(KERN_DEBUG | 1484 | printk(KERN_DEBUG |
1486 | "%s: truncating inode %lu to %Ld bytes\n", | 1485 | "%s: truncating inode %lu to %Ld bytes\n", |
@@ -2736,7 +2735,7 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf) | |||
2736 | * Process 1 Process 2 | 2735 | * Process 1 Process 2 |
2737 | * ext3_create() quota_sync() | 2736 | * ext3_create() quota_sync() |
2738 | * journal_start() write_dquot() | 2737 | * journal_start() write_dquot() |
2739 | * vfs_dq_init() down(dqio_mutex) | 2738 | * dquot_initialize() down(dqio_mutex) |
2740 | * down(dqio_mutex) journal_start() | 2739 | * down(dqio_mutex) journal_start() |
2741 | * | 2740 | * |
2742 | */ | 2741 | */ |