diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-06 01:11:18 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-06 01:11:18 -0400 |
commit | 7dda6e8644a31c366484bbcb564ea6c6225e5963 (patch) | |
tree | dc950e33f53c391aabdf775d513f3fa92ad39792 /fs/xfs/xfs_dir2_readdir.c | |
parent | 30028030b14d083123c88e3ab45990a8c375abf1 (diff) |
xfs: convert directory segment limits to xfs_da_geometry
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_readdir.c')
-rw-r--r-- | fs/xfs/xfs_dir2_readdir.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c index c2a63878d27c..0c8c09cf313f 100644 --- a/fs/xfs/xfs_dir2_readdir.c +++ b/fs/xfs/xfs_dir2_readdir.c | |||
@@ -111,18 +111,18 @@ xfs_dir2_sf_getdents( | |||
111 | /* | 111 | /* |
112 | * If the block number in the offset is out of range, we're done. | 112 | * If the block number in the offset is out of range, we're done. |
113 | */ | 113 | */ |
114 | if (xfs_dir2_dataptr_to_db(geo, ctx->pos) > mp->m_dirdatablk) | 114 | if (xfs_dir2_dataptr_to_db(geo, ctx->pos) > geo->datablk) |
115 | return 0; | 115 | return 0; |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * Precalculate offsets for . and .. as we will always need them. | 118 | * Precalculate offsets for . and .. as we will always need them. |
119 | * | 119 | * |
120 | * XXX(hch): the second argument is sometimes 0 and sometimes | 120 | * XXX(hch): the second argument is sometimes 0 and sometimes |
121 | * mp->m_dirdatablk. | 121 | * geo->datablk |
122 | */ | 122 | */ |
123 | dot_offset = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk, | 123 | dot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, |
124 | dp->d_ops->data_dot_offset); | 124 | dp->d_ops->data_dot_offset); |
125 | dotdot_offset = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk, | 125 | dotdot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, |
126 | dp->d_ops->data_dotdot_offset); | 126 | dp->d_ops->data_dotdot_offset); |
127 | 127 | ||
128 | /* | 128 | /* |
@@ -151,7 +151,7 @@ xfs_dir2_sf_getdents( | |||
151 | for (i = 0; i < sfp->count; i++) { | 151 | for (i = 0; i < sfp->count; i++) { |
152 | __uint8_t filetype; | 152 | __uint8_t filetype; |
153 | 153 | ||
154 | off = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk, | 154 | off = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, |
155 | xfs_dir2_sf_get_offset(sfep)); | 155 | xfs_dir2_sf_get_offset(sfep)); |
156 | 156 | ||
157 | if (ctx->pos > off) { | 157 | if (ctx->pos > off) { |
@@ -168,7 +168,7 @@ xfs_dir2_sf_getdents( | |||
168 | sfep = dp->d_ops->sf_nextentry(sfp, sfep); | 168 | sfep = dp->d_ops->sf_nextentry(sfp, sfep); |
169 | } | 169 | } |
170 | 170 | ||
171 | ctx->pos = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk + 1, 0) & | 171 | ctx->pos = xfs_dir2_db_off_to_dataptr(geo, geo->datablk + 1, 0) & |
172 | 0x7fffffff; | 172 | 0x7fffffff; |
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |
@@ -199,7 +199,7 @@ xfs_dir2_block_getdents( | |||
199 | /* | 199 | /* |
200 | * If the block number in the offset is out of range, we're done. | 200 | * If the block number in the offset is out of range, we're done. |
201 | */ | 201 | */ |
202 | if (xfs_dir2_dataptr_to_db(geo, ctx->pos) > mp->m_dirdatablk) | 202 | if (xfs_dir2_dataptr_to_db(geo, ctx->pos) > geo->datablk) |
203 | return 0; | 203 | return 0; |
204 | 204 | ||
205 | error = xfs_dir3_block_read(NULL, dp, &bp); | 205 | error = xfs_dir3_block_read(NULL, dp, &bp); |
@@ -248,7 +248,7 @@ xfs_dir2_block_getdents( | |||
248 | if ((char *)dep - (char *)hdr < wantoff) | 248 | if ((char *)dep - (char *)hdr < wantoff) |
249 | continue; | 249 | continue; |
250 | 250 | ||
251 | cook = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk, | 251 | cook = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, |
252 | (char *)dep - (char *)hdr); | 252 | (char *)dep - (char *)hdr); |
253 | 253 | ||
254 | ctx->pos = cook & 0x7fffffff; | 254 | ctx->pos = cook & 0x7fffffff; |
@@ -268,7 +268,7 @@ xfs_dir2_block_getdents( | |||
268 | * Reached the end of the block. | 268 | * Reached the end of the block. |
269 | * Set the offset to a non-existent block 1 and return. | 269 | * Set the offset to a non-existent block 1 and return. |
270 | */ | 270 | */ |
271 | ctx->pos = xfs_dir2_db_off_to_dataptr(geo, mp->m_dirdatablk + 1, 0) & | 271 | ctx->pos = xfs_dir2_db_off_to_dataptr(geo, geo->datablk + 1, 0) & |
272 | 0x7fffffff; | 272 | 0x7fffffff; |
273 | xfs_trans_brelse(NULL, bp); | 273 | xfs_trans_brelse(NULL, bp); |
274 | return 0; | 274 | return 0; |