Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Nov 2009 14:20:18 -0800
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r199274 - head/sys/nfsserver
Message-ID:  <9B515A18-6E30-4FF2-B739-E36BF3E0B84C@mac.com>
In-Reply-To: <20091114.144644.580455928.imp@bsdimp.com>
References:  <200911141814.nAEIE7ku008530@svn.freebsd.org> <20091114.144644.580455928.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Nov 14, 2009, at 1:46 PM, M. Warner Losh wrote:

> : @@ -206,7 +207,11 @@ fha_extract_info(struct svc_req *req, st
> :  	if (error)
> :  		goto out;
> :  
> : -	i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data);
> : +#if _BYTE_ORDER == _LITTLE_ENDIAN
> : +	i->fh = le64dec(fh.fh_generic.fh_fid.fid_data);
> : +#else
> : +	i->fh = be64dec(fh.fh_generic.fh_fid.fid_data);
> : +#endif
> :  
> :  	/* Content ourselves with zero offset for all but reads. */
> :  	if (procnum != NFSPROC_READ)
> 
> Wouldn't memcpy do the same thing without the need for an ifdef?
> 
> 	memcpy(&i->fh, fh.fh_generic.fh_fid.fid_data, sizeof(uint64_t));

Yes, it would. Shall I change it to use memcpy?

-- 
Marcel Moolenaar
xcllnt@mac.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9B515A18-6E30-4FF2-B739-E36BF3E0B84C>