diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-01 18:34:53 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 18:34:53 -0500 |
commit | d8cc890d4095f1eaa7f411a85051015b21262b12 (patch) | |
tree | e13bec06a94a8dc5552dab733e90ef4f4d41fb8b /fs/xfs/xfs_dir.c | |
parent | aa82daa06198b27963fe3d6ee8035855b29f6524 (diff) |
[XFS] Ondisk format extension for extended attributes (attr2). Basically,
the data/attr forks now grow up/down from either end of the literal area,
rather than dividing the literal area into two chunks and growing both
upward. Means we can now make much more efficient use of the attribute
space, incl. fitting DMF attributes inline in 256 byte inodes, and large
jumps in dbench3 performance numbers. It is self enabling, but can be
forced on/off via the attr2/noattr2 mount options.
SGI-PV: 941645
SGI-Modid: xfs-linux:xfs-kern:23835a
Signed-off-by: Nathan Scott <nathans@sgi.com>
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); |