aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_file.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-10-17 03:47:38 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:07:23 -0500
commit5561093e2cac9f7d2a77e39cc689b8d2b7f9b2bc (patch)
treeaac1fa3e47604f2d7bb1e4d9e97f41b8ffebe91e /fs/gfs2/ops_file.c
parentbf36a713169432643d4fc7eeb4e0ace96d791d26 (diff)
[GFS2] Introduce gfs2_set_aops()
Just like ext3 we now have three sets of address space operations to cover the cases of writeback, ordered and journalled data writes. This means that the individual operations can now become less complicated as we are able to remove some of the tests for file data mode from the code. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r--fs/gfs2/ops_file.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 6f3aeb059c61..ad5daaa6babc 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -38,6 +38,7 @@
38#include "trans.h" 38#include "trans.h"
39#include "util.h" 39#include "util.h"
40#include "eaops.h" 40#include "eaops.h"
41#include "ops_address.h"
41 42
42/** 43/**
43 * gfs2_llseek - seek to a location in a file 44 * gfs2_llseek - seek to a location in a file
@@ -245,7 +246,16 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
245 if (error) 246 if (error)
246 goto out; 247 goto out;
247 } 248 }
248 249 if ((flags ^ new_flags) & GFS2_DIF_JDATA) {
250 if (flags & GFS2_DIF_JDATA)
251 gfs2_log_flush(sdp, ip->i_gl);
252 error = filemap_fdatawrite(inode->i_mapping);
253 if (error)
254 goto out;
255 error = filemap_fdatawait(inode->i_mapping);
256 if (error)
257 goto out;
258 }
249 error = gfs2_trans_begin(sdp, RES_DINODE, 0); 259 error = gfs2_trans_begin(sdp, RES_DINODE, 0);
250 if (error) 260 if (error)
251 goto out; 261 goto out;
@@ -257,6 +267,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
257 gfs2_dinode_out(ip, bh->b_data); 267 gfs2_dinode_out(ip, bh->b_data);
258 brelse(bh); 268 brelse(bh);
259 gfs2_set_inode_flags(inode); 269 gfs2_set_inode_flags(inode);
270 gfs2_set_aops(inode);
260out_trans_end: 271out_trans_end:
261 gfs2_trans_end(sdp); 272 gfs2_trans_end(sdp);
262out: 273out: