You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
+2
-2
@@ -914,7 +914,7 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t le
|
||||
if ((mode & ~FALLOC_FL_KEEP_SIZE) || gfs2_is_jdata(ip))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
|
||||
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
|
||||
ret = gfs2_glock_nq(&gh);
|
||||
@@ -946,7 +946,7 @@ out_unlock:
|
||||
gfs2_glock_dq(&gh);
|
||||
out_uninit:
|
||||
gfs2_holder_uninit(&gh);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2067,7 +2067,7 @@ static int gfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
|
||||
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
|
||||
if (ret)
|
||||
@@ -2094,7 +2094,7 @@ static int gfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
||||
|
||||
gfs2_glock_dq_uninit(&gh);
|
||||
out:
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -888,7 +888,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
|
||||
return -ENOMEM;
|
||||
|
||||
sort(qda, num_qd, sizeof(struct gfs2_quota_data *), sort_qd, NULL);
|
||||
mutex_lock(&ip->i_inode.i_mutex);
|
||||
inode_lock(&ip->i_inode);
|
||||
for (qx = 0; qx < num_qd; qx++) {
|
||||
error = gfs2_glock_nq_init(qda[qx]->qd_gl, LM_ST_EXCLUSIVE,
|
||||
GL_NOCACHE, &ghs[qx]);
|
||||
@@ -953,7 +953,7 @@ out_alloc:
|
||||
out:
|
||||
while (qx--)
|
||||
gfs2_glock_dq_uninit(&ghs[qx]);
|
||||
mutex_unlock(&ip->i_inode.i_mutex);
|
||||
inode_unlock(&ip->i_inode);
|
||||
kfree(ghs);
|
||||
gfs2_log_flush(ip->i_gl->gl_name.ln_sbd, ip->i_gl, NORMAL_FLUSH);
|
||||
return error;
|
||||
@@ -1674,7 +1674,7 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
|
||||
if (error)
|
||||
goto out_put;
|
||||
|
||||
mutex_lock(&ip->i_inode.i_mutex);
|
||||
inode_lock(&ip->i_inode);
|
||||
error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_EXCLUSIVE, 0, &q_gh);
|
||||
if (error)
|
||||
goto out_unlockput;
|
||||
@@ -1739,7 +1739,7 @@ out_i:
|
||||
out_q:
|
||||
gfs2_glock_dq_uninit(&q_gh);
|
||||
out_unlockput:
|
||||
mutex_unlock(&ip->i_inode.i_mutex);
|
||||
inode_unlock(&ip->i_inode);
|
||||
out_put:
|
||||
qd_put(qd);
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user