diff options
-rw-r--r-- | libglusterfs/src/statedump.c | 15 | ||||
-rw-r--r-- | libglusterfs/src/statedump.h | 2 | ||||
-rw-r--r-- | xlators/meta/src/Makefile.am | 48 | ||||
-rw-r--r-- | xlators/meta/src/active-link.c (renamed from xlators/meta/src/plugins/active-link.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/cmdline-file.c (renamed from xlators/meta/src/plugins/cmdline-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/frames-file.c (renamed from xlators/meta/src/plugins/frames-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/graph-dir.c (renamed from xlators/meta/src/plugins/graph-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/graphs-dir.c (renamed from xlators/meta/src/plugins/graphs-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/history-file.c | 52 | ||||
-rw-r--r-- | xlators/meta/src/logfile-link.c (renamed from xlators/meta/src/plugins/logfile-link.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/logging-dir.c (renamed from xlators/meta/src/plugins/logging-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/loglevel-file.c (renamed from xlators/meta/src/plugins/loglevel-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/mallinfo-file.c | 44 | ||||
-rw-r--r-- | xlators/meta/src/measure-file.c | 92 | ||||
-rw-r--r-- | xlators/meta/src/meminfo-file.c | 52 | ||||
-rw-r--r-- | xlators/meta/src/meta-defaults.c | 2 | ||||
-rw-r--r-- | xlators/meta/src/meta-hooks.h | 7 | ||||
-rw-r--r-- | xlators/meta/src/name-file.c (renamed from xlators/meta/src/plugins/name-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/option-file.c (renamed from xlators/meta/src/plugins/option-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/options-dir.c (renamed from xlators/meta/src/plugins/options-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/private-file.c | 52 | ||||
-rw-r--r-- | xlators/meta/src/process_uuid-file.c (renamed from xlators/meta/src/plugins/process_uuid-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/profile-file.c | 52 | ||||
-rw-r--r-- | xlators/meta/src/root-dir.c (renamed from xlators/meta/src/plugins/root-dir.c) | 12 | ||||
-rw-r--r-- | xlators/meta/src/subvolume-link.c (renamed from xlators/meta/src/plugins/subvolume-link.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/subvolumes-dir.c (renamed from xlators/meta/src/plugins/subvolumes-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/top-link.c (renamed from xlators/meta/src/plugins/top-link.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/type-file.c (renamed from xlators/meta/src/plugins/type-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/version-file.c (renamed from xlators/meta/src/plugins/version-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/view-dir.c (renamed from xlators/meta/src/plugins/view-dir.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/volfile-file.c (renamed from xlators/meta/src/plugins/volfile-file.c) | 0 | ||||
-rw-r--r-- | xlators/meta/src/xlator-dir.c (renamed from xlators/meta/src/plugins/xlator-dir.c) | 28 |
32 files changed, 436 insertions, 22 deletions
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index f9e8a0c1ba4..134dbd4f8f5 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -965,3 +965,18 @@ gf_proc_dump_xlator_meminfo (xlator_t *this, strfd_t *strfd) } gf_proc_dump_unlock (); } + + +void +gf_proc_dump_xlator_profile (xlator_t *this, strfd_t *strfd) +{ + gf_proc_dump_lock (); + { + gf_dump_strfd = strfd; + + gf_proc_dump_latency_info (this); + + gf_dump_strfd = NULL; + } + gf_proc_dump_unlock (); +} diff --git a/libglusterfs/src/statedump.h b/libglusterfs/src/statedump.h index 3251387e220..39a68bd69da 100644 --- a/libglusterfs/src/statedump.h +++ b/libglusterfs/src/statedump.h @@ -101,4 +101,6 @@ void gf_proc_dump_xlator_history (xlator_t *this, strfd_t *strfd); void gf_proc_dump_xlator_meminfo (xlator_t *this, strfd_t *strfd); +void gf_proc_dump_xlator_profile (xlator_t *this, strfd_t *strfd); + #endif /* STATEDUMP_H */ diff --git a/xlators/meta/src/Makefile.am b/xlators/meta/src/Makefile.am index 530fea9792b..b705e86b60a 100644 --- a/xlators/meta/src/Makefile.am +++ b/xlators/meta/src/Makefile.am @@ -4,27 +4,33 @@ xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator meta_la_LDFLAGS = -module -avoid-version meta_la_SOURCES = meta.c meta-helpers.c meta-defaults.c \ - plugins/root-dir.c \ - plugins/graphs-dir.c \ - plugins/frames-file.c \ - plugins/graph-dir.c \ - plugins/active-link.c \ - plugins/xlator-dir.c \ - plugins/top-link.c \ - plugins/logging-dir.c \ - plugins/logfile-link.c \ - plugins/loglevel-file.c \ - plugins/process_uuid-file.c \ - plugins/volfile-file.c \ - plugins/view-dir.c \ - plugins/subvolumes-dir.c \ - plugins/subvolume-link.c \ - plugins/type-file.c \ - plugins/version-file.c \ - plugins/options-dir.c \ - plugins/option-file.c \ - plugins/cmdline-file.c \ - plugins/name-file.c + root-dir.c \ + graphs-dir.c \ + frames-file.c \ + graph-dir.c \ + active-link.c \ + xlator-dir.c \ + top-link.c \ + logging-dir.c \ + logfile-link.c \ + loglevel-file.c \ + process_uuid-file.c \ + volfile-file.c \ + view-dir.c \ + subvolumes-dir.c \ + subvolume-link.c \ + type-file.c \ + version-file.c \ + options-dir.c \ + option-file.c \ + cmdline-file.c \ + name-file.c \ + private-file.c \ + history-file.c \ + mallinfo-file.c \ + meminfo-file.c \ + measure-file.c \ + profile-file.c meta_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la diff --git a/xlators/meta/src/plugins/active-link.c b/xlators/meta/src/active-link.c index 99d38597bdf..99d38597bdf 100644 --- a/xlators/meta/src/plugins/active-link.c +++ b/xlators/meta/src/active-link.c diff --git a/xlators/meta/src/plugins/cmdline-file.c b/xlators/meta/src/cmdline-file.c index 1eded6d19b8..1eded6d19b8 100644 --- a/xlators/meta/src/plugins/cmdline-file.c +++ b/xlators/meta/src/cmdline-file.c diff --git a/xlators/meta/src/plugins/frames-file.c b/xlators/meta/src/frames-file.c index 0c3b9a2eb71..0c3b9a2eb71 100644 --- a/xlators/meta/src/plugins/frames-file.c +++ b/xlators/meta/src/frames-file.c diff --git a/xlators/meta/src/plugins/graph-dir.c b/xlators/meta/src/graph-dir.c index 3cd6b482e74..3cd6b482e74 100644 --- a/xlators/meta/src/plugins/graph-dir.c +++ b/xlators/meta/src/graph-dir.c diff --git a/xlators/meta/src/plugins/graphs-dir.c b/xlators/meta/src/graphs-dir.c index 4a538fb6176..4a538fb6176 100644 --- a/xlators/meta/src/plugins/graphs-dir.c +++ b/xlators/meta/src/graphs-dir.c diff --git a/xlators/meta/src/history-file.c b/xlators/meta/src/history-file.c new file mode 100644 index 00000000000..d88040fe58f --- /dev/null +++ b/xlators/meta/src/history-file.c @@ -0,0 +1,52 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "strfd.h" +#include "statedump.h" + + +static int +history_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + xlator_t *xl = NULL; + + xl = meta_ctx_get (file, this); + + gf_proc_dump_xlator_history (xl, strfd); + + return strfd->size; +} + + +static struct meta_ops history_file_ops = { + .file_fill = history_file_fill, +}; + + +int +meta_history_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &history_file_ops); + + meta_ctx_set (loc->inode, this, meta_ctx_get (loc->parent, this)); + + return 0; +} diff --git a/xlators/meta/src/plugins/logfile-link.c b/xlators/meta/src/logfile-link.c index 435cab80c33..435cab80c33 100644 --- a/xlators/meta/src/plugins/logfile-link.c +++ b/xlators/meta/src/logfile-link.c diff --git a/xlators/meta/src/plugins/logging-dir.c b/xlators/meta/src/logging-dir.c index 783d38e8e12..783d38e8e12 100644 --- a/xlators/meta/src/plugins/logging-dir.c +++ b/xlators/meta/src/logging-dir.c diff --git a/xlators/meta/src/plugins/loglevel-file.c b/xlators/meta/src/loglevel-file.c index 24ac68ddc69..24ac68ddc69 100644 --- a/xlators/meta/src/plugins/loglevel-file.c +++ b/xlators/meta/src/loglevel-file.c diff --git a/xlators/meta/src/mallinfo-file.c b/xlators/meta/src/mallinfo-file.c new file mode 100644 index 00000000000..38589f515ff --- /dev/null +++ b/xlators/meta/src/mallinfo-file.c @@ -0,0 +1,44 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "statedump.h" + + +static int +mallinfo_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + gf_proc_dump_mallinfo (strfd); + return strfd->size; +} + + +static struct meta_ops mallinfo_file_ops = { + .file_fill = mallinfo_file_fill, +}; + + +int +meta_mallinfo_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &mallinfo_file_ops); + + return 0; +} diff --git a/xlators/meta/src/measure-file.c b/xlators/meta/src/measure-file.c new file mode 100644 index 00000000000..ccc78232dfe --- /dev/null +++ b/xlators/meta/src/measure-file.c @@ -0,0 +1,92 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "strfd.h" + + +static int +measure_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + strprintf (strfd, "%d\n", this->ctx->measure_latency); + + return strfd->size; +} + + +static int +measure_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, + struct iovec *iov, int count, off_t offset, + uint32_t flags, struct iobref *iobref, dict_t *xdata) +{ + struct iatt dummy = { }; + long int num = -1; + + num = strtol (iov[0].iov_base, NULL, 0); + this->ctx->measure_latency = !!num; + + META_STACK_UNWIND (writev, frame, iov_length (iov, count), 0, + &dummy, &dummy, xdata); + return 0; +} + + +int +measure_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, + off_t offset, dict_t *xdata) +{ + struct iatt iatt = { }; + + meta_iatt_fill (&iatt, loc->inode, IA_IFREG); + + META_STACK_UNWIND (truncate, frame, 0, 0, &iatt, &iatt, xdata); + return 0; +} + + +int +measure_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, + off_t offset, dict_t *xdata) +{ + struct iatt iatt = { }; + + meta_iatt_fill (&iatt, fd->inode, IA_IFREG); + + META_STACK_UNWIND (ftruncate, frame, 0, 0, &iatt, &iatt, xdata); + return 0; +} + +static struct meta_ops measure_file_ops = { + .file_fill = measure_file_fill, + .fops = { + .truncate = measure_truncate, + .ftruncate = measure_ftruncate, + .writev = measure_writev + } +}; + + +int +meta_measure_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &measure_file_ops); + + return 0; +} diff --git a/xlators/meta/src/meminfo-file.c b/xlators/meta/src/meminfo-file.c new file mode 100644 index 00000000000..807446cfdc4 --- /dev/null +++ b/xlators/meta/src/meminfo-file.c @@ -0,0 +1,52 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "strfd.h" +#include "statedump.h" + + +static int +meminfo_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + xlator_t *xl = NULL; + + xl = meta_ctx_get (file, this); + + gf_proc_dump_xlator_meminfo (xl, strfd); + + return strfd->size; +} + + +static struct meta_ops meminfo_file_ops = { + .file_fill = meminfo_file_fill, +}; + + +int +meta_meminfo_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &meminfo_file_ops); + + meta_ctx_set (loc->inode, this, meta_ctx_get (loc->parent, this)); + + return 0; +} diff --git a/xlators/meta/src/meta-defaults.c b/xlators/meta/src/meta-defaults.c index f2b637fa28a..905b38554a0 100644 --- a/xlators/meta/src/meta-defaults.c +++ b/xlators/meta/src/meta-defaults.c @@ -138,7 +138,7 @@ meta_default_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, iov.iov_base = iobuf_ptr (iobuf); copy_offset = min (meta_fd->size, offset); - copy_size = min (size, meta_fd->size) - copy_offset; + copy_size = min (size, (meta_fd->size - copy_offset)); if (copy_size) memcpy (iov.iov_base, meta_fd->data + copy_offset, copy_size); diff --git a/xlators/meta/src/meta-hooks.h b/xlators/meta/src/meta-hooks.h index f8ce3b61e4c..bcf3643d223 100644 --- a/xlators/meta/src/meta-hooks.h +++ b/xlators/meta/src/meta-hooks.h @@ -35,5 +35,12 @@ DECLARE_HOOK(options_dir); DECLARE_HOOK(option_file); DECLARE_HOOK(cmdline_file); DECLARE_HOOK(name_file); +DECLARE_HOOK(private_file); +DECLARE_HOOK(mallinfo_file); +DECLARE_HOOK(history_file); +DECLARE_HOOK(master_dir); +DECLARE_HOOK(meminfo_file); +DECLARE_HOOK(measure_file); +DECLARE_HOOK(profile_file); #endif diff --git a/xlators/meta/src/plugins/name-file.c b/xlators/meta/src/name-file.c index 8ddd42945d7..8ddd42945d7 100644 --- a/xlators/meta/src/plugins/name-file.c +++ b/xlators/meta/src/name-file.c diff --git a/xlators/meta/src/plugins/option-file.c b/xlators/meta/src/option-file.c index 4f9067e1490..4f9067e1490 100644 --- a/xlators/meta/src/plugins/option-file.c +++ b/xlators/meta/src/option-file.c diff --git a/xlators/meta/src/plugins/options-dir.c b/xlators/meta/src/options-dir.c index 229d365a9c7..229d365a9c7 100644 --- a/xlators/meta/src/plugins/options-dir.c +++ b/xlators/meta/src/options-dir.c diff --git a/xlators/meta/src/private-file.c b/xlators/meta/src/private-file.c new file mode 100644 index 00000000000..d2402c08bb4 --- /dev/null +++ b/xlators/meta/src/private-file.c @@ -0,0 +1,52 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "strfd.h" +#include "statedump.h" + + +static int +private_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + xlator_t *xl = NULL; + + xl = meta_ctx_get (file, this); + + gf_proc_dump_xlator_private (xl, strfd); + + return strfd->size; +} + + +static struct meta_ops private_file_ops = { + .file_fill = private_file_fill, +}; + + +int +meta_private_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &private_file_ops); + + meta_ctx_set (loc->inode, this, meta_ctx_get (loc->parent, this)); + + return 0; +} diff --git a/xlators/meta/src/plugins/process_uuid-file.c b/xlators/meta/src/process_uuid-file.c index c16ceaac150..c16ceaac150 100644 --- a/xlators/meta/src/plugins/process_uuid-file.c +++ b/xlators/meta/src/process_uuid-file.c diff --git a/xlators/meta/src/profile-file.c b/xlators/meta/src/profile-file.c new file mode 100644 index 00000000000..2a25c154699 --- /dev/null +++ b/xlators/meta/src/profile-file.c @@ -0,0 +1,52 @@ +/* + Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include "xlator.h" +#include "defaults.h" + +#include "meta-mem-types.h" +#include "meta.h" +#include "strfd.h" +#include "statedump.h" + + +static int +profile_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd) +{ + xlator_t *xl = NULL; + + xl = meta_ctx_get (file, this); + + gf_proc_dump_xlator_profile (xl, strfd); + + return strfd->size; +} + + +static struct meta_ops profile_file_ops = { + .file_fill = profile_file_fill, +}; + + +int +meta_profile_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ops_set (loc->inode, this, &profile_file_ops); + + meta_ctx_set (loc->inode, this, meta_ctx_get (loc->parent, this)); + + return 0; +} diff --git a/xlators/meta/src/plugins/root-dir.c b/xlators/meta/src/root-dir.c index bd6870b21d7..d104d842cf9 100644 --- a/xlators/meta/src/plugins/root-dir.c +++ b/xlators/meta/src/root-dir.c @@ -48,6 +48,18 @@ static struct meta_dirent root_dir_dirents[] = { .type = IA_IFREG, .hook = meta_cmdline_file_hook, }, + { .name = "mallinfo", + .type = IA_IFREG, + .hook = meta_mallinfo_file_hook, + }, + { .name = "master", + .type = IA_IFDIR, + .hook = meta_master_dir_hook, + }, + { .name = "measure_latency", + .type = IA_IFREG, + .hook = meta_measure_file_hook, + }, { .name = NULL } }; diff --git a/xlators/meta/src/plugins/subvolume-link.c b/xlators/meta/src/subvolume-link.c index ca71a751541..ca71a751541 100644 --- a/xlators/meta/src/plugins/subvolume-link.c +++ b/xlators/meta/src/subvolume-link.c diff --git a/xlators/meta/src/plugins/subvolumes-dir.c b/xlators/meta/src/subvolumes-dir.c index f8d0e8039a1..f8d0e8039a1 100644 --- a/xlators/meta/src/plugins/subvolumes-dir.c +++ b/xlators/meta/src/subvolumes-dir.c diff --git a/xlators/meta/src/plugins/top-link.c b/xlators/meta/src/top-link.c index 94b7f7a9f56..94b7f7a9f56 100644 --- a/xlators/meta/src/plugins/top-link.c +++ b/xlators/meta/src/top-link.c diff --git a/xlators/meta/src/plugins/type-file.c b/xlators/meta/src/type-file.c index 1970f4e33e8..1970f4e33e8 100644 --- a/xlators/meta/src/plugins/type-file.c +++ b/xlators/meta/src/type-file.c diff --git a/xlators/meta/src/plugins/version-file.c b/xlators/meta/src/version-file.c index 77f2dea3d66..77f2dea3d66 100644 --- a/xlators/meta/src/plugins/version-file.c +++ b/xlators/meta/src/version-file.c diff --git a/xlators/meta/src/plugins/view-dir.c b/xlators/meta/src/view-dir.c index 6edd455b072..6edd455b072 100644 --- a/xlators/meta/src/plugins/view-dir.c +++ b/xlators/meta/src/view-dir.c diff --git a/xlators/meta/src/plugins/volfile-file.c b/xlators/meta/src/volfile-file.c index 899285763e0..899285763e0 100644 --- a/xlators/meta/src/plugins/volfile-file.c +++ b/xlators/meta/src/volfile-file.c diff --git a/xlators/meta/src/plugins/xlator-dir.c b/xlators/meta/src/xlator-dir.c index 279df385cef..09b7bde62de 100644 --- a/xlators/meta/src/plugins/xlator-dir.c +++ b/xlators/meta/src/xlator-dir.c @@ -44,6 +44,22 @@ static struct meta_dirent xlator_dir_dirents[] = { .type = IA_IFDIR, .hook = meta_options_dir_hook, }, + { .name = "private", + .type = IA_IFREG, + .hook = meta_private_file_hook, + }, + { .name = "history", + .type = IA_IFREG, + .hook = meta_history_file_hook, + }, + { .name = "meminfo", + .type = IA_IFREG, + .hook = meta_meminfo_file_hook, + }, + { .name = "profile", + .type = IA_IFREG, + .hook = meta_profile_file_hook, + }, { .name = NULL } }; @@ -70,3 +86,15 @@ meta_xlator_dir_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; } + + +int +meta_master_dir_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) +{ + meta_ctx_set (loc->inode, this, this->ctx->master); + + meta_ops_set (loc->inode, this, &xlator_dir_ops); + + return 0; +} |