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_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 ad090a834ced..01c5a5ff230e 100644 --- a/fs/xfs/xfs_sb.h +++ b/fs/xfs/xfs_sb.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-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 |
@@ -72,7 +72,8 @@ struct xfs_mount; | |||
72 | XFS_SB_VERSION_DALIGNBIT | \ | 72 | XFS_SB_VERSION_DALIGNBIT | \ |
73 | XFS_SB_VERSION_SHAREDBIT | \ | 73 | XFS_SB_VERSION_SHAREDBIT | \ |
74 | XFS_SB_VERSION_LOGV2BIT | \ | 74 | XFS_SB_VERSION_LOGV2BIT | \ |
75 | XFS_SB_VERSION_SECTORBIT) | 75 | XFS_SB_VERSION_SECTORBIT | \ |
76 | XFS_SB_VERSION_MOREBITSBIT) | ||
76 | #define XFS_SB_VERSION_OKSASHBITS \ | 77 | #define XFS_SB_VERSION_OKSASHBITS \ |
77 | (XFS_SB_VERSION_NUMBITS | \ | 78 | (XFS_SB_VERSION_NUMBITS | \ |
78 | XFS_SB_VERSION_REALFBITS | \ | 79 | XFS_SB_VERSION_REALFBITS | \ |
@@ -103,12 +104,15 @@ struct xfs_mount; | |||
103 | */ | 104 | */ |
104 | #define XFS_SB_VERSION2_REALFBITS 0x00ffffff /* Mask: features */ | 105 | #define XFS_SB_VERSION2_REALFBITS 0x00ffffff /* Mask: features */ |
105 | #define XFS_SB_VERSION2_RESERVED1BIT 0x00000001 | 106 | #define XFS_SB_VERSION2_RESERVED1BIT 0x00000001 |
107 | #define XFS_SB_VERSION2_RESERVED2BIT 0x00000002 | ||
108 | #define XFS_SB_VERSION2_RESERVED4BIT 0x00000004 | ||
109 | #define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ | ||
106 | #define XFS_SB_VERSION2_SASHFBITS 0xff000000 /* Mask: features that | 110 | #define XFS_SB_VERSION2_SASHFBITS 0xff000000 /* Mask: features that |
107 | require changing | 111 | require changing |
108 | PROM and SASH */ | 112 | PROM and SASH */ |
109 | 113 | ||
110 | #define XFS_SB_VERSION2_OKREALFBITS \ | 114 | #define XFS_SB_VERSION2_OKREALFBITS \ |
111 | (0) | 115 | (XFS_SB_VERSION2_ATTR2BIT) |
112 | #define XFS_SB_VERSION2_OKSASHFBITS \ | 116 | #define XFS_SB_VERSION2_OKSASHFBITS \ |
113 | (0) | 117 | (0) |
114 | #define XFS_SB_VERSION2_OKREALBITS \ | 118 | #define XFS_SB_VERSION2_OKREALBITS \ |
@@ -118,8 +122,7 @@ struct xfs_mount; | |||
118 | /* | 122 | /* |
119 | * mkfs macro to set up sb_features2 word | 123 | * mkfs macro to set up sb_features2 word |
120 | */ | 124 | */ |
121 | #define XFS_SB_VERSION2_MKFS(xyz) \ | 125 | #define XFS_SB_VERSION2_MKFS(resvd1, sbcntr) 0 |
122 | ((xyz) ? 0 : 0) | ||
123 | 126 | ||
124 | typedef struct xfs_sb | 127 | typedef struct xfs_sb |
125 | { | 128 | { |
@@ -176,7 +179,7 @@ typedef struct xfs_sb | |||
176 | __uint8_t sb_logsectlog; /* log2 of the log sector size */ | 179 | __uint8_t sb_logsectlog; /* log2 of the log sector size */ |
177 | __uint16_t sb_logsectsize; /* sector size for the log, bytes */ | 180 | __uint16_t sb_logsectsize; /* sector size for the log, bytes */ |
178 | __uint32_t sb_logsunit; /* stripe unit size for the log */ | 181 | __uint32_t sb_logsunit; /* stripe unit size for the log */ |
179 | __uint32_t sb_features2; /* additonal feature bits */ | 182 | __uint32_t sb_features2; /* additional feature bits */ |
180 | } xfs_sb_t; | 183 | } xfs_sb_t; |
181 | 184 | ||
182 | /* | 185 | /* |
@@ -216,12 +219,15 @@ typedef enum { | |||
216 | #define XFS_SB_SHARED_VN XFS_SB_MVAL(SHARED_VN) | 219 | #define XFS_SB_SHARED_VN XFS_SB_MVAL(SHARED_VN) |
217 | #define XFS_SB_UNIT XFS_SB_MVAL(UNIT) | 220 | #define XFS_SB_UNIT XFS_SB_MVAL(UNIT) |
218 | #define XFS_SB_WIDTH XFS_SB_MVAL(WIDTH) | 221 | #define XFS_SB_WIDTH XFS_SB_MVAL(WIDTH) |
222 | #define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) | ||
219 | #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) | 223 | #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) |
220 | #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) | 224 | #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) |
221 | #define XFS_SB_MOD_BITS \ | 225 | #define XFS_SB_MOD_BITS \ |
222 | (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ | 226 | (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ |
223 | XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ | 227 | XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ |
224 | XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH) | 228 | XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ |
229 | XFS_SB_FEATURES2) | ||
230 | |||
225 | 231 | ||
226 | /* | 232 | /* |
227 | * Misc. Flags - warning - these will be cleared by xfs_repair unless | 233 | * Misc. Flags - warning - these will be cleared by xfs_repair unless |
@@ -500,13 +506,31 @@ int xfs_sb_version_hasmorebits(xfs_sb_t *sbp); | |||
500 | /* | 506 | /* |
501 | * sb_features2 bit version macros. | 507 | * sb_features2 bit version macros. |
502 | * | 508 | * |
503 | * For example, for a bit defined as XFS_SB_VERSION2_YBIT, has a macro: | 509 | * For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro: |
504 | * | 510 | * |
505 | * SB_VERSION_HASYBIT(xfs_sb_t *sbp) | 511 | * SB_VERSION_HASFUNBIT(xfs_sb_t *sbp) |
506 | * ((XFS_SB_VERSION_HASMOREBITS(sbp) && | 512 | * ((XFS_SB_VERSION_HASMOREBITS(sbp) && |
507 | * ((sbp)->sb_versionnum & XFS_SB_VERSION2_YBIT) | 513 | * ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT) |
508 | */ | 514 | */ |
515 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR2) | ||
516 | int xfs_sb_version_hasattr2(xfs_sb_t *sbp); | ||
517 | #define XFS_SB_VERSION_HASATTR2(sbp) xfs_sb_version_hasattr2(sbp) | ||
518 | #else | ||
519 | #define XFS_SB_VERSION_HASATTR2(sbp) \ | ||
520 | ((XFS_SB_VERSION_HASMOREBITS(sbp)) && \ | ||
521 | ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT)) | ||
522 | #endif | ||
509 | 523 | ||
524 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR2) | ||
525 | void xfs_sb_version_addattr2(xfs_sb_t *sbp); | ||
526 | #define XFS_SB_VERSION_ADDATTR2(sbp) xfs_sb_version_addattr2(sbp) | ||
527 | #else | ||
528 | #define XFS_SB_VERSION_ADDATTR2(sbp) \ | ||
529 | ((sbp)->sb_versionnum = \ | ||
530 | ((sbp)->sb_versionnum | XFS_SB_VERSION_MOREBITSBIT), \ | ||
531 | ((sbp)->sb_features2 = \ | ||
532 | ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))) | ||
533 | #endif | ||
510 | /* | 534 | /* |
511 | * end of superblock version macros | 535 | * end of superblock version macros |
512 | */ | 536 | */ |