summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2018-04-06 16:07:45 -0400
committerBob Peterson <rpeterso@redhat.com>2018-04-12 13:07:51 -0400
commit3e7aafc39c59c639ebd5961f893743f076df9b4e (patch)
treec8d79c8ae01e09510e22f18b56757f1b8df507e5
parent3fd5d3ad35dc44aaf0f28d60cc0eb75887bff54d (diff)
GFS2: Minor improvements to comments and documentation
This patch simply fixes some comments and the gfs2-glocks.txt file: Places where i_rwsem was called i_mutex, and adding i_rw_mutex. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r--Documentation/filesystems/gfs2-glocks.txt5
-rw-r--r--fs/gfs2/bmap.c2
-rw-r--r--fs/gfs2/ops_fstype.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/Documentation/filesystems/gfs2-glocks.txt b/Documentation/filesystems/gfs2-glocks.txt
index 1fb12f9dfe48..7059623635b2 100644
--- a/Documentation/filesystems/gfs2-glocks.txt
+++ b/Documentation/filesystems/gfs2-glocks.txt
@@ -100,14 +100,15 @@ indicates that it is caching uptodate data.
100 100
101Glock locking order within GFS2: 101Glock locking order within GFS2:
102 102
103 1. i_mutex (if required) 103 1. i_rwsem (if required)
104 2. Rename glock (for rename only) 104 2. Rename glock (for rename only)
105 3. Inode glock(s) 105 3. Inode glock(s)
106 (Parents before children, inodes at "same level" with same parent in 106 (Parents before children, inodes at "same level" with same parent in
107 lock number order) 107 lock number order)
108 4. Rgrp glock(s) (for (de)allocation operations) 108 4. Rgrp glock(s) (for (de)allocation operations)
109 5. Transaction glock (via gfs2_trans_begin) for non-read operations 109 5. Transaction glock (via gfs2_trans_begin) for non-read operations
110 6. Page lock (always last, very important!) 110 6. i_rw_mutex (if required)
111 7. Page lock (always last, very important!)
111 112
112There are two glocks per inode. One deals with access to the inode 113There are two glocks per inode. One deals with access to the inode
113itself (locking order as above), and the other, known as the iopen 114itself (locking order as above), and the other, known as the iopen
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 685c305cbeb6..278ed0869c3c 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1744,7 +1744,7 @@ do_grow_qunlock:
1744 * @newsize: the size to make the file 1744 * @newsize: the size to make the file
1745 * 1745 *
1746 * The file size can grow, shrink, or stay the same size. This 1746 * The file size can grow, shrink, or stay the same size. This
1747 * is called holding i_mutex and an exclusive glock on the inode 1747 * is called holding i_rwsem and an exclusive glock on the inode
1748 * in question. 1748 * in question.
1749 * 1749 *
1750 * Returns: errno 1750 * Returns: errno
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index e6a0a8a89ea7..3ba3f167641c 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -825,7 +825,7 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo)
825 goto fail_rindex; 825 goto fail_rindex;
826 } 826 }
827 /* 827 /*
828 * i_mutex on quota files is special. Since this inode is hidden system 828 * i_rwsem on quota files is special. Since this inode is hidden system
829 * file, we are safe to define locking ourselves. 829 * file, we are safe to define locking ourselves.
830 */ 830 */
831 lockdep_set_class(&sdp->sd_quota_inode->i_rwsem, 831 lockdep_set_class(&sdp->sd_quota_inode->i_rwsem,