Deleted Added
full compact
ffs_alloc.c (31351) ffs_alloc.c (31352)
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.42 1997/11/07 08:53:34 phk Exp $
34 * $Id: ffs_alloc.c,v 1.43 1997/11/22 07:00:40 bde 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>

--- 10 unchanged lines hidden (view full) ---

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));
60static ufs_daddr_t ffs_alloccgblk __P((struct fs *, struct cg *, ufs_daddr_t));
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>

--- 10 unchanged lines hidden (view full) ---

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));
60static ufs_daddr_t ffs_alloccgblk __P((struct fs *, struct cg *, ufs_daddr_t));
61#ifdef DIAGNOSTIC
62static int ffs_checkblk __P((struct inode *, ufs_daddr_t, long));
63#endif
61static void ffs_clusteracct __P((struct fs *, struct cg *, ufs_daddr_t,
62 int));
63#ifdef notyet
64static ufs_daddr_t ffs_clusteralloc __P((struct inode *, int, ufs_daddr_t,
65 int));
66#endif
67static ino_t ffs_dirpref __P((struct fs *));
68static ufs_daddr_t ffs_fragextend __P((struct inode *, int, long, int, int));

--- 261 unchanged lines hidden (view full) ---

330 * changed to reflect the new allocation. If unsuccessful, the allocation
331 * is left unchanged. The success in doing the reallocation is returned.
332 * Note that the error return is not reflected back to the user. Rather
333 * the previous block allocation will be used.
334 */
335static int doasyncfree = 1;
336SYSCTL_INT(_vfs_ffs, FFS_ASYNCFREE, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, "");
337
64static void ffs_clusteracct __P((struct fs *, struct cg *, ufs_daddr_t,
65 int));
66#ifdef notyet
67static ufs_daddr_t ffs_clusteralloc __P((struct inode *, int, ufs_daddr_t,
68 int));
69#endif
70static ino_t ffs_dirpref __P((struct fs *));
71static ufs_daddr_t ffs_fragextend __P((struct inode *, int, long, int, int));

--- 261 unchanged lines hidden (view full) ---

333 * changed to reflect the new allocation. If unsuccessful, the allocation
334 * is left unchanged. The success in doing the reallocation is returned.
335 * Note that the error return is not reflected back to the user. Rather
336 * the previous block allocation will be used.
337 */
338static int doasyncfree = 1;
339SYSCTL_INT(_vfs_ffs, FFS_ASYNCFREE, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, "");
340
338int doreallocblks = 1;
341static int doreallocblks = 1;
339SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
340
341static int prtrealloc = 0;
342#endif
343
344int
345ffs_reallocblks(ap)
346 struct vop_reallocblks_args /* {

--- 1005 unchanged lines hidden (view full) ---

1352 bdwrite(bp);
1353}
1354
1355#ifdef DIAGNOSTIC
1356/*
1357 * Verify allocation of a block or fragment. Returns true if block or
1358 * fragment is allocated, false if it is free.
1359 */
342SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
343
344static int prtrealloc = 0;
345#endif
346
347int
348ffs_reallocblks(ap)
349 struct vop_reallocblks_args /* {

--- 1005 unchanged lines hidden (view full) ---

1355 bdwrite(bp);
1356}
1357
1358#ifdef DIAGNOSTIC
1359/*
1360 * Verify allocation of a block or fragment. Returns true if block or
1361 * fragment is allocated, false if it is free.
1362 */
1360int
1363static int
1361ffs_checkblk(ip, bno, size)
1362 struct inode *ip;
1363 ufs_daddr_t bno;
1364 long size;
1365{
1366 struct fs *fs;
1367 struct cg *cgp;
1368 struct buf *bp;

--- 265 unchanged lines hidden ---
1364ffs_checkblk(ip, bno, size)
1365 struct inode *ip;
1366 ufs_daddr_t bno;
1367 long size;
1368{
1369 struct fs *fs;
1370 struct cg *cgp;
1371 struct buf *bp;

--- 265 unchanged lines hidden ---