diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-02-13 06:24:18 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-03-09 18:32:56 +0000 |
commit | 940f870f4716f9cd32c68db95aa326a0ae87bf03 (patch) | |
tree | 36ccd616706422a69b771b0402e55f56dbd84093 /libglusterfs/src/xlator.c | |
parent | b2613c9eed6b9d840bc88105dadf282488e6cd64 (diff) |
core: provide infra to make any xlator pass-through
updates: #304
Change-Id: If6a13d2e56b195390a386d720103a882e077f66c
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r-- | libglusterfs/src/xlator.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 4071a7c0569..466be5e3a3a 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -15,9 +15,11 @@ #include "defaults.h" #include "libglusterfs-messages.h" -#define SET_DEFAULT_FOP(fn) do { \ - if (!xl->fops->fn) \ - xl->fops->fn = default_##fn; \ +#define SET_DEFAULT_FOP(fn) do { \ + if (!xl->fops->fn) \ + xl->fops->fn = default_##fn; \ + if (!xl->pass_through_fops->fn) \ + xl->pass_through_fops->fn = default_##fn; \ } while (0) #define SET_DEFAULT_CBK(fn) do { \ @@ -54,6 +56,9 @@ fill_defaults (xlator_t *xl) return; } + if (!xl->pass_through_fops) + xl->pass_through_fops = default_fops; + SET_DEFAULT_FOP (create); SET_DEFAULT_FOP (open); SET_DEFAULT_FOP (stat); @@ -386,6 +391,13 @@ int xlator_dynload_newway (xlator_t *xl) xl->name); } + xl->pass_through_fops = xlapi->pass_through_fops; + if (!xl->pass_through_fops) { + gf_msg_trace ("xlator", 0, "%s: method missing (pass_through_fops), " + "falling back to default", + xl->name); + } + vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t), gf_common_mt_volume_opt_list_t); if (!vol_opt) { |