ffs_alloc.c (30402) | ffs_alloc.c (30418) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 |
34 * $Id: ffs_alloc.c,v 1.37 1997/09/19 11:13:16 phk Exp $ | 34 * $Id: ffs_alloc.c,v 1.38 1997/10/14 14:22:23 phk Exp $ |
35 */ 36 37#include "opt_quota.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/buf.h> 42#include <sys/proc.h> 43#include <sys/vnode.h> 44#include <sys/mount.h> 45#include <sys/kernel.h> 46#include <sys/sysctl.h> 47#include <sys/syslog.h> 48 49#include <ufs/ufs/quota.h> 50#include <ufs/ufs/inode.h> | 35 */ 36 37#include "opt_quota.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/buf.h> 42#include <sys/proc.h> 43#include <sys/vnode.h> 44#include <sys/mount.h> 45#include <sys/kernel.h> 46#include <sys/sysctl.h> 47#include <sys/syslog.h> 48 49#include <ufs/ufs/quota.h> 50#include <ufs/ufs/inode.h> |
51#include <ufs/ufs/ufs_extern.h> | |
52 53#include <ufs/ffs/fs.h> 54#include <ufs/ffs/ffs_extern.h> 55 56typedef ufs_daddr_t allocfcn_t __P((struct inode *ip, int cg, ufs_daddr_t bpref, 57 int size)); 58 59static ufs_daddr_t ffs_alloccg __P((struct inode *, int, ufs_daddr_t, int)); --- 1355 unchanged lines hidden (view full) --- 1415 register struct fs *fs; 1416 register struct cg *cgp; 1417 register struct inode *pip; 1418 ino_t ino = ap->a_ino; 1419 struct buf *bp; 1420 int error, cg; 1421 1422 pip = VTOI(ap->a_pvp); | 51 52#include <ufs/ffs/fs.h> 53#include <ufs/ffs/ffs_extern.h> 54 55typedef ufs_daddr_t allocfcn_t __P((struct inode *ip, int cg, ufs_daddr_t bpref, 56 int size)); 57 58static ufs_daddr_t ffs_alloccg __P((struct inode *, int, ufs_daddr_t, int)); --- 1355 unchanged lines hidden (view full) --- 1414 register struct fs *fs; 1415 register struct cg *cgp; 1416 register struct inode *pip; 1417 ino_t ino = ap->a_ino; 1418 struct buf *bp; 1419 int error, cg; 1420 1421 pip = VTOI(ap->a_pvp); |
1423 /* Remove the inode from its hash chain */ 1424 ufs_ihashrem(pip); | |
1425 fs = pip->i_fs; 1426 if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) 1427 panic("ffs_vfree: range: dev = 0x%x, ino = %d, fs = %s", 1428 pip->i_dev, ino, fs->fs_fsmnt); 1429 cg = ino_to_cg(fs, ino); 1430 error = bread(pip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), 1431 (int)fs->fs_cgsize, NOCRED, &bp); 1432 if (error) { --- 206 unchanged lines hidden --- | 1422 fs = pip->i_fs; 1423 if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) 1424 panic("ffs_vfree: range: dev = 0x%x, ino = %d, fs = %s", 1425 pip->i_dev, ino, fs->fs_fsmnt); 1426 cg = ino_to_cg(fs, ino); 1427 error = bread(pip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), 1428 (int)fs->fs_cgsize, NOCRED, &bp); 1429 if (error) { --- 206 unchanged lines hidden --- |