diff options
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 77 |
1 files changed, 61 insertions, 16 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 6546cef212e3..31692379c170 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -36,11 +36,8 @@ | |||
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | #include <linux/jbd.h> | 37 | #include <linux/jbd.h> |
38 | 38 | ||
39 | #include "cluster/nodemanager.h" | 39 | /* For union ocfs2_dlm_lksb */ |
40 | #include "cluster/heartbeat.h" | 40 | #include "stackglue.h" |
41 | #include "cluster/tcp.h" | ||
42 | |||
43 | #include "dlm/dlmapi.h" | ||
44 | 41 | ||
45 | #include "ocfs2_fs.h" | 42 | #include "ocfs2_fs.h" |
46 | #include "ocfs2_lockid.h" | 43 | #include "ocfs2_lockid.h" |
@@ -101,6 +98,9 @@ enum ocfs2_unlock_action { | |||
101 | * dropped. */ | 98 | * dropped. */ |
102 | #define OCFS2_LOCK_QUEUED (0x00000100) /* queued for downconvert */ | 99 | #define OCFS2_LOCK_QUEUED (0x00000100) /* queued for downconvert */ |
103 | #define OCFS2_LOCK_NOCACHE (0x00000200) /* don't use a holder count */ | 100 | #define OCFS2_LOCK_NOCACHE (0x00000200) /* don't use a holder count */ |
101 | #define OCFS2_LOCK_PENDING (0x00000400) /* This lockres is pending a | ||
102 | call to dlm_lock. Only | ||
103 | exists with BUSY set. */ | ||
104 | 104 | ||
105 | struct ocfs2_lock_res_ops; | 105 | struct ocfs2_lock_res_ops; |
106 | 106 | ||
@@ -120,13 +120,14 @@ struct ocfs2_lock_res { | |||
120 | int l_level; | 120 | int l_level; |
121 | unsigned int l_ro_holders; | 121 | unsigned int l_ro_holders; |
122 | unsigned int l_ex_holders; | 122 | unsigned int l_ex_holders; |
123 | struct dlm_lockstatus l_lksb; | 123 | union ocfs2_dlm_lksb l_lksb; |
124 | 124 | ||
125 | /* used from AST/BAST funcs. */ | 125 | /* used from AST/BAST funcs. */ |
126 | enum ocfs2_ast_action l_action; | 126 | enum ocfs2_ast_action l_action; |
127 | enum ocfs2_unlock_action l_unlock_action; | 127 | enum ocfs2_unlock_action l_unlock_action; |
128 | int l_requested; | 128 | int l_requested; |
129 | int l_blocking; | 129 | int l_blocking; |
130 | unsigned int l_pending_gen; | ||
130 | 131 | ||
131 | wait_queue_head_t l_event; | 132 | wait_queue_head_t l_event; |
132 | 133 | ||
@@ -179,6 +180,8 @@ enum ocfs2_mount_options | |||
179 | #define OCFS2_DEFAULT_ATIME_QUANTUM 60 | 180 | #define OCFS2_DEFAULT_ATIME_QUANTUM 60 |
180 | 181 | ||
181 | struct ocfs2_journal; | 182 | struct ocfs2_journal; |
183 | struct ocfs2_slot_info; | ||
184 | struct ocfs2_recovery_map; | ||
182 | struct ocfs2_super | 185 | struct ocfs2_super |
183 | { | 186 | { |
184 | struct task_struct *commit_task; | 187 | struct task_struct *commit_task; |
@@ -190,7 +193,6 @@ struct ocfs2_super | |||
190 | struct ocfs2_slot_info *slot_info; | 193 | struct ocfs2_slot_info *slot_info; |
191 | 194 | ||
192 | spinlock_t node_map_lock; | 195 | spinlock_t node_map_lock; |
193 | struct ocfs2_node_map recovery_map; | ||
194 | 196 | ||
195 | u64 root_blkno; | 197 | u64 root_blkno; |
196 | u64 system_dir_blkno; | 198 | u64 system_dir_blkno; |
@@ -206,25 +208,29 @@ struct ocfs2_super | |||
206 | u32 s_feature_incompat; | 208 | u32 s_feature_incompat; |
207 | u32 s_feature_ro_compat; | 209 | u32 s_feature_ro_compat; |
208 | 210 | ||
209 | /* Protects s_next_generaion, osb_flags. Could protect more on | 211 | /* Protects s_next_generation, osb_flags and s_inode_steal_slot. |
210 | * osb as it's very short lived. */ | 212 | * Could protect more on osb as it's very short lived. |
213 | */ | ||
211 | spinlock_t osb_lock; | 214 | spinlock_t osb_lock; |
212 | u32 s_next_generation; | 215 | u32 s_next_generation; |
213 | unsigned long osb_flags; | 216 | unsigned long osb_flags; |
217 | s16 s_inode_steal_slot; | ||
218 | atomic_t s_num_inodes_stolen; | ||
214 | 219 | ||
215 | unsigned long s_mount_opt; | 220 | unsigned long s_mount_opt; |
216 | unsigned int s_atime_quantum; | 221 | unsigned int s_atime_quantum; |
217 | 222 | ||
218 | u16 max_slots; | 223 | unsigned int max_slots; |
219 | s16 node_num; | 224 | unsigned int node_num; |
220 | s16 slot_num; | 225 | int slot_num; |
221 | s16 preferred_slot; | 226 | int preferred_slot; |
222 | int s_sectsize_bits; | 227 | int s_sectsize_bits; |
223 | int s_clustersize; | 228 | int s_clustersize; |
224 | int s_clustersize_bits; | 229 | int s_clustersize_bits; |
225 | 230 | ||
226 | atomic_t vol_state; | 231 | atomic_t vol_state; |
227 | struct mutex recovery_lock; | 232 | struct mutex recovery_lock; |
233 | struct ocfs2_recovery_map *recovery_map; | ||
228 | struct task_struct *recovery_thread_task; | 234 | struct task_struct *recovery_thread_task; |
229 | int disable_recovery; | 235 | int disable_recovery; |
230 | wait_queue_head_t checkpoint_event; | 236 | wait_queue_head_t checkpoint_event; |
@@ -245,12 +251,11 @@ struct ocfs2_super | |||
245 | struct ocfs2_alloc_stats alloc_stats; | 251 | struct ocfs2_alloc_stats alloc_stats; |
246 | char dev_str[20]; /* "major,minor" of the device */ | 252 | char dev_str[20]; /* "major,minor" of the device */ |
247 | 253 | ||
248 | struct dlm_ctxt *dlm; | 254 | char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1]; |
255 | struct ocfs2_cluster_connection *cconn; | ||
249 | struct ocfs2_lock_res osb_super_lockres; | 256 | struct ocfs2_lock_res osb_super_lockres; |
250 | struct ocfs2_lock_res osb_rename_lockres; | 257 | struct ocfs2_lock_res osb_rename_lockres; |
251 | struct dlm_eviction_cb osb_eviction_cb; | ||
252 | struct ocfs2_dlm_debug *osb_dlm_debug; | 258 | struct ocfs2_dlm_debug *osb_dlm_debug; |
253 | struct dlm_protocol_version osb_locking_proto; | ||
254 | 259 | ||
255 | struct dentry *osb_debug_root; | 260 | struct dentry *osb_debug_root; |
256 | 261 | ||
@@ -367,11 +372,24 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb) | |||
367 | return ret; | 372 | return ret; |
368 | } | 373 | } |
369 | 374 | ||
375 | static inline int ocfs2_userspace_stack(struct ocfs2_super *osb) | ||
376 | { | ||
377 | return (osb->s_feature_incompat & | ||
378 | OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK); | ||
379 | } | ||
380 | |||
370 | static inline int ocfs2_mount_local(struct ocfs2_super *osb) | 381 | static inline int ocfs2_mount_local(struct ocfs2_super *osb) |
371 | { | 382 | { |
372 | return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT); | 383 | return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT); |
373 | } | 384 | } |
374 | 385 | ||
386 | static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb) | ||
387 | { | ||
388 | return (osb->s_feature_incompat & | ||
389 | OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP); | ||
390 | } | ||
391 | |||
392 | |||
375 | #define OCFS2_IS_VALID_DINODE(ptr) \ | 393 | #define OCFS2_IS_VALID_DINODE(ptr) \ |
376 | (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE)) | 394 | (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE)) |
377 | 395 | ||
@@ -522,6 +540,33 @@ static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb) | |||
522 | return pages_per_cluster; | 540 | return pages_per_cluster; |
523 | } | 541 | } |
524 | 542 | ||
543 | static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb) | ||
544 | { | ||
545 | spin_lock(&osb->osb_lock); | ||
546 | osb->s_inode_steal_slot = OCFS2_INVALID_SLOT; | ||
547 | spin_unlock(&osb->osb_lock); | ||
548 | atomic_set(&osb->s_num_inodes_stolen, 0); | ||
549 | } | ||
550 | |||
551 | static inline void ocfs2_set_inode_steal_slot(struct ocfs2_super *osb, | ||
552 | s16 slot) | ||
553 | { | ||
554 | spin_lock(&osb->osb_lock); | ||
555 | osb->s_inode_steal_slot = slot; | ||
556 | spin_unlock(&osb->osb_lock); | ||
557 | } | ||
558 | |||
559 | static inline s16 ocfs2_get_inode_steal_slot(struct ocfs2_super *osb) | ||
560 | { | ||
561 | s16 slot; | ||
562 | |||
563 | spin_lock(&osb->osb_lock); | ||
564 | slot = osb->s_inode_steal_slot; | ||
565 | spin_unlock(&osb->osb_lock); | ||
566 | |||
567 | return slot; | ||
568 | } | ||
569 | |||
525 | #define ocfs2_set_bit ext2_set_bit | 570 | #define ocfs2_set_bit ext2_set_bit |
526 | #define ocfs2_clear_bit ext2_clear_bit | 571 | #define ocfs2_clear_bit ext2_clear_bit |
527 | #define ocfs2_test_bit ext2_test_bit | 572 | #define ocfs2_test_bit ext2_test_bit |