diff options
author | Gluster Ant <bugzilla-bot@gluster.org> | 2018-09-12 17:22:48 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 17:22:48 +0530 |
commit | 45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch) | |
tree | 2a5a9b73bae47ab53a41166fd041a06612587f48 /xlators/meta | |
parent | be77dbbda692792335a8e9e7c02e0c281f003c40 (diff) |
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'xlators/meta')
-rw-r--r-- | xlators/meta/src/meta-hooks.h | 4 | ||||
-rw-r--r-- | xlators/meta/src/meta-mem-types.h | 15 | ||||
-rw-r--r-- | xlators/meta/src/meta.h | 179 |
3 files changed, 109 insertions, 89 deletions
diff --git a/xlators/meta/src/meta-hooks.h b/xlators/meta/src/meta-hooks.h index bcf3643d223..2ee006f7876 100644 --- a/xlators/meta/src/meta-hooks.h +++ b/xlators/meta/src/meta-hooks.h @@ -12,7 +12,9 @@ #define __META_HOOKS_H #include "xlator.h" -#define DECLARE_HOOK(name) int meta_##name##_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) +#define DECLARE_HOOK(name) \ + int meta_##name##_hook(call_frame_t *frame, xlator_t *this, loc_t *loc, \ + dict_t *xdata) DECLARE_HOOK(root_dir); DECLARE_HOOK(graphs_dir); diff --git a/xlators/meta/src/meta-mem-types.h b/xlators/meta/src/meta-mem-types.h index e8a31856e71..0fdfea4fac6 100644 --- a/xlators/meta/src/meta-mem-types.h +++ b/xlators/meta/src/meta-mem-types.h @@ -14,13 +14,12 @@ #include "mem-types.h" enum gf_meta_mem_types_ { - gf_meta_mt_priv_t = gf_common_mt_end + 1, - gf_meta_mt_fd_t, - gf_meta_mt_fd_data_t, - gf_meta_mt_strfd_t, - gf_meta_mt_dirents_t, - gf_meta_mt_local_t, - gf_meta_mt_end + gf_meta_mt_priv_t = gf_common_mt_end + 1, + gf_meta_mt_fd_t, + gf_meta_mt_fd_data_t, + gf_meta_mt_strfd_t, + gf_meta_mt_dirents_t, + gf_meta_mt_local_t, + gf_meta_mt_end }; #endif - diff --git a/xlators/meta/src/meta.h b/xlators/meta/src/meta.h index d9c56c656ad..10609a9ec05 100644 --- a/xlators/meta/src/meta.h +++ b/xlators/meta/src/meta.h @@ -16,106 +16,125 @@ #define META_ROOT_GFID "ba926388-bb9c-4eec-ad60-79dba4cc083a" -#define IS_META_ROOT_GFID(g) (strcmp (uuid_utoa(g), META_ROOT_GFID) == 0) +#define IS_META_ROOT_GFID(g) (strcmp(uuid_utoa(g), META_ROOT_GFID) == 0) -typedef int (*meta_hook_t) (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata); +typedef int (*meta_hook_t)(call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata); typedef struct { - dict_t *xdata; + dict_t *xdata; } meta_local_t; typedef struct { - char *meta_dir_name; + char *meta_dir_name; } meta_priv_t; struct meta_dirent { - const char *name; - ia_type_t type; - meta_hook_t hook; + const char *name; + ia_type_t type; + meta_hook_t hook; }; -#define DOT_DOTDOT { .name = ".", .type = IA_IFDIR }, { .name = "..", .type = IA_IFDIR } +#define DOT_DOTDOT \ + {.name = ".", .type = IA_IFDIR}, { .name = "..", .type = IA_IFDIR } struct meta_ops { - struct meta_dirent *fixed_dirents; - int (*dir_fill) (xlator_t *this, inode_t *dir, struct meta_dirent **entries); - int (*file_fill) (xlator_t *this, inode_t *file, strfd_t *strfd); - int (*iatt_fill) (xlator_t *this, inode_t *inode, struct iatt *iatt); - int (*link_fill) (xlator_t *this, inode_t *inode, strfd_t *strfd); - int (*file_write) (xlator_t *this, fd_t *fd, struct iovec *iov, int count); - struct xlator_fops fops; - struct xlator_cbks cbks; + struct meta_dirent *fixed_dirents; + int (*dir_fill)(xlator_t *this, inode_t *dir, struct meta_dirent **entries); + int (*file_fill)(xlator_t *this, inode_t *file, strfd_t *strfd); + int (*iatt_fill)(xlator_t *this, inode_t *inode, struct iatt *iatt); + int (*link_fill)(xlator_t *this, inode_t *inode, strfd_t *strfd); + int (*file_write)(xlator_t *this, fd_t *fd, struct iovec *iov, int count); + struct xlator_fops fops; + struct xlator_cbks cbks; }; typedef struct { - char *data; - struct meta_dirent *dirents; - size_t size; + char *data; + struct meta_dirent *dirents; + size_t size; } meta_fd_t; +#define COUNT(arr) (sizeof(arr) / sizeof(arr[0])) -#define COUNT(arr) (sizeof(arr)/sizeof(arr[0])) - -#define META_HOOK(loc) (__is_root_gfid (loc->pargfid) && !strcmp (loc->name, META_PRIV(THIS)->meta_dir_name)) +#define META_HOOK(loc) \ + (__is_root_gfid(loc->pargfid) && \ + !strcmp(loc->name, META_PRIV(THIS)->meta_dir_name)) #define META_PRIV(t) ((meta_priv_t *)(t->private)) -#define META_STACK_UNWIND(fop, frame, params ...) \ - do { \ - meta_local_t *__local = NULL; \ - xlator_t *__this = NULL; \ - if (frame) { \ - __local = frame->local; \ - __this = frame->this; \ - frame->local = NULL; \ - } \ - STACK_UNWIND_STRICT (fop, frame, params); \ - if (__local) { \ - meta_local_cleanup (__local, __this); \ - } \ - } while (0) - - -#define META_FOP(i, fop, fr, t, params ...) { \ - struct xlator_fops *_fops = NULL; \ - \ - _fops = meta_fops_get (i, t); \ - \ - _fops->fop (fr, t, params); \ - } while (0) - - -void meta_iatt_fill (struct iatt *iatt, inode_t *inode, ia_type_t type); - -int meta_inode_discover (call_frame_t *frame, xlator_t *this, loc_t *loc, - dict_t *xdata); - -int meta_ops_set (inode_t *inode, xlator_t *this, struct meta_ops *ops); - -struct xlator_fops *meta_fops_get (inode_t *inode, xlator_t *this); -struct xlator_cbks *meta_cbks_get (inode_t *inode, xlator_t *this); -struct meta_ops *meta_ops_get (inode_t *inode, xlator_t *this); - -int meta_ctx_set (inode_t *inode, xlator_t *this, void *ctx); - -void *meta_ctx_get (inode_t *inode, xlator_t *this); - - -void meta_local_cleanup (meta_local_t *local, xlator_t *this); - -struct xlator_fops *meta_defaults_init (struct xlator_fops *fops); - -meta_fd_t *meta_fd_get (fd_t *fd, xlator_t *this); - -int meta_fd_release (fd_t *fd, xlator_t *this); - -dict_t *meta_direct_io_mode (dict_t *xdata, call_frame_t *frame); - -meta_local_t *meta_local (call_frame_t *frame); - -int meta_file_fill (xlator_t *this, fd_t *fd); - -int meta_dir_fill (xlator_t *this, fd_t *fd); - -int fixed_dirents_len (struct meta_dirent *dirents); +#define META_STACK_UNWIND(fop, frame, params...) \ + do { \ + meta_local_t *__local = NULL; \ + xlator_t *__this = NULL; \ + if (frame) { \ + __local = frame->local; \ + __this = frame->this; \ + frame->local = NULL; \ + } \ + STACK_UNWIND_STRICT(fop, frame, params); \ + if (__local) { \ + meta_local_cleanup(__local, __this); \ + } \ + } while (0) + +#define META_FOP(i, fop, fr, t, params...) \ + { \ + struct xlator_fops *_fops = NULL; \ + \ + _fops = meta_fops_get(i, t); \ + \ + _fops->fop(fr, t, params); \ + } \ + while (0) + +void +meta_iatt_fill(struct iatt *iatt, inode_t *inode, ia_type_t type); + +int +meta_inode_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata); + +int +meta_ops_set(inode_t *inode, xlator_t *this, struct meta_ops *ops); + +struct xlator_fops * +meta_fops_get(inode_t *inode, xlator_t *this); +struct xlator_cbks * +meta_cbks_get(inode_t *inode, xlator_t *this); +struct meta_ops * +meta_ops_get(inode_t *inode, xlator_t *this); + +int +meta_ctx_set(inode_t *inode, xlator_t *this, void *ctx); + +void * +meta_ctx_get(inode_t *inode, xlator_t *this); + +void +meta_local_cleanup(meta_local_t *local, xlator_t *this); + +struct xlator_fops * +meta_defaults_init(struct xlator_fops *fops); + +meta_fd_t * +meta_fd_get(fd_t *fd, xlator_t *this); + +int +meta_fd_release(fd_t *fd, xlator_t *this); + +dict_t * +meta_direct_io_mode(dict_t *xdata, call_frame_t *frame); + +meta_local_t * +meta_local(call_frame_t *frame); + +int +meta_file_fill(xlator_t *this, fd_t *fd); + +int +meta_dir_fill(xlator_t *this, fd_t *fd); + +int +fixed_dirents_len(struct meta_dirent *dirents); #endif /* __META_H__ */ |