summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-01-01 13:15:45 +0100
committerVijay Bellur <vbellur@redhat.com>2015-03-18 22:16:34 -0700
commita1755ee2765f3d1c9c26d51a49ad63d133932710 (patch)
tree71982c048f2c6deb8d05e894f14d568a1da978a4 /xlators/nfs
parent5394f3cf60b0815d2919d24e9945ba47e3bb1f9b (diff)
glusterfsd: add "print-netgroups" and "print-exports" command
NFS now has the ability to use a separate file for "netgroups" and "exports". An administrator should have the ability to check the validity of the files before applying the configuration. The "glusterfsd" command now has the following additional arguments that can be used to check the configuration: --print-netgroups: Validate the netgroups file and print it out --print-exports: Validate the exports file and print it out BUG: 1143880 Change-Id: I24c40d50110d49d8290f9fd916742f7e4d0df85f URL: http://www.gluster.org/community/documentation/index.php/Features/Exports_Netgroups_Authentication Original-author: Shreyas Siravara <shreyas.siravara@gmail.com> CC: Richard Wareing <rwareing@fb.com> CC: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9365 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/exports.c14
-rw-r--r--xlators/nfs/server/src/netgroups.c6
-rw-r--r--xlators/nfs/server/src/nfs-mem-types.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/xlators/nfs/server/src/exports.c b/xlators/nfs/server/src/exports.c
index 793e020dd1f..af0cc7c24f2 100644
--- a/xlators/nfs/server/src/exports.c
+++ b/xlators/nfs/server/src/exports.c
@@ -77,7 +77,7 @@ _exports_file_init ()
{
struct exports_file *file = NULL;
- file = GF_CALLOC (1, sizeof (*file), gf_nfs_mt_exports);
+ file = GF_CALLOC (1, sizeof (*file), gf_common_mt_nfs_exports);
if (!file) {
gf_log (GF_EXP, GF_LOG_CRITICAL,
"Failed to allocate file struct!");
@@ -123,8 +123,10 @@ _exp_file_dict_destroy (dict_t *dict, char *key, data_t *val, void *tmp)
if (val) {
dir = (struct export_dir *)val->data;
- _export_dir_deinit (dir);
- val->data = NULL;
+ if (dir) {
+ _export_dir_deinit (dir);
+ val->data = NULL;
+ }
dict_del (dict, key);
}
@@ -175,7 +177,7 @@ static struct export_dir *
_export_dir_init ()
{
struct export_dir *expdir = GF_CALLOC (1, sizeof (*expdir),
- gf_nfs_mt_exports);
+ gf_common_mt_nfs_exports);
if (!expdir)
gf_log (GF_EXP, GF_LOG_CRITICAL,
@@ -234,7 +236,7 @@ static struct export_item *
_export_item_init ()
{
struct export_item *item = GF_CALLOC (1, sizeof (*item),
- gf_nfs_mt_exports);
+ gf_common_mt_nfs_exports);
if (!item)
gf_log (GF_EXP, GF_LOG_CRITICAL,
@@ -273,7 +275,7 @@ static struct export_options *
_export_options_init ()
{
struct export_options *opts = GF_CALLOC (1, sizeof (*opts),
- gf_nfs_mt_exports);
+ gf_common_mt_nfs_exports);
if (!opts)
gf_log (GF_EXP, GF_LOG_CRITICAL,
diff --git a/xlators/nfs/server/src/netgroups.c b/xlators/nfs/server/src/netgroups.c
index f5c966948f7..a505586961c 100644
--- a/xlators/nfs/server/src/netgroups.c
+++ b/xlators/nfs/server/src/netgroups.c
@@ -73,7 +73,7 @@ static struct netgroups_file *
_netgroups_file_init ()
{
struct netgroups_file *file = GF_MALLOC (sizeof (*file),
- gf_nfs_mt_netgroups);
+ gf_common_mt_nfs_netgroups);
if (!file)
goto out;
@@ -179,7 +179,7 @@ static struct netgroup_entry *
_netgroup_entry_init ()
{
struct netgroup_entry *entry = GF_CALLOC (1, sizeof (*entry),
- gf_nfs_mt_netgroups);
+ gf_common_mt_nfs_netgroups);
return entry;
}
@@ -324,7 +324,7 @@ static struct netgroup_host *
_netgroup_host_init ()
{
struct netgroup_host *host = GF_CALLOC (1, sizeof (*host),
- gf_nfs_mt_netgroups);
+ gf_common_mt_nfs_netgroups);
return host;
}
diff --git a/xlators/nfs/server/src/nfs-mem-types.h b/xlators/nfs/server/src/nfs-mem-types.h
index 6d4a2ed9cc2..88c688f74f3 100644
--- a/xlators/nfs/server/src/nfs-mem-types.h
+++ b/xlators/nfs/server/src/nfs-mem-types.h
@@ -47,8 +47,6 @@ enum gf_nfs_mem_types_ {
gf_nfs_mt_aux_gids,
gf_nfs_mt_inode_ctx,
gf_nfs_mt_auth_spec,
- gf_nfs_mt_netgroups,
- gf_nfs_mt_exports,
gf_nfs_mt_arr,
gf_nfs_mt_auth_cache,
gf_nfs_mt_auth_cache_entry,