diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-08-15 09:20:36 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-10-21 07:39:26 -0400 |
commit | ab9bbda0204dfd0e5342562d9979d1241b14ea5f (patch) | |
tree | 621e623d99fbef1432da17b6390c92d7f13224a4 /fs/gfs2/xattr.c | |
parent | f18185291d605ea9e442e00e2cf6c917a84d9837 (diff) |
GFS2: Use ->dirty_inode()
The aim of this patch is to use the newly enhanced ->dirty_inode()
super block operation to deal with atime updates, rather than
piggy backing that code into ->write_inode() as is currently
done.
The net result is a simplification of the code in various places
and a reduction of the number of gfs2_dinode_out() calls since
this is now implied by ->dirty_inode().
Some of the mark_inode_dirty() calls have been moved under glocks
in order to take advantage of then being able to avoid locking in
->dirty_inode() when we already have suitable locks.
One consequence is that generic_write_end() now correctly deals
with file size updates, so that we do not need a separate check
for that afterwards. This also, indirectly, means that fdatasync
should work correctly on GFS2 - the current code always syncs the
metadata whether it needs to or not.
Has survived testing with postmark (with and without atime) and
also fsx.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/xattr.c')
-rw-r--r-- | fs/gfs2/xattr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 439b61c03262..695304cf01cc 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -1296,7 +1296,8 @@ fail: | |||
1296 | 1296 | ||
1297 | int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data) | 1297 | int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data) |
1298 | { | 1298 | { |
1299 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1299 | struct inode *inode = &ip->i_inode; |
1300 | struct gfs2_sbd *sdp = GFS2_SB(inode); | ||
1300 | struct gfs2_ea_location el; | 1301 | struct gfs2_ea_location el; |
1301 | int error; | 1302 | int error; |
1302 | 1303 | ||
@@ -1319,7 +1320,7 @@ int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data) | |||
1319 | if (error) | 1320 | if (error) |
1320 | return error; | 1321 | return error; |
1321 | 1322 | ||
1322 | error = gfs2_setattr_simple(ip, attr); | 1323 | error = gfs2_setattr_simple(inode, attr); |
1323 | gfs2_trans_end(sdp); | 1324 | gfs2_trans_end(sdp); |
1324 | return error; | 1325 | return error; |
1325 | } | 1326 | } |