diff options
| -rw-r--r-- | fs/xfs/xfs_bmap.c | 8 | ||||
| -rw-r--r-- | fs/xfs/xfs_bmap.h | 17 | ||||
| -rw-r--r-- | fs/xfs/xfs_inode.c | 3 |
3 files changed, 8 insertions, 20 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index e0389656ad2c..598a30ba3141 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
| @@ -4618,19 +4618,13 @@ xfs_bmapi( | |||
| 4618 | * allocate the stuff asked for in this bmap call | 4618 | * allocate the stuff asked for in this bmap call |
| 4619 | * but that wouldn't be as good. | 4619 | * but that wouldn't be as good. |
| 4620 | */ | 4620 | */ |
| 4621 | if (wasdelay && !(flags & XFS_BMAPI_EXACT)) { | 4621 | if (wasdelay) { |
| 4622 | alen = (xfs_extlen_t)got.br_blockcount; | 4622 | alen = (xfs_extlen_t)got.br_blockcount; |
| 4623 | aoff = got.br_startoff; | 4623 | aoff = got.br_startoff; |
| 4624 | if (lastx != NULLEXTNUM && lastx) { | 4624 | if (lastx != NULLEXTNUM && lastx) { |
| 4625 | ep = xfs_iext_get_ext(ifp, lastx - 1); | 4625 | ep = xfs_iext_get_ext(ifp, lastx - 1); |
| 4626 | xfs_bmbt_get_all(ep, &prev); | 4626 | xfs_bmbt_get_all(ep, &prev); |
| 4627 | } | 4627 | } |
| 4628 | } else if (wasdelay) { | ||
| 4629 | alen = (xfs_extlen_t) | ||
| 4630 | XFS_FILBLKS_MIN(len, | ||
| 4631 | (got.br_startoff + | ||
| 4632 | got.br_blockcount) - bno); | ||
| 4633 | aoff = bno; | ||
| 4634 | } else { | 4628 | } else { |
| 4635 | alen = (xfs_extlen_t) | 4629 | alen = (xfs_extlen_t) |
| 4636 | XFS_FILBLKS_MIN(len, MAXEXTLEN); | 4630 | XFS_FILBLKS_MIN(len, MAXEXTLEN); |
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index 419dafb9d87d..d9c8a39b2855 100644 --- a/fs/xfs/xfs_bmap.h +++ b/fs/xfs/xfs_bmap.h | |||
| @@ -82,16 +82,13 @@ typedef struct xfs_bmap_free | |||
| 82 | #define XFS_BMAPI_DELAY 0x002 /* delayed write operation */ | 82 | #define XFS_BMAPI_DELAY 0x002 /* delayed write operation */ |
| 83 | #define XFS_BMAPI_ENTIRE 0x004 /* return entire extent, not trimmed */ | 83 | #define XFS_BMAPI_ENTIRE 0x004 /* return entire extent, not trimmed */ |
| 84 | #define XFS_BMAPI_METADATA 0x008 /* mapping metadata not user data */ | 84 | #define XFS_BMAPI_METADATA 0x008 /* mapping metadata not user data */ |
| 85 | #define XFS_BMAPI_EXACT 0x010 /* allocate only to spec'd bounds */ | 85 | #define XFS_BMAPI_ATTRFORK 0x010 /* use attribute fork not data */ |
| 86 | #define XFS_BMAPI_ATTRFORK 0x020 /* use attribute fork not data */ | 86 | #define XFS_BMAPI_RSVBLOCKS 0x020 /* OK to alloc. reserved data blocks */ |
| 87 | #define XFS_BMAPI_ASYNC 0x040 /* bunmapi xactions can be async */ | 87 | #define XFS_BMAPI_PREALLOC 0x040 /* preallocation op: unwritten space */ |
| 88 | #define XFS_BMAPI_RSVBLOCKS 0x080 /* OK to alloc. reserved data blocks */ | 88 | #define XFS_BMAPI_IGSTATE 0x080 /* Ignore state - */ |
| 89 | #define XFS_BMAPI_PREALLOC 0x100 /* preallocation op: unwritten space */ | ||
| 90 | #define XFS_BMAPI_IGSTATE 0x200 /* Ignore state - */ | ||
| 91 | /* combine contig. space */ | 89 | /* combine contig. space */ |
| 92 | #define XFS_BMAPI_CONTIG 0x400 /* must allocate only one extent */ | 90 | #define XFS_BMAPI_CONTIG 0x100 /* must allocate only one extent */ |
| 93 | /* XFS_BMAPI_DIRECT_IO 0x800 */ | 91 | #define XFS_BMAPI_CONVERT 0x200 /* unwritten extent conversion - */ |
| 94 | #define XFS_BMAPI_CONVERT 0x1000 /* unwritten extent conversion - */ | ||
| 95 | /* need write cache flushing and no */ | 92 | /* need write cache flushing and no */ |
| 96 | /* additional allocation alignments */ | 93 | /* additional allocation alignments */ |
| 97 | 94 | ||
| @@ -100,9 +97,7 @@ typedef struct xfs_bmap_free | |||
| 100 | { XFS_BMAPI_DELAY, "DELAY" }, \ | 97 | { XFS_BMAPI_DELAY, "DELAY" }, \ |
| 101 | { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ | 98 | { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ |
| 102 | { XFS_BMAPI_METADATA, "METADATA" }, \ | 99 | { XFS_BMAPI_METADATA, "METADATA" }, \ |
| 103 | { XFS_BMAPI_EXACT, "EXACT" }, \ | ||
| 104 | { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ | 100 | { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ |
| 105 | { XFS_BMAPI_ASYNC, "ASYNC" }, \ | ||
| 106 | { XFS_BMAPI_RSVBLOCKS, "RSVBLOCKS" }, \ | 101 | { XFS_BMAPI_RSVBLOCKS, "RSVBLOCKS" }, \ |
| 107 | { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ | 102 | { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ |
| 108 | { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ | 103 | { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index d22b580162cc..1e6ae68f91af 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
| @@ -1585,8 +1585,7 @@ xfs_itruncate_finish( | |||
| 1585 | xfs_bmap_init(&free_list, &first_block); | 1585 | xfs_bmap_init(&free_list, &first_block); |
| 1586 | error = xfs_bunmapi(ntp, ip, | 1586 | error = xfs_bunmapi(ntp, ip, |
| 1587 | first_unmap_block, unmap_len, | 1587 | first_unmap_block, unmap_len, |
| 1588 | xfs_bmapi_aflag(fork) | | 1588 | xfs_bmapi_aflag(fork), |
| 1589 | (sync ? 0 : XFS_BMAPI_ASYNC), | ||
| 1590 | XFS_ITRUNC_MAX_EXTENTS, | 1589 | XFS_ITRUNC_MAX_EXTENTS, |
| 1591 | &first_block, &free_list, | 1590 | &first_block, &free_list, |
| 1592 | NULL, &done); | 1591 | NULL, &done); |
