diff options
author | phk <phk@FreeBSD.org> | 1998-09-05 14:13:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-09-05 14:13:12 +0000 |
commit | 4630814c8bc51e668f785289086657fbd5e775f2 (patch) | |
tree | e5449931fffd8e8dd0e4d28f5b7b28dc6e36ba5c /sys/ufs | |
parent | ec3c90cf78eb16d4a8906a64e2a6f76cf27b8441 (diff) | |
download | FreeBSD-src-4630814c8bc51e668f785289086657fbd5e775f2.zip FreeBSD-src-4630814c8bc51e668f785289086657fbd5e775f2.tar.gz |
Add a new vnode op, VOP_FREEBLKS(), which filesystems can use to inform
device drivers about sectors no longer in use.
Device-drivers receive the call through d_strategy, if they have
D_CANFREE in d_flags.
This allows flash based devices to erase the sectors and avoid
pointlessly carrying them around in compactions.
Reviewed by: Kirk Mckusick, bde
Sponsored by: M-Systems (www.m-sys.com)
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6a57a26..e73638d 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 - * $Id: ffs_alloc.c,v 1.50 1998/07/11 07:46:04 bde Exp $ + * $Id: ffs_alloc.c,v 1.51 1998/08/17 19:09:36 bde Exp $ */ #include "opt_quota.h" @@ -1300,6 +1300,7 @@ ffs_blkfree(ip, bno, size) int i, error, cg, blk, frags, bbase; fs = ip->i_fs; + VOP_FREEBLKS(ip->i_devvp, fsbtodb(fs, bno), size); if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 || fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) { printf("dev=0x%lx, bno = %d, bsize = %d, size = %ld, fs = %s\n", |