History

quota: Rename vfs_load_quota_inode() to dquot_load_quota_inode()

Rename vfs_load_quota_inode() to dquot_load_quota_inode() to be consistent with naming of other functions used for enabling quota accounting from filesystems. Also export the function and add some sanity checks to assure filesystems are calling the function properly.

Jan Kara committed 7 years ago

Commit dc194321 parent ae45f072 files · +15 −6Browse files

Unified · Split

2 files
  1. fs/quota/dquot.c +13 −6
  2. include/linux/quotaops.h +2 −0
fs/quota/dquot.c+13−6
@@ -2351,6 +2351,12 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id, · 2350 unmodified lines
23512351 struct quota_info *dqopt = sb_dqopt(sb);
23522352 int error;
23532353
2354+ /* Just unsuspend quotas? */
2355+ BUG_ON(flags & DQUOT_SUSPENDED);
2356+ /* s_umount should be held in exclusive mode */
2357+ if (WARN_ON_ONCE(down_read_trylock(&sb->s_umount)))
2358+ up_read(&sb->s_umount);
2359+
23542360 if (!fmt)
23552361 return -ESRCH;
23562362 if (!sb->s_op->quota_write || !sb->s_op->quota_read ||
@@ -2417,10 +2423,10 @@ out_fmt: · 60 unmodified lines
24172423 EXPORT_SYMBOL(dquot_load_quota_sb);
24182424
24192425 /*
2420− * Helper function to turn quotas on when we already have the inode of
2421− * quota file and no quota information is loaded.
2426+ * More powerful function for turning on quotas on given quota inode allowing
2427+ * setting of individual quota flags
24222428 */
2423−static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2429+int dquot_load_quota_inode(struct inode *inode, int type, int format_id,
24242430 unsigned int flags)
24252431 {
24262432 int err;
@@ -2433,6 +2439,7 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id, · 6 unmodified lines
24332439 vfs_cleanup_quota_inode(inode->i_sb, type);
24342440 return err;
24352441 }
2442+EXPORT_SYMBOL(dquot_load_quota_inode);
24362443
24372444 /* Reenable quotas on remount RW */
24382445 int dquot_resume(struct super_block *sb, int type)
@@ -2479,7 +2486,7 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id, · 40 unmodified lines
24792486 if (path->dentry->d_sb != sb)
24802487 error = -EXDEV;
24812488 else
2482− error = vfs_load_quota_inode(d_inode(path->dentry), type,
2489+ error = dquot_load_quota_inode(d_inode(path->dentry), type,
24832490 format_id, DQUOT_USAGE_ENABLED |
24842491 DQUOT_LIMITS_ENABLED);
24852492 return error;
@@ -2517,7 +2524,7 @@ int dquot_enable(struct inode *inode, int type, int format_id, · 31 unmodified lines
25172524 return 0;
25182525 }
25192526
2520− return vfs_load_quota_inode(inode, type, format_id, flags);
2527+ return dquot_load_quota_inode(inode, type, format_id, flags);
25212528 }
25222529 EXPORT_SYMBOL(dquot_enable);
25232530
@@ -2542,7 +2549,7 @@ int dquot_quota_on_mount(struct super_block *sb, char *qf_name, · 18 unmodified lines
25422549
25432550 error = security_quota_on(dentry);
25442551 if (!error)
2545− error = vfs_load_quota_inode(d_inode(dentry), type, format_id,
2552+ error = dquot_load_quota_inode(d_inode(dentry), type, format_id,
25462553 DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
25472554
25482555 out:
include/linux/quotaops.h+2−0
@@ -91,6 +91,8 @@ int dquot_enable(struct inode *inode, int type, int format_id, · 90 unmodified lines
9191 unsigned int flags);
9292 int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
9393 unsigned int flags);
94+int dquot_load_quota_inode(struct inode *inode, int type, int format_id,
95+ unsigned int flags);
9496 int dquot_quota_on(struct super_block *sb, int type, int format_id,
9597 const struct path *path);
9698 int dquot_quota_on_mount(struct super_block *sb, char *qf_name,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t