]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/nfsd/export.c
nfsd: implement pNFS operations
[mirror_ubuntu-zesty-kernel.git] / fs / nfsd / export.c
index 30a739d896ffcad615bdf3abf6ee54803e276a81..c3e3b6e55ae28d01ee4922b98b021dfd45151e02 100644 (file)
@@ -20,6 +20,7 @@
 #include "nfsd.h"
 #include "nfsfh.h"
 #include "netns.h"
+#include "pnfs.h"
 
 #define NFSDDBG_FACILITY       NFSDDBG_EXPORT
 
@@ -545,6 +546,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
 
        exp.ex_client = dom;
        exp.cd = cd;
+       exp.ex_devid_map = NULL;
 
        /* expiry */
        err = -EINVAL;
@@ -621,6 +623,8 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
                if (!gid_valid(exp.ex_anon_gid))
                        goto out4;
                err = 0;
+
+               nfsd4_setup_layout_type(&exp);
        }
 
        expp = svc_export_lookup(&exp);
@@ -703,6 +707,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
        new->ex_fslocs.locations = NULL;
        new->ex_fslocs.locations_count = 0;
        new->ex_fslocs.migrated = 0;
+       new->ex_layout_type = 0;
        new->ex_uuid = NULL;
        new->cd = item->cd;
 }
@@ -717,6 +722,8 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem)
        new->ex_anon_uid = item->ex_anon_uid;
        new->ex_anon_gid = item->ex_anon_gid;
        new->ex_fsid = item->ex_fsid;
+       new->ex_devid_map = item->ex_devid_map;
+       item->ex_devid_map = NULL;
        new->ex_uuid = item->ex_uuid;
        item->ex_uuid = NULL;
        new->ex_fslocs.locations = item->ex_fslocs.locations;
@@ -725,6 +732,7 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem)
        item->ex_fslocs.locations_count = 0;
        new->ex_fslocs.migrated = item->ex_fslocs.migrated;
        item->ex_fslocs.migrated = 0;
+       new->ex_layout_type = item->ex_layout_type;
        new->ex_nflavors = item->ex_nflavors;
        for (i = 0; i < MAX_SECINFO_LIST; i++) {
                new->ex_flavors[i] = item->ex_flavors[i];