diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-02 10:34:53 +1100 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-02 10:34:53 +1100 |
commit | d8cc890d4095f1eaa7f411a85051015b21262b12 (patch) | |
tree | e13bec06a94a8dc5552dab733e90ef4f4d41fb8b /fs/xfs/xfs_sb.h | |
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_sb.h')
-rw-r--r-- | fs/xfs/xfs_sb.h | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h index ad090a834ce..01c5a5ff230 100644 --- a/fs/xfs/xfs_sb.h +++ b/fs/xfs/xfs_sb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -72,7 +72,8 @@ struct xfs_mount; XFS_SB_VERSION_DALIGNBIT | \ XFS_SB_VERSION_SHAREDBIT | \ XFS_SB_VERSION_LOGV2BIT | \ - XFS_SB_VERSION_SECTORBIT) + XFS_SB_VERSION_SECTORBIT | \ + XFS_SB_VERSION_MOREBITSBIT) #define XFS_SB_VERSION_OKSASHBITS \ (XFS_SB_VERSION_NUMBITS | \ XFS_SB_VERSION_REALFBITS | \ @@ -103,12 +104,15 @@ struct xfs_mount; */ #define XFS_SB_VERSION2_REALFBITS 0x00ffffff /* Mask: features */ #define XFS_SB_VERSION2_RESERVED1BIT 0x00000001 +#define XFS_SB_VERSION2_RESERVED2BIT 0x00000002 +#define XFS_SB_VERSION2_RESERVED4BIT 0x00000004 +#define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ #define XFS_SB_VERSION2_SASHFBITS 0xff000000 /* Mask: features that require changing PROM and SASH */ #define XFS_SB_VERSION2_OKREALFBITS \ - (0) + (XFS_SB_VERSION2_ATTR2BIT) #define XFS_SB_VERSION2_OKSASHFBITS \ (0) #define XFS_SB_VERSION2_OKREALBITS \ @@ -118,8 +122,7 @@ struct xfs_mount; /* * mkfs macro to set up sb_features2 word */ -#define XFS_SB_VERSION2_MKFS(xyz) \ - ((xyz) ? 0 : 0) +#define XFS_SB_VERSION2_MKFS(resvd1, sbcntr) 0 typedef struct xfs_sb { @@ -176,7 +179,7 @@ typedef struct xfs_sb __uint8_t sb_logsectlog; /* log2 of the log sector size */ __uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint32_t sb_logsunit; /* stripe unit size for the log */ - __uint32_t sb_features2; /* additonal feature bits */ + __uint32_t sb_features2; /* additional feature bits */ } xfs_sb_t; /* @@ -216,12 +219,15 @@ typedef enum { #define XFS_SB_SHARED_VN XFS_SB_MVAL(SHARED_VN) #define XFS_SB_UNIT XFS_SB_MVAL(UNIT) #define XFS_SB_WIDTH XFS_SB_MVAL(WIDTH) +#define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) #define XFS_SB_MOD_BITS \ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ - XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH) + XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ + XFS_SB_FEATURES2) + /* * Misc. Flags - warning - these will be cleared by xfs_repair unless @@ -500,13 +506,31 @@ int xfs_sb_version_hasmorebits(xfs_sb_t *sbp); /* * sb_features2 bit version macros. * - * For example, for a bit defined as XFS_SB_VERSION2_YBIT, has a macro: + * For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro: * - * SB_VERSION_HASYBIT(xfs_sb_t *sbp) + * SB_VERSION_HASFUNBIT(xfs_sb_t *sbp) * ((XFS_SB_VERSION_HASMOREBITS(sbp) && - * ((sbp)->sb_versionnum & XFS_SB_VERSION2_YBIT) + * ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT) */ +#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR2) +int xfs_sb_version_hasattr2(xfs_sb_t *sbp); +#define XFS_SB_VERSION_HASATTR2(sbp) xfs_sb_version_hasattr2(sbp) +#else +#define XFS_SB_VERSION_HASATTR2(sbp) \ + ((XFS_SB_VERSION_HASMOREBITS(sbp)) && \ + ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT)) +#endif +#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR2) +void xfs_sb_version_addattr2(xfs_sb_t *sbp); +#define XFS_SB_VERSION_ADDATTR2(sbp) xfs_sb_version_addattr2(sbp) +#else +#define XFS_SB_VERSION_ADDATTR2(sbp) \ + ((sbp)->sb_versionnum = \ + ((sbp)->sb_versionnum | XFS_SB_VERSION_MOREBITSBIT), \ + ((sbp)->sb_features2 = \ + ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))) +#endif /* * end of superblock version macros */ |