quota: mark dquot_load_quota_sb static
PATCH 1/2 quota: mark dquot_load_quota_sb static
dquot_load_quota_sb is only used in dquot.c, so mark it static.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/quota/dquot.c | 5 ++--- include/linux/quotaops.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-)
fs/quota/dquot.c +2 -3
@@ -2352,8 +2352,8 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)return 0 ; } -int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, -unsigned int flags) +static int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, +unsigned int flags) {struct quota_format_type *fmt =find_quota_format (format_id);struct quota_info *dqopt =sb_dqopt (sb);
@@ -2429,7 +2429,6 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,return error; } -EXPORT_SYMBOL (dquot_load_quota_sb);/* * More powerful function for turning on quotas on given quota inode allowing
include/linux/quotaops.h +0 -2
@@ -95,8 +95,6 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);int dquot_file_open (struct inode *inode,struct file *file); -int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, -unsigned int flags);int dquot_load_quota_inode (struct inode *inode,int type,int format_id,unsigned int flags); int dquot_quota_on(struct super_block *sb, int type, int format_id,
Signature · 1 line
2.39.2
PATCH 2/2 quota: use lockdep_assert_held_write in dquot_load_quota_sb
Use lockdep_assert_held_write to assert and self-document the locking state in dquot_load_quota_sb instead of hand-crafting it with a trylock.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/quota/dquot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/quota/dquot.c +2 -3
@@ -2359,11 +2359,10 @@ static int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,struct quota_info *dqopt =sb_dqopt (sb);int error; +lockdep_assert_held_write (&sb->s_umount); +/* Just unsuspend quotas? */ BUG_ON (flags &DQUOT_SUSPENDED ); -/* s_umount should be held in exclusive mode */ -if (WARN_ON_ONCE (down_read_trylock (&sb->s_umount))) -up_read (&sb->s_umount);if (!fmt)return -ESRCH ;
Signature · 1 line
2.39.2
Jan Kara
reviewerQuoted 3 lines · Christoph Hellwig
dquot_load_quota_sbis only used indquot.c, so mark it static.Signed-off-by Christoph Hellwig <[email protected]>
Thanks for the cleanups! I've merged both into my tree.
Honza
Quoted 44 lines
--- fs/quota/dquot.c | 5 ++--- include/linux/quotaops.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-)fs/quota/dquot.c +2
-3@@ -2352,8 +2352,8 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)return 0 ; } -int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, -unsigned int flags) +static int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, +unsigned int flags) {struct quota_format_type *fmt =find_quota_format (format_id);struct quota_info *dqopt =sb_dqopt (sb);@@ -2429,7 +2429,6 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,return error; } -EXPORT_SYMBOL (dquot_load_quota_sb);/* * More powerful function for turning on quotas on given quota inode allowing include/linux/quotaops.h +0
-2@@ -95,8 +95,6 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);int dquot_file_open (struct inode *inode,struct file *file); -int dquot_load_quota_sb (struct super_block *sb,int type,int format_id, -unsigned int flags);int dquot_load_quota_inode (struct inode *inode,int type,int format_id,unsigned int flags); int dquot_quota_on(struct super_block *sb, int type, int format_id,Signature · 1 line
2.39.2
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Jan Kara
reviewerQuoted 6 lines · Jan Kara
Quoted 3 lines · Christoph Hellwig
dquot_load_quota_sbis only used indquot.c, so mark it static.Signed-off-by Christoph Hellwig <[email protected]>Thanks for the cleanups! I've merged both into my tree.
Actually, the new tmpfs quota support uses dquot_load_quota_sb() call as linux-next testing revealed so I've removed the first patch from my tree.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR