diff options
| -rw-r--r-- | libglusterfs/src/syncop.c | 102 | ||||
| -rw-r--r-- | libglusterfs/src/syncop.h | 5 | 
2 files changed, 105 insertions, 2 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 0a98b44b9a3..7dbaac6fb1f 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1196,9 +1196,39 @@ syncop_unlink (xlator_t *subvol, loc_t *loc)  }  int +syncop_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, +                   int op_ret, int op_errno, struct iatt *preparent, +                   struct iatt *postparent, dict_t *xdata) +{ +        struct syncargs *args = NULL; + +        args = cookie; + +        args->op_ret   = op_ret; +        args->op_errno = op_errno; + +        __wake (args); + +        return 0; +} + +int +syncop_rmdir (xlator_t *subvol, loc_t *loc) +{ +        struct syncargs args = {0, }; + +        SYNCOP (subvol, (&args), syncop_rmdir_cbk, subvol->fops->rmdir, loc, +                0, NULL); + +        errno = args.op_errno; +        return args.op_ret; +} + + +int  syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, -                  int32_t op_ret, int32_t op_errno, inode_t *inode, -                  struct iatt *buf, struct iatt *preparent, +		 int32_t op_ret, int32_t op_errno, inode_t *inode, +		 struct iatt *buf, struct iatt *preparent,                   struct iatt *postparent, dict_t *xdata)  {          struct syncargs *args = NULL; @@ -1227,6 +1257,41 @@ syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc)          return args.op_ret;  } + +int +syncop_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, +		   int32_t op_ret, int32_t op_errno, struct iatt *buf, +		   struct iatt *preoldparent, struct iatt *postoldparent, +		   struct iatt *prenewparent, struct iatt *postnewparent, +		   dict_t *xdata) +{ +        struct syncargs *args = NULL; + +        args = cookie; + +        args->op_ret = op_ret; +        args->op_errno = op_errno; + +        __wake (args); + +        return 0; +} + + +int +syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc) +{ +        struct syncargs args = {0, }; + +        SYNCOP (subvol, (&args), syncop_rename_cbk, subvol->fops->rename, +                oldloc, newloc, NULL); + +        errno = args.op_errno; + +        return args.op_ret; +} + +  int  syncop_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                        int op_ret, int op_errno, struct iatt *prebuf, @@ -1480,6 +1545,39 @@ syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev,  } + +int +syncop_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, +                  int32_t op_ret, int32_t op_errno, inode_t *inode, +                  struct iatt *buf, struct iatt *preparent, +                  struct iatt *postparent, dict_t *xdata) +{ +        struct syncargs *args = NULL; + +        args = cookie; + +        args->op_ret   = op_ret; +        args->op_errno = op_errno; + +        __wake (args); + +        return 0; +} + + +int +syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *dict) +{ +        struct syncargs args = {0, }; + +        SYNCOP (subvol, (&args), syncop_mkdir_cbk, subvol->fops->mkdir, +                loc, mode, 0, dict); + +        errno = args.op_errno; +        return args.op_ret; + +} +  int  syncop_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                     int32_t op_ret, int32_t op_errno, dict_t *xdata) diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 4da771dfaeb..d10663f6533 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -246,6 +246,7 @@ int syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset);  int syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset);  int syncop_unlink (xlator_t *subvol, loc_t *loc); +int syncop_rmdir (xlator_t *subvol, loc_t *loc);  int syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly);  int syncop_flush (xlator_t *subvol, fd_t *fd); @@ -256,7 +257,11 @@ int syncop_symlink (xlator_t *subvol, loc_t *loc, char *newpath, dict_t *dict);  int syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size);  int syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev,                    dict_t *dict); +int syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *dict);  int syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc);  int syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync);  int syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask); + +int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc); +  #endif /* _SYNCOP_H */  | 
