Commit 137cebf9 authored by hongnanli's avatar hongnanli Committed by Linus Torvalds
Browse files

fs/ocfs2: fix comments mentioning i_mutex

inode->i_mutex has been replaced with inode->i_rwsem long ago.  Fix
comments still mentioning i_mutex.

Link: https://lkml.kernel.org/r/20220214031314.100094-1-hongnan.li@linux.alibaba.com


Signed-off-by: default avatarhongnanli <hongnan.li@linux.alibaba.com>
Acked-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 38c9d2d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5981,7 +5981,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
	return status;
}

/* Expects you to already be holding tl_inode->i_mutex */
/* Expects you to already be holding tl_inode->i_rwsem */
int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
{
	int status;
+1 −1
Original line number Diff line number Diff line
@@ -2311,7 +2311,7 @@ static int ocfs2_dio_end_io_write(struct inode *inode,

	down_write(&oi->ip_alloc_sem);

	/* Delete orphan before acquire i_mutex. */
	/* Delete orphan before acquire i_rwsem. */
	if (dwc->dw_orphaned) {
		BUG_ON(dwc->dw_writer_pid != task_pid_nr(current));

+1 −1
Original line number Diff line number Diff line
@@ -689,7 +689,7 @@ static struct config_group *o2nm_cluster_group_make_group(struct config_group *g
	struct o2nm_node_group *ns = NULL;
	struct config_group *o2hb_group = NULL, *ret = NULL;

	/* this runs under the parent dir's i_mutex; there can be only
	/* this runs under the parent dir's i_rwsem; there can be only
	 * one caller in here at a time */
	if (o2nm_single_cluster)
		return ERR_PTR(-ENOSPC);
+2 −2
Original line number Diff line number Diff line
@@ -1957,7 +1957,7 @@ int ocfs2_readdir(struct file *file, struct dir_context *ctx)
}

/*
 * NOTE: this should always be called with parent dir i_mutex taken.
 * NOTE: this should always be called with parent dir i_rwsem taken.
 */
int ocfs2_find_files_on_disk(const char *name,
			     int namelen,
@@ -2003,7 +2003,7 @@ int ocfs2_lookup_ino_from_name(struct inode *dir, const char *name,
 * Return 0 if the name does not exist
 * Return -EEXIST if the directory contains the name
 *
 * Callers should have i_mutex + a cluster lock on dir
 * Callers should have i_rwsem + a cluster lock on dir
 */
int ocfs2_check_dir_for_entry(struct inode *dir,
			      const char *name,
+2 −2
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ int ocfs2_update_inode_atime(struct inode *inode,

	/*
	 * Don't use ocfs2_mark_inode_dirty() here as we don't always
	 * have i_mutex to guard against concurrent changes to other
	 * have i_rwsem to guard against concurrent changes to other
	 * inode fields.
	 */
	inode->i_atime = current_time(inode);
@@ -1065,7 +1065,7 @@ static int ocfs2_extend_file(struct inode *inode,
	/*
	 * The alloc sem blocks people in read/write from reading our
	 * allocation until we're done changing it. We depend on
	 * i_mutex to block other extend/truncate calls while we're
	 * i_rwsem to block other extend/truncate calls while we're
	 * here.  We even have to hold it for sparse files because there
	 * might be some tail zeroing.
	 */
Loading