diff options
author | Joel Becker <joel.becker@oracle.com> | 2009-02-10 19:05:07 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-04 19:07:47 -0400 |
commit | 47460d65a483529b3bc2bf6ccf461ad45f94df83 (patch) | |
tree | 0727cae9477749e5f2596e86253a210e79c96a83 /fs/ocfs2/ocfs2.h | |
parent | 8379e7c46cc48f51197dd663fc6676f47f2a1e71 (diff) |
ocfs2: Make the ocfs2_caching_info structure self-contained.
We want to use the ocfs2_caching_info structure in places that are not
inodes. To do that, it can no longer rely on referencing the inode
directly.
This patch moves the flags to ocfs2_caching_info->ci_flags, stores
pointers to the parent's locks on the ocfs2_caching_info, and renames
the constants and flags to reflect its independant state.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 39e1d5a39505..eef3bd077c10 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -51,17 +51,36 @@ | |||
51 | /* For struct ocfs2_blockcheck_stats */ | 51 | /* For struct ocfs2_blockcheck_stats */ |
52 | #include "blockcheck.h" | 52 | #include "blockcheck.h" |
53 | 53 | ||
54 | |||
55 | /* Caching of metadata buffers */ | ||
56 | |||
54 | /* Most user visible OCFS2 inodes will have very few pieces of | 57 | /* Most user visible OCFS2 inodes will have very few pieces of |
55 | * metadata, but larger files (including bitmaps, etc) must be taken | 58 | * metadata, but larger files (including bitmaps, etc) must be taken |
56 | * into account when designing an access scheme. We allow a small | 59 | * into account when designing an access scheme. We allow a small |
57 | * amount of inlined blocks to be stored on an array and grow the | 60 | * amount of inlined blocks to be stored on an array and grow the |
58 | * structure into a rb tree when necessary. */ | 61 | * structure into a rb tree when necessary. */ |
59 | #define OCFS2_INODE_MAX_CACHE_ARRAY 2 | 62 | #define OCFS2_CACHE_INFO_MAX_ARRAY 2 |
63 | |||
64 | /* Flags for ocfs2_caching_info */ | ||
65 | |||
66 | enum ocfs2_caching_info_flags { | ||
67 | /* Indicates that the metadata cache is using the inline array */ | ||
68 | OCFS2_CACHE_FL_INLINE = 1<<1, | ||
69 | }; | ||
60 | 70 | ||
61 | struct ocfs2_caching_info { | 71 | struct ocfs2_caching_info { |
72 | /* | ||
73 | * The parent structure provides the locks, but because the | ||
74 | * parent structure can differ, struct ocfs2_caching_info needs | ||
75 | * its own pointers to them. | ||
76 | */ | ||
77 | spinlock_t *ci_lock; | ||
78 | struct mutex *ci_io_mutex; | ||
79 | |||
80 | unsigned int ci_flags; | ||
62 | unsigned int ci_num_cached; | 81 | unsigned int ci_num_cached; |
63 | union { | 82 | union { |
64 | sector_t ci_array[OCFS2_INODE_MAX_CACHE_ARRAY]; | 83 | sector_t ci_array[OCFS2_CACHE_INFO_MAX_ARRAY]; |
65 | struct rb_root ci_tree; | 84 | struct rb_root ci_tree; |
66 | } ci_cache; | 85 | } ci_cache; |
67 | }; | 86 | }; |