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/ext4 | |
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/ext4')
-rw-r--r-- | fs/ext4/file.c | 1 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 4 | ||||
-rw-r--r-- | fs/ext4/inode.c | 4 | ||||
-rw-r--r-- | fs/ext4/namei.c | 24 | ||||
-rw-r--r-- | fs/ext4/super.c | 5 |
5 files changed, 19 insertions, 19 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 85fa464a24ad..a08a12998c49 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/jbd2.h> | 23 | #include <linux/jbd2.h> |
24 | #include <linux/mount.h> | 24 | #include <linux/mount.h> |
25 | #include <linux/path.h> | 25 | #include <linux/path.h> |
26 | #include <linux/quotaops.h> | ||
26 | #include "ext4.h" | 27 | #include "ext4.h" |
27 | #include "ext4_jbd2.h" | 28 | #include "ext4_jbd2.h" |
28 | #include "xattr.h" | 29 | #include "xattr.h" |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index ca8986e4b528..9bb2bb9f67ad 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -217,7 +217,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) | |||
217 | * Note: we must free any quota before locking the superblock, | 217 | * Note: we must free any quota before locking the superblock, |
218 | * as writing the quota to disk may need the lock as well. | 218 | * as writing the quota to disk may need the lock as well. |
219 | */ | 219 | */ |
220 | vfs_dq_init(inode); | 220 | dquot_initialize(inode); |
221 | ext4_xattr_delete_inode(handle, inode); | 221 | ext4_xattr_delete_inode(handle, inode); |
222 | dquot_free_inode(inode); | 222 | dquot_free_inode(inode); |
223 | dquot_drop(inode); | 223 | dquot_drop(inode); |
@@ -1034,7 +1034,7 @@ got: | |||
1034 | ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; | 1034 | ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; |
1035 | 1035 | ||
1036 | ret = inode; | 1036 | ret = inode; |
1037 | vfs_dq_init(inode); | 1037 | dquot_initialize(inode); |
1038 | err = dquot_alloc_inode(inode); | 1038 | err = dquot_alloc_inode(inode); |
1039 | if (err) | 1039 | if (err) |
1040 | goto fail_drop; | 1040 | goto fail_drop; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index eaa22ae9f1f6..bec222ca9ba4 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -171,7 +171,7 @@ void ext4_delete_inode(struct inode *inode) | |||
171 | int err; | 171 | int err; |
172 | 172 | ||
173 | if (!is_bad_inode(inode)) | 173 | if (!is_bad_inode(inode)) |
174 | vfs_dq_init(inode); | 174 | dquot_initialize(inode); |
175 | 175 | ||
176 | if (ext4_should_order_data(inode)) | 176 | if (ext4_should_order_data(inode)) |
177 | ext4_begin_ordered_truncate(inode, 0); | 177 | ext4_begin_ordered_truncate(inode, 0); |
@@ -5255,7 +5255,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) | |||
5255 | return error; | 5255 | return error; |
5256 | 5256 | ||
5257 | if (ia_valid & ATTR_SIZE) | 5257 | if (ia_valid & ATTR_SIZE) |
5258 | vfs_dq_init(inode); | 5258 | dquot_initialize(inode); |
5259 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 5259 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
5260 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { | 5260 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { |
5261 | handle_t *handle; | 5261 | handle_t *handle; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 20f55c2e7571..7f3d2d75a0dc 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1766,7 +1766,7 @@ static int ext4_create(struct inode *dir, struct dentry *dentry, int mode, | |||
1766 | struct inode *inode; | 1766 | struct inode *inode; |
1767 | int err, retries = 0; | 1767 | int err, retries = 0; |
1768 | 1768 | ||
1769 | vfs_dq_init(dir); | 1769 | dquot_initialize(dir); |
1770 | 1770 | ||
1771 | retry: | 1771 | retry: |
1772 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1772 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -1802,7 +1802,7 @@ static int ext4_mknod(struct inode *dir, struct dentry *dentry, | |||
1802 | if (!new_valid_dev(rdev)) | 1802 | if (!new_valid_dev(rdev)) |
1803 | return -EINVAL; | 1803 | return -EINVAL; |
1804 | 1804 | ||
1805 | vfs_dq_init(dir); | 1805 | dquot_initialize(dir); |
1806 | 1806 | ||
1807 | retry: | 1807 | retry: |
1808 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1808 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -1841,7 +1841,7 @@ static int ext4_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
1841 | if (EXT4_DIR_LINK_MAX(dir)) | 1841 | if (EXT4_DIR_LINK_MAX(dir)) |
1842 | return -EMLINK; | 1842 | return -EMLINK; |
1843 | 1843 | ||
1844 | vfs_dq_init(dir); | 1844 | dquot_initialize(dir); |
1845 | 1845 | ||
1846 | retry: | 1846 | retry: |
1847 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1847 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -2142,8 +2142,8 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) | |||
2142 | 2142 | ||
2143 | /* Initialize quotas before so that eventual writes go in | 2143 | /* Initialize quotas before so that eventual writes go in |
2144 | * separate transaction */ | 2144 | * separate transaction */ |
2145 | vfs_dq_init(dir); | 2145 | dquot_initialize(dir); |
2146 | vfs_dq_init(dentry->d_inode); | 2146 | dquot_initialize(dentry->d_inode); |
2147 | 2147 | ||
2148 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2148 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2149 | if (IS_ERR(handle)) | 2149 | if (IS_ERR(handle)) |
@@ -2203,8 +2203,8 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) | |||
2203 | 2203 | ||
2204 | /* Initialize quotas before so that eventual writes go | 2204 | /* Initialize quotas before so that eventual writes go |
2205 | * in separate transaction */ | 2205 | * in separate transaction */ |
2206 | vfs_dq_init(dir); | 2206 | dquot_initialize(dir); |
2207 | vfs_dq_init(dentry->d_inode); | 2207 | dquot_initialize(dentry->d_inode); |
2208 | 2208 | ||
2209 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2209 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2210 | if (IS_ERR(handle)) | 2210 | if (IS_ERR(handle)) |
@@ -2260,7 +2260,7 @@ static int ext4_symlink(struct inode *dir, | |||
2260 | if (l > dir->i_sb->s_blocksize) | 2260 | if (l > dir->i_sb->s_blocksize) |
2261 | return -ENAMETOOLONG; | 2261 | return -ENAMETOOLONG; |
2262 | 2262 | ||
2263 | vfs_dq_init(dir); | 2263 | dquot_initialize(dir); |
2264 | 2264 | ||
2265 | retry: | 2265 | retry: |
2266 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 2266 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
@@ -2320,7 +2320,7 @@ static int ext4_link(struct dentry *old_dentry, | |||
2320 | if (inode->i_nlink >= EXT4_LINK_MAX) | 2320 | if (inode->i_nlink >= EXT4_LINK_MAX) |
2321 | return -EMLINK; | 2321 | return -EMLINK; |
2322 | 2322 | ||
2323 | vfs_dq_init(dir); | 2323 | dquot_initialize(dir); |
2324 | 2324 | ||
2325 | /* | 2325 | /* |
2326 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing | 2326 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing |
@@ -2372,15 +2372,15 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2372 | struct ext4_dir_entry_2 *old_de, *new_de; | 2372 | struct ext4_dir_entry_2 *old_de, *new_de; |
2373 | int retval, force_da_alloc = 0; | 2373 | int retval, force_da_alloc = 0; |
2374 | 2374 | ||
2375 | vfs_dq_init(old_dir); | 2375 | dquot_initialize(old_dir); |
2376 | vfs_dq_init(new_dir); | 2376 | dquot_initialize(new_dir); |
2377 | 2377 | ||
2378 | old_bh = new_bh = dir_bh = NULL; | 2378 | old_bh = new_bh = dir_bh = NULL; |
2379 | 2379 | ||
2380 | /* Initialize quotas before so that eventual writes go | 2380 | /* Initialize quotas before so that eventual writes go |
2381 | * in separate transaction */ | 2381 | * in separate transaction */ |
2382 | if (new_dentry->d_inode) | 2382 | if (new_dentry->d_inode) |
2383 | vfs_dq_init(new_dentry->d_inode); | 2383 | dquot_initialize(new_dentry->d_inode); |
2384 | handle = ext4_journal_start(old_dir, 2 * | 2384 | handle = ext4_journal_start(old_dir, 2 * |
2385 | EXT4_DATA_TRANS_BLOCKS(old_dir->i_sb) + | 2385 | EXT4_DATA_TRANS_BLOCKS(old_dir->i_sb) + |
2386 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 2); | 2386 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 2); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 035516c80df2..edcf3b0239d1 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1013,7 +1013,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
1013 | const char *data, size_t len, loff_t off); | 1013 | const char *data, size_t len, loff_t off); |
1014 | 1014 | ||
1015 | static const struct dquot_operations ext4_quota_operations = { | 1015 | static const struct dquot_operations ext4_quota_operations = { |
1016 | .initialize = dquot_initialize, | ||
1017 | #ifdef CONFIG_QUOTA | 1016 | #ifdef CONFIG_QUOTA |
1018 | .get_reserved_space = ext4_get_reserved_space, | 1017 | .get_reserved_space = ext4_get_reserved_space, |
1019 | #endif | 1018 | #endif |
@@ -1931,7 +1930,7 @@ static void ext4_orphan_cleanup(struct super_block *sb, | |||
1931 | } | 1930 | } |
1932 | 1931 | ||
1933 | list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan); | 1932 | list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan); |
1934 | vfs_dq_init(inode); | 1933 | dquot_initialize(inode); |
1935 | if (inode->i_nlink) { | 1934 | if (inode->i_nlink) { |
1936 | ext4_msg(sb, KERN_DEBUG, | 1935 | ext4_msg(sb, KERN_DEBUG, |
1937 | "%s: truncating inode %lu to %lld bytes", | 1936 | "%s: truncating inode %lu to %lld bytes", |
@@ -3700,7 +3699,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
3700 | * Process 1 Process 2 | 3699 | * Process 1 Process 2 |
3701 | * ext4_create() quota_sync() | 3700 | * ext4_create() quota_sync() |
3702 | * jbd2_journal_start() write_dquot() | 3701 | * jbd2_journal_start() write_dquot() |
3703 | * vfs_dq_init() down(dqio_mutex) | 3702 | * dquot_initialize() down(dqio_mutex) |
3704 | * down(dqio_mutex) jbd2_journal_start() | 3703 | * down(dqio_mutex) jbd2_journal_start() |
3705 | * | 3704 | * |
3706 | */ | 3705 | */ |