diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2018-02-01 10:13:07 +0800 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-02-12 21:34:46 +0000 |
commit | 248152767b0599986bbb6bb35fc27197f6be6964 (patch) | |
tree | f18550ce89d0786cc21dca474d187d45a49017fb /libglusterfs/src/syncop.c | |
parent | 09943beb499617212f2985ca8ea9ecd1ed1b470e (diff) |
gfapi: return pre/post attributes from glfs_ftruncate
Updates: #389
Change-Id: I8faea0828921fb17f05f7321c3cb01747373f21e
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 76e1a5e9116..202b3aba4ab 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -2326,20 +2326,31 @@ syncop_ftruncate_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; } int -syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset, dict_t *xdata_in, - dict_t **xdata_out) +syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset, + struct iatt *preiatt, struct iatt *postiatt, + dict_t *xdata_in, dict_t **xdata_out) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->ftruncate, fd, offset, xdata_in); + if (preiatt) + *preiatt = args.iatt1; + if (postiatt) + *postiatt = args.iatt2; + if (xdata_out) *xdata_out = args.xdata; else if (args.xdata) |