Date: Sun, 6 Aug 2017 22:09:30 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r322125 - in projects/pnfs-planb-server-stable11/sys/fs: nfs nfsserver Message-ID: <201708062209.v76M9U0D034411@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Aug 6 22:09:30 2017 New Revision: 322125 URL: https://svnweb.freebsd.org/changeset/base/322125 Log: Add some code for Flex Files layout. No semantic change. Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsproto.h projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsproto.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsproto.h Sun Aug 6 21:54:43 2017 (r322124) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsproto.h Sun Aug 6 22:09:30 2017 (r322125) @@ -261,7 +261,9 @@ #define NFSX_V4PNFSFH (sizeof(fhandle_t) + 1) #define NFSX_V4FILELAYOUT (4 * NFSX_UNSIGNED + NFSX_V4DEVICEID + \ NFSX_HYPER + NFSM_RNDUP(NFSX_V4PNFSFH)) -#define NFSX_V4MAXLAYOUT NFSX_V4FILELAYOUT +#define NFSX_V4FLEXLAYOUT(m) (NFSX_HYPER + 3 * NFSX_UNSIGNED + \ + ((m) * (NFSX_V4DEVICEID + NFSX_STATEID + NFSM_RNDUP(NFSX_V4PNFSFH) + \ + 6 * NFSX_UNSIGNED))) /* sizes common to multiple NFS versions */ #define NFSX_FHMAX (NFSX_V4FHMAX) @@ -641,6 +643,7 @@ #define NFSLAYOUT_NFSV4_1_FILES 0x1 #define NFSLAYOUT_OSD2_OBJECTS 0x2 #define NFSLAYOUT_BLOCK_VOLUME 0x3 +#define NFSLAYOUT_FLEXFILE 0x4 #define NFSLAYOUTIOMODE_READ 1 #define NFSLAYOUTIOMODE_RW 2 Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c Sun Aug 6 21:54:43 2017 (r322124) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c Sun Aug 6 22:09:30 2017 (r322125) @@ -60,6 +60,7 @@ extern struct nfsdevicehead nfsrv_devidhead; extern int nfsd_debuglevel; extern u_long sb_max_adj; extern int nfsrv_pnfsatime; +extern int nfsrv_maxpnfsmirror; #endif /* !APPLEKEXT */ static int nfs_async = 0; @@ -4325,7 +4326,7 @@ nfsrvd_layoutget(struct nfsrv_descript *nd, __unused i nfsv4stateid_t stateid; int error = 0, layoutlen, layouttype, iomode, maxcnt, retonclose; uint64_t offset, len, minlen; - char *layp = NULL; + char *layp; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4368,13 +4369,18 @@ nfsrvd_layoutget(struct nfsrv_descript *nd, __unused i } } + layp = NULL; if (layouttype == NFSLAYOUT_NFSV4_1_FILES) layp = malloc(NFSX_V4FILELAYOUT, M_TEMP, M_WAITOK); + else if (layouttype == NFSLAYOUT_FLEXFILE) + layp = malloc(NFSX_V4FLEXLAYOUT(nfsrv_maxpnfsmirror), M_TEMP, + M_WAITOK); else - layp = malloc(NFSX_V4MAXLAYOUT, M_TEMP, M_WAITOK); - nd->nd_repstat = nfsrv_layoutget(nd, vp, exp, layouttype, &iomode, - &offset, &len, minlen, &stateid, maxcnt, &retonclose, &layoutlen, - layp, nd->nd_cred, p); + nd->nd_repstat = NFSERR_UNKNLAYOUTTYPE; + if (layp != NULL) + nd->nd_repstat = nfsrv_layoutget(nd, vp, exp, layouttype, + &iomode, &offset, &len, minlen, &stateid, maxcnt, + &retonclose, &layoutlen, layp, nd->nd_cred, p); NFSD_DEBUG(4, "nfsrv_layoutget stat=%u layoutlen=%d\n", nd->nd_repstat, layoutlen); if (nd->nd_repstat == 0) { Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 6 21:54:43 2017 (r322124) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 6 22:09:30 2017 (r322125) @@ -36,6 +36,7 @@ int nfsrv_issuedelegs = 0; int nfsrv_dolocallocks = 0; struct nfsv4lock nfsv4rootfs_lock; time_t nfsdev_time = 0; +int nfsrv_maxpnfsmirror = 1; extern int newnfs_numnfsd; extern struct nfsstatsv1 nfsstatsv1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708062209.v76M9U0D034411>