diff options
author | Dave Chinner <dchinner@redhat.com> | 2011-09-18 16:40:52 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-10-11 22:15:04 -0400 |
commit | c0dc7828af6952643219292be29e482ef74cb261 (patch) | |
tree | 02f12935ec56f61a9ed396d1b902b21aaf4ffb3e /fs/xfs/xfs_iomap.c | |
parent | b447fe5a05cbd01c4bf7fe2fa41cb9e99ce7e58e (diff) |
xfs: rename xfs_bmapi to xfs_bmapi_write
Now that all the read-only users of xfs_bmapi have been converted to
use xfs_bmapi_read(), we can remove all the read-only handling cases
from xfs_bmapi().
Once this is done, rename xfs_bmapi to xfs_bmapi_write to reflect
the fact it is for allocation only. This enables us to kill the
XFS_BMAPI_WRITE flag as well.
Also clean up xfs_bmapi_write to the style used in the newly added
xfs_bmapi_read/delay functions.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 681ba34c9233..da5bf05c5bb7 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -210,20 +210,18 @@ xfs_iomap_write_direct( | |||
210 | 210 | ||
211 | xfs_trans_ijoin(tp, ip); | 211 | xfs_trans_ijoin(tp, ip); |
212 | 212 | ||
213 | bmapi_flag = XFS_BMAPI_WRITE; | 213 | bmapi_flag = 0; |
214 | if (offset < ip->i_size || extsz) | 214 | if (offset < ip->i_size || extsz) |
215 | bmapi_flag |= XFS_BMAPI_PREALLOC; | 215 | bmapi_flag |= XFS_BMAPI_PREALLOC; |
216 | 216 | ||
217 | /* | 217 | /* |
218 | * Issue the xfs_bmapi() call to allocate the blocks. | ||
219 | * | ||
220 | * From this point onwards we overwrite the imap pointer that the | 218 | * From this point onwards we overwrite the imap pointer that the |
221 | * caller gave to us. | 219 | * caller gave to us. |
222 | */ | 220 | */ |
223 | xfs_bmap_init(&free_list, &firstfsb); | 221 | xfs_bmap_init(&free_list, &firstfsb); |
224 | nimaps = 1; | 222 | nimaps = 1; |
225 | error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag, | 223 | error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, bmapi_flag, |
226 | &firstfsb, 0, imap, &nimaps, &free_list); | 224 | &firstfsb, 0, imap, &nimaps, &free_list); |
227 | if (error) | 225 | if (error) |
228 | goto error0; | 226 | goto error0; |
229 | 227 | ||
@@ -582,14 +580,12 @@ xfs_iomap_write_allocate( | |||
582 | } | 580 | } |
583 | 581 | ||
584 | /* | 582 | /* |
585 | * Go get the actual blocks. | ||
586 | * | ||
587 | * From this point onwards we overwrite the imap | 583 | * From this point onwards we overwrite the imap |
588 | * pointer that the caller gave to us. | 584 | * pointer that the caller gave to us. |
589 | */ | 585 | */ |
590 | error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb, | 586 | error = xfs_bmapi_write(tp, ip, map_start_fsb, |
591 | XFS_BMAPI_WRITE, &first_block, 1, | 587 | count_fsb, 0, &first_block, 1, |
592 | imap, &nimaps, &free_list); | 588 | imap, &nimaps, &free_list); |
593 | if (error) | 589 | if (error) |
594 | goto trans_cancel; | 590 | goto trans_cancel; |
595 | 591 | ||
@@ -703,8 +699,8 @@ xfs_iomap_write_unwritten( | |||
703 | */ | 699 | */ |
704 | xfs_bmap_init(&free_list, &firstfsb); | 700 | xfs_bmap_init(&free_list, &firstfsb); |
705 | nimaps = 1; | 701 | nimaps = 1; |
706 | error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, | 702 | error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, |
707 | XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb, | 703 | XFS_BMAPI_CONVERT, &firstfsb, |
708 | 1, &imap, &nimaps, &free_list); | 704 | 1, &imap, &nimaps, &free_list); |
709 | if (error) | 705 | if (error) |
710 | goto error_on_bmapi_transaction; | 706 | goto error_on_bmapi_transaction; |