summaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-22 15:40:57 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-01-22 18:04:28 -0500
commit5955102c9984fa081b2d570cfac75c97eecf8f3b (patch)
treea4744386eac4b916e847eb4eedfada158f6527b4 /fs/quota
parent57b8f112cfe6622ddddb8c2641206bb5fa8a112d (diff)
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex). Please, use those for access to ->i_mutex; over the coming cycle ->i_mutex will become rwsem, with ->lookup() done with it held only shared. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index fbd70af98820..3c3b81bb6dfe 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -682,9 +682,9 @@ int dquot_quota_sync(struct super_block *sb, int type)
682 continue; 682 continue;
683 if (!sb_has_quota_active(sb, cnt)) 683 if (!sb_has_quota_active(sb, cnt))
684 continue; 684 continue;
685 mutex_lock(&dqopt->files[cnt]->i_mutex); 685 inode_lock(dqopt->files[cnt]);
686 truncate_inode_pages(&dqopt->files[cnt]->i_data, 0); 686 truncate_inode_pages(&dqopt->files[cnt]->i_data, 0);
687 mutex_unlock(&dqopt->files[cnt]->i_mutex); 687 inode_unlock(dqopt->files[cnt]);
688 } 688 }
689 mutex_unlock(&dqopt->dqonoff_mutex); 689 mutex_unlock(&dqopt->dqonoff_mutex);
690 690
@@ -2162,12 +2162,12 @@ int dquot_disable(struct super_block *sb, int type, unsigned int flags)
2162 /* If quota was reenabled in the meantime, we have 2162 /* If quota was reenabled in the meantime, we have
2163 * nothing to do */ 2163 * nothing to do */
2164 if (!sb_has_quota_loaded(sb, cnt)) { 2164 if (!sb_has_quota_loaded(sb, cnt)) {
2165 mutex_lock(&toputinode[cnt]->i_mutex); 2165 inode_lock(toputinode[cnt]);
2166 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE | 2166 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
2167 S_NOATIME | S_NOQUOTA); 2167 S_NOATIME | S_NOQUOTA);
2168 truncate_inode_pages(&toputinode[cnt]->i_data, 2168 truncate_inode_pages(&toputinode[cnt]->i_data,
2169 0); 2169 0);
2170 mutex_unlock(&toputinode[cnt]->i_mutex); 2170 inode_unlock(toputinode[cnt]);
2171 mark_inode_dirty_sync(toputinode[cnt]); 2171 mark_inode_dirty_sync(toputinode[cnt]);
2172 } 2172 }
2173 mutex_unlock(&dqopt->dqonoff_mutex); 2173 mutex_unlock(&dqopt->dqonoff_mutex);
@@ -2258,11 +2258,11 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2258 /* We don't want quota and atime on quota files (deadlocks 2258 /* We don't want quota and atime on quota files (deadlocks
2259 * possible) Also nobody should write to the file - we use 2259 * possible) Also nobody should write to the file - we use
2260 * special IO operations which ignore the immutable bit. */ 2260 * special IO operations which ignore the immutable bit. */
2261 mutex_lock(&inode->i_mutex); 2261 inode_lock(inode);
2262 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE | 2262 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE |
2263 S_NOQUOTA); 2263 S_NOQUOTA);
2264 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE; 2264 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE;
2265 mutex_unlock(&inode->i_mutex); 2265 inode_unlock(inode);
2266 /* 2266 /*
2267 * When S_NOQUOTA is set, remove dquot references as no more 2267 * When S_NOQUOTA is set, remove dquot references as no more
2268 * references can be added 2268 * references can be added
@@ -2305,12 +2305,12 @@ out_file_init:
2305 iput(inode); 2305 iput(inode);
2306out_lock: 2306out_lock:
2307 if (oldflags != -1) { 2307 if (oldflags != -1) {
2308 mutex_lock(&inode->i_mutex); 2308 inode_lock(inode);
2309 /* Set the flags back (in the case of accidental quotaon() 2309 /* Set the flags back (in the case of accidental quotaon()
2310 * on a wrong file we don't want to mess up the flags) */ 2310 * on a wrong file we don't want to mess up the flags) */
2311 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE); 2311 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE);
2312 inode->i_flags |= oldflags; 2312 inode->i_flags |= oldflags;
2313 mutex_unlock(&inode->i_mutex); 2313 inode_unlock(inode);
2314 } 2314 }
2315 mutex_unlock(&dqopt->dqonoff_mutex); 2315 mutex_unlock(&dqopt->dqonoff_mutex);
2316out_fmt: 2316out_fmt:
@@ -2430,9 +2430,9 @@ int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
2430 struct dentry *dentry; 2430 struct dentry *dentry;
2431 int error; 2431 int error;
2432 2432
2433 mutex_lock(&d_inode(sb->s_root)->i_mutex); 2433 inode_lock(d_inode(sb->s_root));
2434 dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name)); 2434 dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name));
2435 mutex_unlock(&d_inode(sb->s_root)->i_mutex); 2435 inode_unlock(d_inode(sb->s_root));
2436 if (IS_ERR(dentry)) 2436 if (IS_ERR(dentry))
2437 return PTR_ERR(dentry); 2437 return PTR_ERR(dentry);
2438 2438