summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
diff options
context:
space:
mode:
authorKinglong Mee <mijinlong@open-fs.com>2018-01-18 15:51:18 +0800
committerAmar Tumballi <amarts@redhat.com>2018-02-12 21:34:46 +0000
commit09943beb499617212f2985ca8ea9ecd1ed1b470e (patch)
tree49e9f10bfbb66f4ea52f0a9ed3392d9fb69c072b /libglusterfs/src/syncop.c
parentd01f7244e9d9f7e3ef84e0ba7b48ef1b1b09d809 (diff)
gfapi: return pre/post attributes from glfs_fsync/fdatasync
Updates: #389 Change-Id: I4153df72d5eeecefa7579170899db4c340128bea Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r--libglusterfs/src/syncop.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 01036f59f8a..76e1a5e9116 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -2383,6 +2383,11 @@ syncop_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (xdata)
args->xdata = dict_ref (xdata);
+ if (op_ret >= 0) {
+ args->iatt1 = *prebuf;
+ args->iatt2 = *postbuf;
+ }
+
__wake (args);
return 0;
@@ -2390,14 +2395,19 @@ syncop_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
-syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly, dict_t *xdata_in,
- dict_t **xdata_out)
+syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt,
+ struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync,
fd, dataonly, xdata_in);
+ if (preiatt)
+ *preiatt = args.iatt1;
+ if (postiatt)
+ *postiatt = args.iatt2;
+
if (xdata_out)
*xdata_out = args.xdata;
else if (args.xdata)