diff options
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/syncop.c | 34 | ||||
| -rw-r--r-- | libglusterfs/src/syncop.h | 3 | 
2 files changed, 37 insertions, 0 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 153e74db0f2..74166f1397f 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1888,3 +1888,37 @@ syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask)          errno = args.op_errno;          return args.op_ret;  } + + +int +syncop_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, +	       int op_ret, int op_errno, struct gf_flock *flock, +	       dict_t *xdata) +{ +        struct syncargs *args = NULL; + +        args = cookie; + +        args->op_ret   = op_ret; +        args->op_errno = op_errno; +	if (flock) +		args->flock = *flock; +        __wake (args); + +        return 0; +} + + +int +syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock) +{ +        struct syncargs args = {0, }; + +        SYNCOP (subvol, (&args), syncop_lk_cbk, subvol->fops->lk, +                fd, cmd, flock, NULL); + +        errno = args.op_errno; +	*flock = args.flock; + +        return args.op_ret; +} diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 004336d4cd4..425e077edeb 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -129,6 +129,7 @@ struct syncargs {          struct iobref      *iobref;          char               *buffer;          dict_t             *xdata; +	struct gf_flock     flock;          /* some more _cbk needs */          uuid_t              uuid; @@ -333,4 +334,6 @@ int syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask);  int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc); +int syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock); +  #endif /* _SYNCOP_H */  | 
