diff options
-rw-r--r-- | xlators/nfs/server/src/nfs-fops.c | 9 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs-fops.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c index 2624c50e378..1dc07f39a86 100644 --- a/xlators/nfs/server/src/nfs-fops.c +++ b/xlators/nfs/server/src/nfs-fops.c @@ -1370,6 +1370,11 @@ nfs_fop_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, nfl_to_prog_data (nfl, progcbk, frame); + if (!op_ret) + fd_lk_insert_and_merge (nfl->fd, nfl->cmd, &nfl->flock); + + fd_unref (nfl->fd); + if (progcbk) progcbk (frame, cookie, this, op_ret, op_errno, flock); @@ -1392,6 +1397,10 @@ nfs_fop_lk (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, nfs_fop_handle_frame_create (frame, nfsx, nfu, ret, err); nfs_fop_handle_local_init (frame, nfsx, nfl, cbk, local, ret, err); + nfl->cmd = cmd; + nfl->fd = fd_ref (fd); + nfl->flock = *flock; + STACK_WIND_COOKIE (frame, nfs_fop_lk_cbk, xl, xl, xl->fops->lk, fd, cmd, flock); ret = 0; diff --git a/xlators/nfs/server/src/nfs-fops.h b/xlators/nfs/server/src/nfs-fops.h index 2801da2c319..f86a66b2d9d 100644 --- a/xlators/nfs/server/src/nfs-fops.h +++ b/xlators/nfs/server/src/nfs-fops.h @@ -100,6 +100,10 @@ struct nfs_fop_local { char newpath[NFS_NAME_MAX + 1]; xlator_t *nfsx; dict_t *dictgfid; + + fd_t *fd; + int cmd; + struct gf_flock flock; }; extern struct nfs_fop_local * |