diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-09-18 16:40:43 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-10-11 22:15:03 -0400 |
commit | ecee76ba9d91fdcbdff933ca1bd41465ca4c4fdb (patch) | |
tree | 70baed19a4cab18ce053e961a16ba313c3bd4220 /fs/xfs/xfs_bmap.c | |
parent | b9b984d7846e37c57e5b3f8cd883ad45e8ebc2cf (diff) |
xfs: remove the nextents variable in xfs_bmapi
Instead of using a local variable that needs to updated when we modify
the extent map just check ifp->if_bytes directly where we use it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index ebcd38b14830..05d38adbb85e 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -4294,7 +4294,6 @@ xfs_bmapi( | |||
4294 | xfs_mount_t *mp; /* xfs mount structure */ | 4294 | xfs_mount_t *mp; /* xfs mount structure */ |
4295 | int n; /* current extent index */ | 4295 | int n; /* current extent index */ |
4296 | int nallocs; /* number of extents alloc'd */ | 4296 | int nallocs; /* number of extents alloc'd */ |
4297 | xfs_extnum_t nextents; /* number of extents in file */ | ||
4298 | xfs_fileoff_t obno; /* old block number (offset) */ | 4297 | xfs_fileoff_t obno; /* old block number (offset) */ |
4299 | xfs_bmbt_irec_t prev; /* previous file extent record */ | 4298 | xfs_bmbt_irec_t prev; /* previous file extent record */ |
4300 | int tmp_logflags; /* temp flags holder */ | 4299 | int tmp_logflags; /* temp flags holder */ |
@@ -4380,7 +4379,6 @@ xfs_bmapi( | |||
4380 | goto error0; | 4379 | goto error0; |
4381 | ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, | 4380 | ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, |
4382 | &prev); | 4381 | &prev); |
4383 | nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); | ||
4384 | n = 0; | 4382 | n = 0; |
4385 | end = bno + len; | 4383 | end = bno + len; |
4386 | obno = bno; | 4384 | obno = bno; |
@@ -4622,7 +4620,6 @@ xfs_bmapi( | |||
4622 | if (error) | 4620 | if (error) |
4623 | goto error0; | 4621 | goto error0; |
4624 | ep = xfs_iext_get_ext(ifp, lastx); | 4622 | ep = xfs_iext_get_ext(ifp, lastx); |
4625 | nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); | ||
4626 | xfs_bmbt_get_all(ep, &got); | 4623 | xfs_bmbt_get_all(ep, &got); |
4627 | ASSERT(got.br_startoff <= aoff); | 4624 | ASSERT(got.br_startoff <= aoff); |
4628 | ASSERT(got.br_startoff + got.br_blockcount >= | 4625 | ASSERT(got.br_startoff + got.br_blockcount >= |
@@ -4723,7 +4720,6 @@ xfs_bmapi( | |||
4723 | if (error) | 4720 | if (error) |
4724 | goto error0; | 4721 | goto error0; |
4725 | ep = xfs_iext_get_ext(ifp, lastx); | 4722 | ep = xfs_iext_get_ext(ifp, lastx); |
4726 | nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); | ||
4727 | xfs_bmbt_get_all(ep, &got); | 4723 | xfs_bmbt_get_all(ep, &got); |
4728 | /* | 4724 | /* |
4729 | * We may have combined previously unwritten | 4725 | * We may have combined previously unwritten |
@@ -4781,7 +4777,7 @@ xfs_bmapi( | |||
4781 | * Else go on to the next record. | 4777 | * Else go on to the next record. |
4782 | */ | 4778 | */ |
4783 | prev = got; | 4779 | prev = got; |
4784 | if (++lastx < nextents) { | 4780 | if (++lastx < ifp->if_bytes / sizeof(xfs_bmbt_rec_t)) { |
4785 | ep = xfs_iext_get_ext(ifp, lastx); | 4781 | ep = xfs_iext_get_ext(ifp, lastx); |
4786 | xfs_bmbt_get_all(ep, &got); | 4782 | xfs_bmbt_get_all(ep, &got); |
4787 | } else { | 4783 | } else { |