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/acl.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/acl.c')
-rw-r--r-- | fs/gfs2/acl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index 34501b64bc47..65978d7885c8 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c | |||
@@ -82,7 +82,7 @@ static int gfs2_set_mode(struct inode *inode, umode_t mode) | |||
82 | iattr.ia_valid = ATTR_MODE; | 82 | iattr.ia_valid = ATTR_MODE; |
83 | iattr.ia_mode = mode; | 83 | iattr.ia_mode = mode; |
84 | 84 | ||
85 | error = gfs2_setattr_simple(GFS2_I(inode), &iattr); | 85 | error = gfs2_setattr_simple(inode, &iattr); |
86 | } | 86 | } |
87 | 87 | ||
88 | return error; | 88 | return error; |
@@ -160,6 +160,7 @@ out: | |||
160 | 160 | ||
161 | int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr) | 161 | int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr) |
162 | { | 162 | { |
163 | struct inode *inode = &ip->i_inode; | ||
163 | struct posix_acl *acl; | 164 | struct posix_acl *acl; |
164 | char *data; | 165 | char *data; |
165 | unsigned int len; | 166 | unsigned int len; |
@@ -169,7 +170,7 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr) | |||
169 | if (IS_ERR(acl)) | 170 | if (IS_ERR(acl)) |
170 | return PTR_ERR(acl); | 171 | return PTR_ERR(acl); |
171 | if (!acl) | 172 | if (!acl) |
172 | return gfs2_setattr_simple(ip, attr); | 173 | return gfs2_setattr_simple(inode, attr); |
173 | 174 | ||
174 | error = posix_acl_chmod(&acl, GFP_NOFS, attr->ia_mode); | 175 | error = posix_acl_chmod(&acl, GFP_NOFS, attr->ia_mode); |
175 | if (error) | 176 | if (error) |