diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-02 00:57:06 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 05:12:44 -0400 |
commit | 8264613def2e5c4f12bc3167713090fd172e6055 (patch) | |
tree | 00a8655bce02f97acf559580bdd9ba65919af2bf | |
parent | 0a0d8a46757e2063433c8cd52b7d654e02b4682b (diff) |
[PATCH] switch quota_on-related stuff to kern_path()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/dquot.c | 10 | ||||
-rw-r--r-- | fs/ext3/super.c | 22 | ||||
-rw-r--r-- | fs/ext4/super.c | 24 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 18 |
4 files changed, 37 insertions, 37 deletions
diff --git a/fs/dquot.c b/fs/dquot.c index da30a27f2242..5e95261005b2 100644 --- a/fs/dquot.c +++ b/fs/dquot.c | |||
@@ -1805,19 +1805,19 @@ int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | |||
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | /* Actual function called from quotactl() */ | 1807 | /* Actual function called from quotactl() */ |
1808 | int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path, | 1808 | int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name, |
1809 | int remount) | 1809 | int remount) |
1810 | { | 1810 | { |
1811 | struct nameidata nd; | 1811 | struct path path; |
1812 | int error; | 1812 | int error; |
1813 | 1813 | ||
1814 | if (remount) | 1814 | if (remount) |
1815 | return vfs_quota_on_remount(sb, type); | 1815 | return vfs_quota_on_remount(sb, type); |
1816 | 1816 | ||
1817 | error = path_lookup(path, LOOKUP_FOLLOW, &nd); | 1817 | error = kern_path(name, LOOKUP_FOLLOW, &path); |
1818 | if (!error) { | 1818 | if (!error) { |
1819 | error = vfs_quota_on_path(sb, type, format_id, &nd.path); | 1819 | error = vfs_quota_on_path(sb, type, format_id, &path); |
1820 | path_put(&nd.path); | 1820 | path_put(&path); |
1821 | } | 1821 | } |
1822 | return error; | 1822 | return error; |
1823 | } | 1823 | } |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 3a260af5544d..5b7fee10566f 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -2783,30 +2783,30 @@ static int ext3_quota_on_mount(struct super_block *sb, int type) | |||
2783 | * Standard function to be called on quota_on | 2783 | * Standard function to be called on quota_on |
2784 | */ | 2784 | */ |
2785 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 2785 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
2786 | char *path, int remount) | 2786 | char *name, int remount) |
2787 | { | 2787 | { |
2788 | int err; | 2788 | int err; |
2789 | struct nameidata nd; | 2789 | struct path path; |
2790 | 2790 | ||
2791 | if (!test_opt(sb, QUOTA)) | 2791 | if (!test_opt(sb, QUOTA)) |
2792 | return -EINVAL; | 2792 | return -EINVAL; |
2793 | /* When remounting, no checks are needed and in fact, path is NULL */ | 2793 | /* When remounting, no checks are needed and in fact, name is NULL */ |
2794 | if (remount) | 2794 | if (remount) |
2795 | return vfs_quota_on(sb, type, format_id, path, remount); | 2795 | return vfs_quota_on(sb, type, format_id, name, remount); |
2796 | 2796 | ||
2797 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); | 2797 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
2798 | if (err) | 2798 | if (err) |
2799 | return err; | 2799 | return err; |
2800 | 2800 | ||
2801 | /* Quotafile not on the same filesystem? */ | 2801 | /* Quotafile not on the same filesystem? */ |
2802 | if (nd.path.mnt->mnt_sb != sb) { | 2802 | if (path.mnt->mnt_sb != sb) { |
2803 | path_put(&nd.path); | 2803 | path_put(&path); |
2804 | return -EXDEV; | 2804 | return -EXDEV; |
2805 | } | 2805 | } |
2806 | /* Journaling quota? */ | 2806 | /* Journaling quota? */ |
2807 | if (EXT3_SB(sb)->s_qf_names[type]) { | 2807 | if (EXT3_SB(sb)->s_qf_names[type]) { |
2808 | /* Quotafile not of fs root? */ | 2808 | /* Quotafile not of fs root? */ |
2809 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 2809 | if (path.dentry->d_parent != sb->s_root) |
2810 | printk(KERN_WARNING | 2810 | printk(KERN_WARNING |
2811 | "EXT3-fs: Quota file not on filesystem root. " | 2811 | "EXT3-fs: Quota file not on filesystem root. " |
2812 | "Journaled quota will not work.\n"); | 2812 | "Journaled quota will not work.\n"); |
@@ -2816,7 +2816,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
2816 | * When we journal data on quota file, we have to flush journal to see | 2816 | * When we journal data on quota file, we have to flush journal to see |
2817 | * all updates to the file when we bypass pagecache... | 2817 | * all updates to the file when we bypass pagecache... |
2818 | */ | 2818 | */ |
2819 | if (ext3_should_journal_data(nd.path.dentry->d_inode)) { | 2819 | if (ext3_should_journal_data(path.dentry->d_inode)) { |
2820 | /* | 2820 | /* |
2821 | * We don't need to lock updates but journal_flush() could | 2821 | * We don't need to lock updates but journal_flush() could |
2822 | * otherwise be livelocked... | 2822 | * otherwise be livelocked... |
@@ -2826,8 +2826,8 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
2826 | journal_unlock_updates(EXT3_SB(sb)->s_journal); | 2826 | journal_unlock_updates(EXT3_SB(sb)->s_journal); |
2827 | } | 2827 | } |
2828 | 2828 | ||
2829 | err = vfs_quota_on_path(sb, type, format_id, &nd.path); | 2829 | err = vfs_quota_on_path(sb, type, format_id, &path); |
2830 | path_put(&nd.path); | 2830 | path_put(&path); |
2831 | return err; | 2831 | return err; |
2832 | } | 2832 | } |
2833 | 2833 | ||
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9b2b2bc4ec17..ae35f176b697 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3328,30 +3328,30 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) | |||
3328 | * Standard function to be called on quota_on | 3328 | * Standard function to be called on quota_on |
3329 | */ | 3329 | */ |
3330 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 3330 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
3331 | char *path, int remount) | 3331 | char *name, int remount) |
3332 | { | 3332 | { |
3333 | int err; | 3333 | int err; |
3334 | struct nameidata nd; | 3334 | struct path path; |
3335 | 3335 | ||
3336 | if (!test_opt(sb, QUOTA)) | 3336 | if (!test_opt(sb, QUOTA)) |
3337 | return -EINVAL; | 3337 | return -EINVAL; |
3338 | /* When remounting, no checks are needed and in fact, path is NULL */ | 3338 | /* When remounting, no checks are needed and in fact, name is NULL */ |
3339 | if (remount) | 3339 | if (remount) |
3340 | return vfs_quota_on(sb, type, format_id, path, remount); | 3340 | return vfs_quota_on(sb, type, format_id, name, remount); |
3341 | 3341 | ||
3342 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); | 3342 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
3343 | if (err) | 3343 | if (err) |
3344 | return err; | 3344 | return err; |
3345 | 3345 | ||
3346 | /* Quotafile not on the same filesystem? */ | 3346 | /* Quotafile not on the same filesystem? */ |
3347 | if (nd.path.mnt->mnt_sb != sb) { | 3347 | if (path.mnt->mnt_sb != sb) { |
3348 | path_put(&nd.path); | 3348 | path_put(&path); |
3349 | return -EXDEV; | 3349 | return -EXDEV; |
3350 | } | 3350 | } |
3351 | /* Journaling quota? */ | 3351 | /* Journaling quota? */ |
3352 | if (EXT4_SB(sb)->s_qf_names[type]) { | 3352 | if (EXT4_SB(sb)->s_qf_names[type]) { |
3353 | /* Quotafile not in fs root? */ | 3353 | /* Quotafile not in fs root? */ |
3354 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 3354 | if (path.dentry->d_parent != sb->s_root) |
3355 | printk(KERN_WARNING | 3355 | printk(KERN_WARNING |
3356 | "EXT4-fs: Quota file not on filesystem root. " | 3356 | "EXT4-fs: Quota file not on filesystem root. " |
3357 | "Journaled quota will not work.\n"); | 3357 | "Journaled quota will not work.\n"); |
@@ -3361,7 +3361,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3361 | * When we journal data on quota file, we have to flush journal to see | 3361 | * When we journal data on quota file, we have to flush journal to see |
3362 | * all updates to the file when we bypass pagecache... | 3362 | * all updates to the file when we bypass pagecache... |
3363 | */ | 3363 | */ |
3364 | if (ext4_should_journal_data(nd.path.dentry->d_inode)) { | 3364 | if (ext4_should_journal_data(path.dentry->d_inode)) { |
3365 | /* | 3365 | /* |
3366 | * We don't need to lock updates but journal_flush() could | 3366 | * We don't need to lock updates but journal_flush() could |
3367 | * otherwise be livelocked... | 3367 | * otherwise be livelocked... |
@@ -3370,13 +3370,13 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3370 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); | 3370 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); |
3371 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); | 3371 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); |
3372 | if (err) { | 3372 | if (err) { |
3373 | path_put(&nd.path); | 3373 | path_put(&path); |
3374 | return err; | 3374 | return err; |
3375 | } | 3375 | } |
3376 | } | 3376 | } |
3377 | 3377 | ||
3378 | err = vfs_quota_on_path(sb, type, format_id, &nd.path); | 3378 | err = vfs_quota_on_path(sb, type, format_id, &path); |
3379 | path_put(&nd.path); | 3379 | path_put(&path); |
3380 | return err; | 3380 | return err; |
3381 | } | 3381 | } |
3382 | 3382 | ||
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index d318c7e663fa..663a91f5dce8 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -2058,10 +2058,10 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type) | |||
2058 | * Standard function to be called on quota_on | 2058 | * Standard function to be called on quota_on |
2059 | */ | 2059 | */ |
2060 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | 2060 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, |
2061 | char *path, int remount) | 2061 | char *name, int remount) |
2062 | { | 2062 | { |
2063 | int err; | 2063 | int err; |
2064 | struct nameidata nd; | 2064 | struct path path; |
2065 | struct inode *inode; | 2065 | struct inode *inode; |
2066 | struct reiserfs_transaction_handle th; | 2066 | struct reiserfs_transaction_handle th; |
2067 | 2067 | ||
@@ -2069,16 +2069,16 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2069 | return -EINVAL; | 2069 | return -EINVAL; |
2070 | /* No more checks needed? Path and format_id are bogus anyway... */ | 2070 | /* No more checks needed? Path and format_id are bogus anyway... */ |
2071 | if (remount) | 2071 | if (remount) |
2072 | return vfs_quota_on(sb, type, format_id, path, 1); | 2072 | return vfs_quota_on(sb, type, format_id, name, 1); |
2073 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); | 2073 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
2074 | if (err) | 2074 | if (err) |
2075 | return err; | 2075 | return err; |
2076 | /* Quotafile not on the same filesystem? */ | 2076 | /* Quotafile not on the same filesystem? */ |
2077 | if (nd.path.mnt->mnt_sb != sb) { | 2077 | if (path.mnt->mnt_sb != sb) { |
2078 | err = -EXDEV; | 2078 | err = -EXDEV; |
2079 | goto out; | 2079 | goto out; |
2080 | } | 2080 | } |
2081 | inode = nd.path.dentry->d_inode; | 2081 | inode = path.dentry->d_inode; |
2082 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ | 2082 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ |
2083 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { | 2083 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { |
2084 | err = reiserfs_unpack(inode, NULL); | 2084 | err = reiserfs_unpack(inode, NULL); |
@@ -2094,7 +2094,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2094 | /* Journaling quota? */ | 2094 | /* Journaling quota? */ |
2095 | if (REISERFS_SB(sb)->s_qf_names[type]) { | 2095 | if (REISERFS_SB(sb)->s_qf_names[type]) { |
2096 | /* Quotafile not of fs root? */ | 2096 | /* Quotafile not of fs root? */ |
2097 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 2097 | if (path.dentry->d_parent != sb->s_root) |
2098 | reiserfs_warning(sb, | 2098 | reiserfs_warning(sb, |
2099 | "reiserfs: Quota file not on filesystem root. " | 2099 | "reiserfs: Quota file not on filesystem root. " |
2100 | "Journalled quota will not work."); | 2100 | "Journalled quota will not work."); |
@@ -2113,9 +2113,9 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2113 | if (err) | 2113 | if (err) |
2114 | goto out; | 2114 | goto out; |
2115 | } | 2115 | } |
2116 | err = vfs_quota_on_path(sb, type, format_id, &nd.path); | 2116 | err = vfs_quota_on_path(sb, type, format_id, &path); |
2117 | out: | 2117 | out: |
2118 | path_put(&nd.path); | 2118 | path_put(&path); |
2119 | return err; | 2119 | return err; |
2120 | } | 2120 | } |
2121 | 2121 | ||