diff options
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index afcf3c926565..c980e2a5086b 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -21,8 +21,6 @@ | |||
21 | #include "xfs_format.h" | 21 | #include "xfs_format.h" |
22 | #include "xfs_log_format.h" | 22 | #include "xfs_log_format.h" |
23 | #include "xfs_trans_resv.h" | 23 | #include "xfs_trans_resv.h" |
24 | #include "xfs_sb.h" | ||
25 | #include "xfs_ag.h" | ||
26 | #include "xfs_mount.h" | 24 | #include "xfs_mount.h" |
27 | #include "xfs_inode.h" | 25 | #include "xfs_inode.h" |
28 | #include "xfs_btree.h" | 26 | #include "xfs_btree.h" |
@@ -38,7 +36,6 @@ | |||
38 | #include "xfs_quota.h" | 36 | #include "xfs_quota.h" |
39 | #include "xfs_dquot_item.h" | 37 | #include "xfs_dquot_item.h" |
40 | #include "xfs_dquot.h" | 38 | #include "xfs_dquot.h" |
41 | #include "xfs_dinode.h" | ||
42 | 39 | ||
43 | 40 | ||
44 | #define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ | 41 | #define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ |
@@ -52,7 +49,6 @@ xfs_iomap_eof_align_last_fsb( | |||
52 | xfs_extlen_t extsize, | 49 | xfs_extlen_t extsize, |
53 | xfs_fileoff_t *last_fsb) | 50 | xfs_fileoff_t *last_fsb) |
54 | { | 51 | { |
55 | xfs_fileoff_t new_last_fsb = 0; | ||
56 | xfs_extlen_t align = 0; | 52 | xfs_extlen_t align = 0; |
57 | int eof, error; | 53 | int eof, error; |
58 | 54 | ||
@@ -70,8 +66,8 @@ xfs_iomap_eof_align_last_fsb( | |||
70 | else if (mp->m_dalign) | 66 | else if (mp->m_dalign) |
71 | align = mp->m_dalign; | 67 | align = mp->m_dalign; |
72 | 68 | ||
73 | if (align && XFS_ISIZE(ip) >= XFS_FSB_TO_B(mp, align)) | 69 | if (align && XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, align)) |
74 | new_last_fsb = roundup_64(*last_fsb, align); | 70 | align = 0; |
75 | } | 71 | } |
76 | 72 | ||
77 | /* | 73 | /* |
@@ -79,14 +75,14 @@ xfs_iomap_eof_align_last_fsb( | |||
79 | * (when file on a real-time subvolume or has di_extsize hint). | 75 | * (when file on a real-time subvolume or has di_extsize hint). |
80 | */ | 76 | */ |
81 | if (extsize) { | 77 | if (extsize) { |
82 | if (new_last_fsb) | 78 | if (align) |
83 | align = roundup_64(new_last_fsb, extsize); | 79 | align = roundup_64(align, extsize); |
84 | else | 80 | else |
85 | align = extsize; | 81 | align = extsize; |
86 | new_last_fsb = roundup_64(*last_fsb, align); | ||
87 | } | 82 | } |
88 | 83 | ||
89 | if (new_last_fsb) { | 84 | if (align) { |
85 | xfs_fileoff_t new_last_fsb = roundup_64(*last_fsb, align); | ||
90 | error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof); | 86 | error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof); |
91 | if (error) | 87 | if (error) |
92 | return error; | 88 | return error; |
@@ -264,7 +260,6 @@ xfs_iomap_eof_want_preallocate( | |||
264 | { | 260 | { |
265 | xfs_fileoff_t start_fsb; | 261 | xfs_fileoff_t start_fsb; |
266 | xfs_filblks_t count_fsb; | 262 | xfs_filblks_t count_fsb; |
267 | xfs_fsblock_t firstblock; | ||
268 | int n, error, imaps; | 263 | int n, error, imaps; |
269 | int found_delalloc = 0; | 264 | int found_delalloc = 0; |
270 | 265 | ||
@@ -289,7 +284,6 @@ xfs_iomap_eof_want_preallocate( | |||
289 | count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); | 284 | count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); |
290 | while (count_fsb > 0) { | 285 | while (count_fsb > 0) { |
291 | imaps = nimaps; | 286 | imaps = nimaps; |
292 | firstblock = NULLFSBLOCK; | ||
293 | error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, | 287 | error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, |
294 | 0); | 288 | 0); |
295 | if (error) | 289 | if (error) |