diff options
Diffstat (limited to 'fs/xfs/xfs_dir.c')
-rw-r--r-- | fs/xfs/xfs_dir.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/xfs/xfs_dir.c b/fs/xfs/xfs_dir.c index ba30bc7682f2..53787f35338b 100644 --- a/fs/xfs/xfs_dir.c +++ b/fs/xfs/xfs_dir.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License as | 5 | * under the terms of version 2 of the GNU General Public License as |
@@ -192,11 +192,23 @@ xfs_dir_mount(xfs_mount_t *mp) | |||
192 | uint shortcount, leafcount, count; | 192 | uint shortcount, leafcount, count; |
193 | 193 | ||
194 | mp->m_dirversion = 1; | 194 | mp->m_dirversion = 1; |
195 | shortcount = (mp->m_attroffset - (uint)sizeof(xfs_dir_sf_hdr_t)) / | 195 | if (mp->m_flags & XFS_MOUNT_COMPAT_ATTR) { |
196 | (uint)sizeof(xfs_dir_sf_entry_t); | 196 | shortcount = (mp->m_attroffset - |
197 | leafcount = (XFS_LBSIZE(mp) - (uint)sizeof(xfs_dir_leaf_hdr_t)) / | 197 | (uint)sizeof(xfs_dir_sf_hdr_t)) / |
198 | ((uint)sizeof(xfs_dir_leaf_entry_t) + | 198 | (uint)sizeof(xfs_dir_sf_entry_t); |
199 | (uint)sizeof(xfs_dir_leaf_name_t)); | 199 | leafcount = (XFS_LBSIZE(mp) - |
200 | (uint)sizeof(xfs_dir_leaf_hdr_t)) / | ||
201 | ((uint)sizeof(xfs_dir_leaf_entry_t) + | ||
202 | (uint)sizeof(xfs_dir_leaf_name_t)); | ||
203 | } else { | ||
204 | shortcount = (XFS_BMDR_SPACE_CALC(MINABTPTRS) - | ||
205 | (uint)sizeof(xfs_dir_sf_hdr_t)) / | ||
206 | (uint)sizeof(xfs_dir_sf_entry_t); | ||
207 | leafcount = (XFS_LBSIZE(mp) - | ||
208 | (uint)sizeof(xfs_dir_leaf_hdr_t)) / | ||
209 | ((uint)sizeof(xfs_dir_leaf_entry_t) + | ||
210 | (uint)sizeof(xfs_dir_leaf_name_t)); | ||
211 | } | ||
200 | count = shortcount > leafcount ? shortcount : leafcount; | 212 | count = shortcount > leafcount ? shortcount : leafcount; |
201 | mp->m_dircook_elog = xfs_da_log2_roundup(count + 1); | 213 | mp->m_dircook_elog = xfs_da_log2_roundup(count + 1); |
202 | ASSERT(mp->m_dircook_elog <= mp->m_sb.sb_blocklog); | 214 | ASSERT(mp->m_dircook_elog <= mp->m_sb.sb_blocklog); |