diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-06 01:01:58 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-06 01:01:58 -0400 |
commit | 0650b55497ef583c43d6afc80e11a39e92d9a525 (patch) | |
tree | 7605714c36579ac623f4045db2fcb08ca9d298a5 /fs/xfs/xfs_da_btree.h | |
parent | 2d6dcc6d7e95cc83046b2f97e179e6bbb7921245 (diff) |
xfs: introduce directory geometry structure
The directory code has a dependency on the struct xfs_mount to
supply the directory block geometry. Block size, block log size,
and other parameters are pre-caclulated in the struct xfs_mount or
access directly from the superblock embedded in the struct
xfs_mount.
Extract all of this geometry information out of the struct xfs_mount
and superblock and place it into a new struct xfs_da_geometry
defined by the directory code. Allocate and initialise it at mount
time, and attach it to the struct xfs_mount so it canbe passed back
into the directory code appropriately rather than using the struct
xfs_mount.
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_da_btree.h')
-rw-r--r-- | fs/xfs/xfs_da_btree.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index c824a0aa039f..0ac63adca705 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h | |||
@@ -25,6 +25,23 @@ struct xfs_trans; | |||
25 | struct zone; | 25 | struct zone; |
26 | struct xfs_dir_ops; | 26 | struct xfs_dir_ops; |
27 | 27 | ||
28 | /* | ||
29 | * Directory/attribute geometry information. There will be one of these for each | ||
30 | * data fork type, and it will be passed around via the xfs_da_args. Global | ||
31 | * structures will be attached to the xfs_mount. | ||
32 | */ | ||
33 | struct xfs_da_geometry { | ||
34 | int blksize; /* da block size in bytes */ | ||
35 | int fsbcount; /* da block size in filesystem blocks */ | ||
36 | uint8_t fsblog; /* log2 of _filesystem_ block size */ | ||
37 | uint8_t blklog; /* log2 of da block size */ | ||
38 | uint node_ents; /* # of entries in a danode */ | ||
39 | int magicpct; /* 37% of block size in bytes */ | ||
40 | xfs_dablk_t datablk; /* blockno of dir data v2 */ | ||
41 | xfs_dablk_t leafblk; /* blockno of leaf data v2 */ | ||
42 | xfs_dablk_t freeblk; /* blockno of free data v2 */ | ||
43 | }; | ||
44 | |||
28 | /*======================================================================== | 45 | /*======================================================================== |
29 | * Btree searching and modification structure definitions. | 46 | * Btree searching and modification structure definitions. |
30 | *========================================================================*/ | 47 | *========================================================================*/ |
@@ -42,6 +59,7 @@ enum xfs_dacmp { | |||
42 | * Structure to ease passing around component names. | 59 | * Structure to ease passing around component names. |
43 | */ | 60 | */ |
44 | typedef struct xfs_da_args { | 61 | typedef struct xfs_da_args { |
62 | struct xfs_da_geometry *geo; /* da block geometry */ | ||
45 | const __uint8_t *name; /* string (maybe not NULL terminated) */ | 63 | const __uint8_t *name; /* string (maybe not NULL terminated) */ |
46 | int namelen; /* length of string (maybe no NULL) */ | 64 | int namelen; /* length of string (maybe no NULL) */ |
47 | __uint8_t filetype; /* filetype of inode for directories */ | 65 | __uint8_t filetype; /* filetype of inode for directories */ |