diff options
-rw-r--r-- | fs/xfs/xfs_iomap.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 22d1cbea283d..3b80ebae05f5 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -128,7 +128,6 @@ xfs_iomap_write_direct( | |||
128 | xfs_fsblock_t firstfsb; | 128 | xfs_fsblock_t firstfsb; |
129 | xfs_extlen_t extsz, temp; | 129 | xfs_extlen_t extsz, temp; |
130 | int nimaps; | 130 | int nimaps; |
131 | int bmapi_flag; | ||
132 | int quota_flag; | 131 | int quota_flag; |
133 | int rt; | 132 | int rt; |
134 | xfs_trans_t *tp; | 133 | xfs_trans_t *tp; |
@@ -200,18 +199,15 @@ xfs_iomap_write_direct( | |||
200 | 199 | ||
201 | xfs_trans_ijoin(tp, ip, 0); | 200 | xfs_trans_ijoin(tp, ip, 0); |
202 | 201 | ||
203 | bmapi_flag = 0; | ||
204 | if (offset < XFS_ISIZE(ip) || extsz) | ||
205 | bmapi_flag |= XFS_BMAPI_PREALLOC; | ||
206 | |||
207 | /* | 202 | /* |
208 | * From this point onwards we overwrite the imap pointer that the | 203 | * From this point onwards we overwrite the imap pointer that the |
209 | * caller gave to us. | 204 | * caller gave to us. |
210 | */ | 205 | */ |
211 | xfs_bmap_init(&free_list, &firstfsb); | 206 | xfs_bmap_init(&free_list, &firstfsb); |
212 | nimaps = 1; | 207 | nimaps = 1; |
213 | error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, bmapi_flag, | 208 | error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, |
214 | &firstfsb, 0, imap, &nimaps, &free_list); | 209 | XFS_BMAPI_PREALLOC, &firstfsb, 0, |
210 | imap, &nimaps, &free_list); | ||
215 | if (error) | 211 | if (error) |
216 | goto out_bmap_cancel; | 212 | goto out_bmap_cancel; |
217 | 213 | ||