nfs_subs.c (47028) | nfs_subs.c (47751) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 |
37 * $Id: nfs_subs.c,v 1.73 1999/02/17 13:59:29 bde Exp $ | 37 * $Id: nfs_subs.c,v 1.74 1999/05/11 19:54:46 phk Exp $ |
38 */ 39 40/* 41 * These functions support the macros and help fiddle mbuf chains for 42 * the nfs op functions. They do things like create the rpc header and 43 * copy data between mbuf chains and uio lists. 44 */ 45#include <sys/param.h> --- 1294 unchanged lines hidden (view full) --- 1340 vap->va_mode = (vmode & 07777); 1341 vap->va_rdev = rdev; 1342 vap->va_mtime = mtime; 1343 vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; 1344 if (v3) { 1345 vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink); 1346 vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid); 1347 vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid); | 38 */ 39 40/* 41 * These functions support the macros and help fiddle mbuf chains for 42 * the nfs op functions. They do things like create the rpc header and 43 * copy data between mbuf chains and uio lists. 44 */ 45#include <sys/param.h> --- 1294 unchanged lines hidden (view full) --- 1340 vap->va_mode = (vmode & 07777); 1341 vap->va_rdev = rdev; 1342 vap->va_mtime = mtime; 1343 vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; 1344 if (v3) { 1345 vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink); 1346 vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid); 1347 vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid); |
1348 fxdr_hyper(&fp->fa3_size, &vap->va_size); | 1348 vap->va_size = fxdr_hyper(&fp->fa3_size); |
1349 vap->va_blocksize = NFS_FABLKSIZE; | 1349 vap->va_blocksize = NFS_FABLKSIZE; |
1350 fxdr_hyper(&fp->fa3_used, &vap->va_bytes); | 1350 vap->va_bytes = fxdr_hyper(&fp->fa3_used); |
1351 vap->va_fileid = fxdr_unsigned(int32_t, 1352 fp->fa3_fileid.nfsuquad[1]); 1353 fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime); 1354 fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime); 1355 vap->va_flags = 0; 1356 vap->va_filerev = 0; 1357 } else { 1358 vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink); 1359 vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid); 1360 vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid); 1361 vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size); 1362 vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize); | 1351 vap->va_fileid = fxdr_unsigned(int32_t, 1352 fp->fa3_fileid.nfsuquad[1]); 1353 fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime); 1354 fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime); 1355 vap->va_flags = 0; 1356 vap->va_filerev = 0; 1357 } else { 1358 vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink); 1359 vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid); 1360 vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid); 1361 vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size); 1362 vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize); |
1363 vap->va_bytes = fxdr_unsigned(int32_t, fp->fa2_blocks) | 1363 vap->va_bytes = (u_quad_t)fxdr_unsigned(int32_t, fp->fa2_blocks) |
1364 * NFS_FABLKSIZE; 1365 vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid); 1366 fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime); 1367 vap->va_flags = 0; 1368 vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t, 1369 fp->fa2_ctime.nfsv2_sec); 1370 vap->va_ctime.tv_nsec = 0; 1371 vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec); --- 433 unchanged lines hidden (view full) --- 1805 register u_int32_t *tl; 1806 1807 if (before_ret) { 1808 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); 1809 *tl = nfs_false; 1810 } else { 1811 nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED); 1812 *tl++ = nfs_true; | 1364 * NFS_FABLKSIZE; 1365 vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid); 1366 fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime); 1367 vap->va_flags = 0; 1368 vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t, 1369 fp->fa2_ctime.nfsv2_sec); 1370 vap->va_ctime.tv_nsec = 0; 1371 vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec); --- 433 unchanged lines hidden (view full) --- 1805 register u_int32_t *tl; 1806 1807 if (before_ret) { 1808 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); 1809 *tl = nfs_false; 1810 } else { 1811 nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED); 1812 *tl++ = nfs_true; |
1813 txdr_hyper(&(before_vap->va_size), tl); | 1813 txdr_hyper(before_vap->va_size, tl); |
1814 tl += 2; 1815 txdr_nfsv3time(&(before_vap->va_mtime), tl); 1816 tl += 2; 1817 txdr_nfsv3time(&(before_vap->va_ctime), tl); 1818 } 1819 *bposp = bpos; 1820 *mbp = mb; 1821 nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp); --- 33 unchanged lines hidden (view full) --- 1855{ 1856 1857 fp->fa_nlink = txdr_unsigned(vap->va_nlink); 1858 fp->fa_uid = txdr_unsigned(vap->va_uid); 1859 fp->fa_gid = txdr_unsigned(vap->va_gid); 1860 if (nfsd->nd_flag & ND_NFSV3) { 1861 fp->fa_type = vtonfsv3_type(vap->va_type); 1862 fp->fa_mode = vtonfsv3_mode(vap->va_mode); | 1814 tl += 2; 1815 txdr_nfsv3time(&(before_vap->va_mtime), tl); 1816 tl += 2; 1817 txdr_nfsv3time(&(before_vap->va_ctime), tl); 1818 } 1819 *bposp = bpos; 1820 *mbp = mb; 1821 nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp); --- 33 unchanged lines hidden (view full) --- 1855{ 1856 1857 fp->fa_nlink = txdr_unsigned(vap->va_nlink); 1858 fp->fa_uid = txdr_unsigned(vap->va_uid); 1859 fp->fa_gid = txdr_unsigned(vap->va_gid); 1860 if (nfsd->nd_flag & ND_NFSV3) { 1861 fp->fa_type = vtonfsv3_type(vap->va_type); 1862 fp->fa_mode = vtonfsv3_mode(vap->va_mode); |
1863 txdr_hyper(&vap->va_size, &fp->fa3_size); 1864 txdr_hyper(&vap->va_bytes, &fp->fa3_used); | 1863 txdr_hyper(vap->va_size, &fp->fa3_size); 1864 txdr_hyper(vap->va_bytes, &fp->fa3_used); |
1865 fp->fa3_rdev.specdata1 = txdr_unsigned(umajor(vap->va_rdev)); 1866 fp->fa3_rdev.specdata2 = txdr_unsigned(uminor(vap->va_rdev)); 1867 fp->fa3_fsid.nfsuquad[0] = 0; 1868 fp->fa3_fsid.nfsuquad[1] = txdr_unsigned(vap->va_fsid); 1869 fp->fa3_fileid.nfsuquad[0] = 0; 1870 fp->fa3_fileid.nfsuquad[1] = txdr_unsigned(vap->va_fileid); 1871 txdr_nfsv3time(&vap->va_atime, &fp->fa3_atime); 1872 txdr_nfsv3time(&vap->va_mtime, &fp->fa3_mtime); --- 355 unchanged lines hidden --- | 1865 fp->fa3_rdev.specdata1 = txdr_unsigned(umajor(vap->va_rdev)); 1866 fp->fa3_rdev.specdata2 = txdr_unsigned(uminor(vap->va_rdev)); 1867 fp->fa3_fsid.nfsuquad[0] = 0; 1868 fp->fa3_fsid.nfsuquad[1] = txdr_unsigned(vap->va_fsid); 1869 fp->fa3_fileid.nfsuquad[0] = 0; 1870 fp->fa3_fileid.nfsuquad[1] = txdr_unsigned(vap->va_fileid); 1871 txdr_nfsv3time(&vap->va_atime, &fp->fa3_atime); 1872 txdr_nfsv3time(&vap->va_mtime, &fp->fa3_mtime); --- 355 unchanged lines hidden --- |