[pnfs] [PATCH 1/1] nfs-utils: add pnfs export option

Andy Adamson andros at netapp.com
Tue Sep 29 15:47:08 EDT 2009


Thanks

I'll send a new kernel patch set addressing your comments.

Thanks for the review.

-->Andy

On Sep 29, 2009, at 3:45 PM, Benny Halevy wrote:

> On Sep. 29, 2009, 18:56 +0200, andros at netapp.com wrote:
>> From: andros <andros at fc8-32vm.(none)>
>>
>> Add a pnfs boolean export option to turn on/off pnfs for pnfs  
>> capable file
>> systems.
>
> Merged into
> git://linux-nfs.org/~bhalevy/pnfs-nfs-utils master
>
> Benny
>
>>
>> Signed-off-by: Andy Adamson <andros at netapp.com>
>> ---
>> support/include/nfslib.h  |    1 +
>> support/nfs/exports.c     |    6 ++++++
>> utils/exportfs/exportfs.c |    2 ++
>> utils/mountd/cache.c      |    2 ++
>> 4 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/support/include/nfslib.h b/support/include/nfslib.h
>> index 422b012..76b8ffb 100644
>> --- a/support/include/nfslib.h
>> +++ b/support/include/nfslib.h
>> @@ -85,6 +85,7 @@ struct exportent {
>> 	char *          e_fslocdata;
>> 	char *		e_uuid;
>> 	struct sec_entry e_secinfo[SECFLAVOR_COUNT+1];
>> +	int		e_pnfs;
>> };
>>
>> struct rmtabent {
>> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
>> index 525e5b1..d668143 100644
>> --- a/support/nfs/exports.c
>> +++ b/support/nfs/exports.c
>> @@ -122,6 +122,7 @@ getexportent(int fromkernel, int fromexports)
>> 		def_ee.e_secinfo[0].flav = NULL;
>> 		def_ee.e_nsquids = 0;
>> 		def_ee.e_nsqgids = 0;
>> +		def_ee.e_pnfs = 0;
>>
>> 		ok = getpath(def_ee.e_path, sizeof(def_ee.e_path));
>> 		if (ok <= 0)
>> @@ -297,6 +298,8 @@ putexportent(struct exportent *ep)
>> 	}
>> 	fprintf(fp, "anonuid=%d,anongid=%d", ep->e_anonuid, ep->e_anongid);
>> 	secinfo_show(fp, ep);
>> +	if (ep->e_pnfs)
>> +		fprintf(fp, ",pnfs");
>> 	fprintf(fp, ")\n");
>> }
>>
>> @@ -347,6 +350,7 @@ mkexportent(char *hname, char *path, char  
>> *options)
>> 	ee.e_fslocmethod = FSLOC_NONE;
>> 	ee.e_fslocdata = NULL;
>> 	ee.e_secinfo[0].flav = NULL;
>> +	ee.e_pnfs = 0;
>> 	ee.e_nsquids = 0;
>> 	ee.e_nsqgids = 0;
>> 	ee.e_uuid = NULL;
>> @@ -558,6 +562,8 @@ parseopts(char *cp, struct exportent *ep, int  
>> warn, int *had_subtree_opt_ptr)
>> 			ep->e_flags &= ~NFSEXP_NOACL;
>> 		else if (strcmp(opt, "no_acl") == 0)
>> 			ep->e_flags |= NFSEXP_NOACL;
>> +		else if (strcmp(opt, "pnfs") == 0)
>> +			ep->e_pnfs = 1;
>> 		else if (strncmp(opt, "anonuid=", 8) == 0) {
>> 			char *oe;
>> 			ep->e_anonuid = strtol(opt+8, &oe, 10);
>> diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
>> index 18dfe5a..b787be7 100644
>> --- a/utils/exportfs/exportfs.c
>> +++ b/utils/exportfs/exportfs.c
>> @@ -516,6 +516,8 @@ dump(int verbose)
>> #endif
>> 			}
>> 			secinfo_show(stdout, ep);
>> +			if (ep->e_pnfs)
>> +				c = dumpopt(c, ",pnfs");
>> 			printf("%c\n", (c != '(')? ')' : ' ');
>> 		}
>> 	}
>> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
>> index f555dcc..42e44f5 100644
>> --- a/utils/mountd/cache.c
>> +++ b/utils/mountd/cache.c
>> @@ -580,6 +580,8 @@ static int dump_to_cache(FILE *f, char *domain,  
>> char *path, struct exportent *ex
>> 		qword_printint(f, exp->e_anonuid);
>> 		qword_printint(f, exp->e_anongid);
>> 		qword_printint(f, exp->e_fsid);
>> +		if (exp->e_pnfs == 1)
>> +			qword_print(f, "pnfs");
>> 		write_fsloc(f, exp, path);
>> 		write_secinfo(f, exp);
>> #if USE_BLKID



More information about the pNFS mailing list