aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-04 11:41:31 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-04 11:41:31 -0400
commit75d3b817a0b48425da921052955cc58f20bbab52 (patch)
tree7fb2e9bf18d794a590f43397ee56f3ce917a2233 /fs/gfs2/inode.c
parent31e77ac55f18db0ec1c724840927562ef3093ef6 (diff)
[GFS2] Tidy up bmap/inode code
As per Jan Engelhardt's third set of comments, this make various code style changes and moves the structures from format.h into super.c, which was the only place that format.h was actually used. Cc: Jan Engelhardt <jengelh@linux01.gwdg.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index decb0cf85691..1aaaaa1cc8c3 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -97,15 +97,15 @@ void gfs2_inode_attr_in(struct gfs2_inode *ip)
97void gfs2_inode_attr_out(struct gfs2_inode *ip) 97void gfs2_inode_attr_out(struct gfs2_inode *ip)
98{ 98{
99 struct inode *inode = &ip->i_inode; 99 struct inode *inode = &ip->i_inode;
100 100 struct gfs2_dinode *di = &ip->i_di;
101 gfs2_assert_withdraw(GFS2_SB(inode), 101 gfs2_assert_withdraw(GFS2_SB(inode),
102 (ip->i_di.di_mode & S_IFMT) == (inode->i_mode & S_IFMT)); 102 (di->di_mode & S_IFMT) == (inode->i_mode & S_IFMT));
103 ip->i_di.di_mode = inode->i_mode; 103 di->di_mode = inode->i_mode;
104 ip->i_di.di_uid = inode->i_uid; 104 di->di_uid = inode->i_uid;
105 ip->i_di.di_gid = inode->i_gid; 105 di->di_gid = inode->i_gid;
106 ip->i_di.di_atime = inode->i_atime.tv_sec; 106 di->di_atime = inode->i_atime.tv_sec;
107 ip->i_di.di_mtime = inode->i_mtime.tv_sec; 107 di->di_mtime = inode->i_mtime.tv_sec;
108 ip->i_di.di_ctime = inode->i_ctime.tv_sec; 108 di->di_ctime = inode->i_ctime.tv_sec;
109} 109}
110 110
111static int iget_test(struct inode *inode, void *opaque) 111static int iget_test(struct inode *inode, void *opaque)
@@ -1213,31 +1213,26 @@ fail:
1213 * 1213 *
1214 * Returns: 1 if A > B 1214 * Returns: 1 if A > B
1215 * -1 if A < B 1215 * -1 if A < B
1216 * 0 if A = B 1216 * 0 if A == B
1217 */ 1217 */
1218 1218
1219static int glock_compare_atime(const void *arg_a, const void *arg_b) 1219static int glock_compare_atime(const void *arg_a, const void *arg_b)
1220{ 1220{
1221 struct gfs2_holder *gh_a = *(struct gfs2_holder **)arg_a; 1221 const struct gfs2_holder *gh_a = *(const struct gfs2_holder **)arg_a;
1222 struct gfs2_holder *gh_b = *(struct gfs2_holder **)arg_b; 1222 const struct gfs2_holder *gh_b = *(const struct gfs2_holder **)arg_b;
1223 struct lm_lockname *a = &gh_a->gh_gl->gl_name; 1223 const struct lm_lockname *a = &gh_a->gh_gl->gl_name;
1224 struct lm_lockname *b = &gh_b->gh_gl->gl_name; 1224 const struct lm_lockname *b = &gh_b->gh_gl->gl_name;
1225 int ret = 0;
1226 1225
1227 if (a->ln_number > b->ln_number) 1226 if (a->ln_number > b->ln_number)
1228 ret = 1; 1227 return 1;
1229 else if (a->ln_number < b->ln_number) 1228 if (a->ln_number < b->ln_number)
1230 ret = -1; 1229 return -1;
1231 else { 1230 if (gh_a->gh_state == LM_ST_SHARED && gh_b->gh_state == LM_ST_EXCLUSIVE)
1232 if (gh_a->gh_state == LM_ST_SHARED && 1231 return 1;
1233 gh_b->gh_state == LM_ST_EXCLUSIVE) 1232 if (gh_a->gh_state == LM_ST_SHARED && (gh_b->gh_flags & GL_ATIME))
1234 ret = 1; 1233 return 1;
1235 else if (gh_a->gh_state == LM_ST_SHARED &&
1236 (gh_b->gh_flags & GL_ATIME))
1237 ret = 1;
1238 }
1239 1234
1240 return ret; 1235 return 0;
1241} 1236}
1242 1237
1243/** 1238/**