diff options
author | mckusick <mckusick@FreeBSD.org> | 2011-07-10 05:34:49 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2011-07-10 05:34:49 +0000 |
commit | 0196d962928b6af11993a8b5faedfdf7c4dd8029 (patch) | |
tree | 53ed80e4d3c3e8bc016f47cacded636090628463 /sys/ufs/ffs/ffs_alloc.c | |
parent | fd05bc36dc720c9f585af04689be1ceb89427175 (diff) | |
download | FreeBSD-src-0196d962928b6af11993a8b5faedfdf7c4dd8029.zip FreeBSD-src-0196d962928b6af11993a8b5faedfdf7c4dd8029.tar.gz |
When first creating snapshots, we may free some blocks within it.
These blocks should not have TRIM applied to them.
Submitted by: Kostik Belousov
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6d27ace..357b152 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2038,7 +2038,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, dephd)) { return; } - if (!ump->um_candelete) { + /* + * Nothing to delay if TRIM is disabled, or the operation is + * performed on the snapshot. + */ + if (!ump->um_candelete || devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } |