diff options
Diffstat (limited to 'xlators/nfs/server/src/nfs-common.c')
-rw-r--r-- | xlators/nfs/server/src/nfs-common.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index 970eb41c571..369bb181663 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -33,6 +33,7 @@ #include "nfs-mem-types.h" #include "rpcsvc.h" #include "iatt.h" +#include "nfs.h" #include <libgen.h> @@ -395,4 +396,42 @@ err: } +int +__is_nfs_subvolume_disabled (struct nfs_state *nfs, xlator_t *xl) +{ + int x = 0; + int notstarted = 0; + + if ((!nfs) || (!xl)) + return 1; + + for (;x < nfs->allsubvols; ++x) { + if (!((&nfs->subvols[x])->subvol == xl)) + continue; + + if (gf_nfs_subvolume_notstarted (&nfs->subvols[x])) { + notstarted = 1; + goto out; + } + } +out: + return notstarted; +} + +int +is_nfs_subvolume_disabled (struct nfs_state *nfs, xlator_t *xl) +{ + int notstarted = 0; + + if ((!nfs) || (!xl)) + return 1; + + LOCK (&nfs->svinitlock); + { + notstarted = __is_nfs_subvolume_disabled (nfs, xl); + } + UNLOCK (&nfs->svinitlock); + + return notstarted; +} |