ffs_vnops.c (171437) | ffs_vnops.c (173464) |
---|---|
1/*- 2 * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Marshall 6 * Kirk McKusick and Network Associates Laboratories, the Security 7 * Research Division of Network Associates, Inc. under DARPA/SPAWAR 8 * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS --- 48 unchanged lines hidden (view full) --- 57 * SUCH DAMAGE. 58 * 59 * from: @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 60 * from: $FreeBSD: .../ufs/ufs_readwrite.c,v 1.96 2002/08/12 09:22:11 phk ... 61 * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 62 */ 63 64#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Marshall 6 * Kirk McKusick and Network Associates Laboratories, the Security 7 * Research Division of Network Associates, Inc. under DARPA/SPAWAR 8 * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS --- 48 unchanged lines hidden (view full) --- 57 * SUCH DAMAGE. 58 * 59 * from: @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 60 * from: $FreeBSD: .../ufs/ufs_readwrite.c,v 1.96 2002/08/12 09:22:11 phk ... 61 * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 62 */ 63 64#include <sys/cdefs.h> |
65__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_vnops.c 171437 2007-07-13 18:51:08Z rodrigc $"); | 65__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_vnops.c 173464 2007-11-08 17:21:51Z obrien $"); |
66 67#include <sys/param.h> 68#include <sys/bio.h> 69#include <sys/systm.h> 70#include <sys/buf.h> 71#include <sys/conf.h> 72#include <sys/extattr.h> 73#include <sys/kernel.h> --- 246 unchanged lines hidden (view full) --- 320 * get them clean. Thus we give block devices a 321 * good effort, then just give up. For all other file 322 * types, go around and try again until it is clean. 323 */ 324 if (passes > 0) { 325 passes -= 1; 326 goto loop; 327 } | 66 67#include <sys/param.h> 68#include <sys/bio.h> 69#include <sys/systm.h> 70#include <sys/buf.h> 71#include <sys/conf.h> 72#include <sys/extattr.h> 73#include <sys/kernel.h> --- 246 unchanged lines hidden (view full) --- 320 * get them clean. Thus we give block devices a 321 * good effort, then just give up. For all other file 322 * types, go around and try again until it is clean. 323 */ 324 if (passes > 0) { 325 passes -= 1; 326 goto loop; 327 } |
328#ifdef DIAGNOSTIC | 328#ifdef INVARIANTS |
329 if (!vn_isdisk(vp, NULL)) 330 vprint("ffs_fsync: dirty", vp); 331#endif 332 } 333 } 334 VI_UNLOCK(vp); 335 splx(s); 336 return (ffs_update(vp, wait)); --- 101 unchanged lines hidden (view full) --- 438 if (error != 0 || workdone != 0) 439 return error; 440 } 441#endif 442 443 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 444 ip = VTOI(vp); 445 | 329 if (!vn_isdisk(vp, NULL)) 330 vprint("ffs_fsync: dirty", vp); 331#endif 332 } 333 } 334 VI_UNLOCK(vp); 335 splx(s); 336 return (ffs_update(vp, wait)); --- 101 unchanged lines hidden (view full) --- 438 if (error != 0 || workdone != 0) 439 return error; 440 } 441#endif 442 443 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 444 ip = VTOI(vp); 445 |
446#ifdef DIAGNOSTIC | 446#ifdef INVARIANTS |
447 if (uio->uio_rw != UIO_READ) 448 panic("ffs_read: mode"); 449 450 if (vp->v_type == VLNK) { 451 if ((int)ip->i_size < vp->v_mount->mnt_maxsymlinklen) 452 panic("ffs_read: short symlink"); 453 } else if (vp->v_type != VREG && vp->v_type != VDIR) 454 panic("ffs_read: type %d", vp->v_type); --- 185 unchanged lines hidden (view full) --- 640 return (ffs_extwrite(vp, uio, ioflag, ap->a_cred)); 641#else 642 panic("ffs_write+IO_EXT"); 643#endif 644 645 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 646 ip = VTOI(vp); 647 | 447 if (uio->uio_rw != UIO_READ) 448 panic("ffs_read: mode"); 449 450 if (vp->v_type == VLNK) { 451 if ((int)ip->i_size < vp->v_mount->mnt_maxsymlinklen) 452 panic("ffs_read: short symlink"); 453 } else if (vp->v_type != VREG && vp->v_type != VDIR) 454 panic("ffs_read: type %d", vp->v_type); --- 185 unchanged lines hidden (view full) --- 640 return (ffs_extwrite(vp, uio, ioflag, ap->a_cred)); 641#else 642 panic("ffs_write+IO_EXT"); 643#endif 644 645 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 646 ip = VTOI(vp); 647 |
648#ifdef DIAGNOSTIC | 648#ifdef INVARIANTS |
649 if (uio->uio_rw != UIO_WRITE) 650 panic("ffs_write: mode"); 651#endif 652 653 switch (vp->v_type) { 654 case VREG: 655 if (ioflag & IO_APPEND) 656 uio->uio_offset = ip->i_size; --- 207 unchanged lines hidden (view full) --- 864 off_t bytesinfile; 865 long size, xfersize, blkoffset; 866 int error, orig_resid; 867 868 ip = VTOI(vp); 869 fs = ip->i_fs; 870 dp = ip->i_din2; 871 | 649 if (uio->uio_rw != UIO_WRITE) 650 panic("ffs_write: mode"); 651#endif 652 653 switch (vp->v_type) { 654 case VREG: 655 if (ioflag & IO_APPEND) 656 uio->uio_offset = ip->i_size; --- 207 unchanged lines hidden (view full) --- 864 off_t bytesinfile; 865 long size, xfersize, blkoffset; 866 int error, orig_resid; 867 868 ip = VTOI(vp); 869 fs = ip->i_fs; 870 dp = ip->i_din2; 871 |
872#ifdef DIAGNOSTIC | 872#ifdef INVARIANTS |
873 if (uio->uio_rw != UIO_READ || fs->fs_magic != FS_UFS2_MAGIC) 874 panic("ffs_extread: mode"); 875 876#endif 877 orig_resid = uio->uio_resid; 878 KASSERT(orig_resid >= 0, ("ffs_extread: uio->uio_resid < 0")); 879 if (orig_resid == 0) 880 return (0); --- 145 unchanged lines hidden (view full) --- 1026 1027 ip = VTOI(vp); 1028 fs = ip->i_fs; 1029 dp = ip->i_din2; 1030 1031 KASSERT(!(ip->i_flag & IN_SPACECOUNTED), ("inode %u: inode is dead", 1032 ip->i_number)); 1033 | 873 if (uio->uio_rw != UIO_READ || fs->fs_magic != FS_UFS2_MAGIC) 874 panic("ffs_extread: mode"); 875 876#endif 877 orig_resid = uio->uio_resid; 878 KASSERT(orig_resid >= 0, ("ffs_extread: uio->uio_resid < 0")); 879 if (orig_resid == 0) 880 return (0); --- 145 unchanged lines hidden (view full) --- 1026 1027 ip = VTOI(vp); 1028 fs = ip->i_fs; 1029 dp = ip->i_din2; 1030 1031 KASSERT(!(ip->i_flag & IN_SPACECOUNTED), ("inode %u: inode is dead", 1032 ip->i_number)); 1033 |
1034#ifdef DIAGNOSTIC | 1034#ifdef INVARIANTS |
1035 if (uio->uio_rw != UIO_WRITE || fs->fs_magic != FS_UFS2_MAGIC) 1036 panic("ffs_extwrite: mode"); 1037#endif 1038 1039 if (ioflag & IO_APPEND) 1040 uio->uio_offset = dp->di_extsize; 1041 KASSERT(uio->uio_offset >= 0, ("ffs_extwrite: uio->uio_offset < 0")); 1042 KASSERT(uio->uio_resid >= 0, ("ffs_extwrite: uio->uio_resid < 0")); --- 696 unchanged lines hidden --- | 1035 if (uio->uio_rw != UIO_WRITE || fs->fs_magic != FS_UFS2_MAGIC) 1036 panic("ffs_extwrite: mode"); 1037#endif 1038 1039 if (ioflag & IO_APPEND) 1040 uio->uio_offset = dp->di_extsize; 1041 KASSERT(uio->uio_offset >= 0, ("ffs_extwrite: uio->uio_offset < 0")); 1042 KASSERT(uio->uio_resid >= 0, ("ffs_extwrite: uio->uio_resid < 0")); --- 696 unchanged lines hidden --- |