aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/ocfs2/ocfs2.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r--fs/ocfs2/ocfs2.h101
1 files changed, 75 insertions, 26 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index c67003b6b5a2..409285854f64 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -147,43 +147,55 @@ struct ocfs2_lock_res_ops;
147 147
148typedef void (*ocfs2_lock_callback)(int status, unsigned long data); 148typedef void (*ocfs2_lock_callback)(int status, unsigned long data);
149 149
150#ifdef CONFIG_OCFS2_FS_STATS
151struct ocfs2_lock_stats {
152 u64 ls_total; /* Total wait in NSEC */
153 u32 ls_gets; /* Num acquires */
154 u32 ls_fail; /* Num failed acquires */
155
156 /* Storing max wait in usecs saves 24 bytes per inode */
157 u32 ls_max; /* Max wait in USEC */
158};
159#endif
160
150struct ocfs2_lock_res { 161struct ocfs2_lock_res {
151 void *l_priv; 162 void *l_priv;
152 struct ocfs2_lock_res_ops *l_ops; 163 struct ocfs2_lock_res_ops *l_ops;
153 spinlock_t l_lock; 164
154 165
155 struct list_head l_blocked_list; 166 struct list_head l_blocked_list;
156 struct list_head l_mask_waiters; 167 struct list_head l_mask_waiters;
157 168
158 enum ocfs2_lock_type l_type;
159 unsigned long l_flags; 169 unsigned long l_flags;
160 char l_name[OCFS2_LOCK_ID_MAX_LEN]; 170 char l_name[OCFS2_LOCK_ID_MAX_LEN];
161 int l_level;
162 unsigned int l_ro_holders; 171 unsigned int l_ro_holders;
163 unsigned int l_ex_holders; 172 unsigned int l_ex_holders;
164 struct ocfs2_dlm_lksb l_lksb; 173 signed char l_level;
174 signed char l_requested;
175 signed char l_blocking;
176
177 /* Data packed - type enum ocfs2_lock_type */
178 unsigned char l_type;
165 179
166 /* used from AST/BAST funcs. */ 180 /* used from AST/BAST funcs. */
167 enum ocfs2_ast_action l_action; 181 /* Data packed - enum type ocfs2_ast_action */
168 enum ocfs2_unlock_action l_unlock_action; 182 unsigned char l_action;
169 int l_requested; 183 /* Data packed - enum type ocfs2_unlock_action */
170 int l_blocking; 184 unsigned char l_unlock_action;
171 unsigned int l_pending_gen; 185 unsigned int l_pending_gen;
172 186
187 spinlock_t l_lock;
188
189 struct ocfs2_dlm_lksb l_lksb;
190
173 wait_queue_head_t l_event; 191 wait_queue_head_t l_event;
174 192
175 struct list_head l_debug_list; 193 struct list_head l_debug_list;
176 194
177#ifdef CONFIG_OCFS2_FS_STATS 195#ifdef CONFIG_OCFS2_FS_STATS
178 unsigned long long l_lock_num_prmode; /* PR acquires */ 196 struct ocfs2_lock_stats l_lock_prmode; /* PR mode stats */
179 unsigned long long l_lock_num_exmode; /* EX acquires */ 197 u32 l_lock_refresh; /* Disk refreshes */
180 unsigned int l_lock_num_prmode_failed; /* Failed PR gets */ 198 struct ocfs2_lock_stats l_lock_exmode; /* EX mode stats */
181 unsigned int l_lock_num_exmode_failed; /* Failed EX gets */
182 unsigned long long l_lock_total_prmode; /* Tot wait for PR */
183 unsigned long long l_lock_total_exmode; /* Tot wait for EX */
184 unsigned int l_lock_max_prmode; /* Max wait for PR */
185 unsigned int l_lock_max_exmode; /* Max wait for EX */
186 unsigned int l_lock_refresh; /* Disk refreshes */
187#endif 199#endif
188#ifdef CONFIG_DEBUG_LOCK_ALLOC 200#ifdef CONFIG_DEBUG_LOCK_ALLOC
189 struct lockdep_map l_lockdep_map; 201 struct lockdep_map l_lockdep_map;
@@ -243,7 +255,7 @@ enum ocfs2_local_alloc_state
243 255
244enum ocfs2_mount_options 256enum ocfs2_mount_options
245{ 257{
246 OCFS2_MOUNT_HB_LOCAL = 1 << 0, /* Heartbeat started in local mode */ 258 OCFS2_MOUNT_HB_LOCAL = 1 << 0, /* Local heartbeat */
247 OCFS2_MOUNT_BARRIER = 1 << 1, /* Use block barriers */ 259 OCFS2_MOUNT_BARRIER = 1 << 1, /* Use block barriers */
248 OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */ 260 OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */
249 OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */ 261 OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
@@ -256,6 +268,10 @@ enum ocfs2_mount_options
256 control lists */ 268 control lists */
257 OCFS2_MOUNT_USRQUOTA = 1 << 10, /* We support user quotas */ 269 OCFS2_MOUNT_USRQUOTA = 1 << 10, /* We support user quotas */
258 OCFS2_MOUNT_GRPQUOTA = 1 << 11, /* We support group quotas */ 270 OCFS2_MOUNT_GRPQUOTA = 1 << 11, /* We support group quotas */
271 OCFS2_MOUNT_COHERENCY_BUFFERED = 1 << 12, /* Allow concurrent O_DIRECT
272 writes */
273 OCFS2_MOUNT_HB_NONE = 1 << 13, /* No heartbeat */
274 OCFS2_MOUNT_HB_GLOBAL = 1 << 14, /* Global heartbeat */
259}; 275};
260 276
261#define OCFS2_OSB_SOFT_RO 0x0001 277#define OCFS2_OSB_SOFT_RO 0x0001
@@ -277,7 +293,8 @@ struct ocfs2_super
277 struct super_block *sb; 293 struct super_block *sb;
278 struct inode *root_inode; 294 struct inode *root_inode;
279 struct inode *sys_root_inode; 295 struct inode *sys_root_inode;
280 struct inode *system_inodes[NUM_SYSTEM_INODES]; 296 struct inode *global_system_inodes[NUM_GLOBAL_SYSTEM_INODES];
297 struct inode **local_system_inodes;
281 298
282 struct ocfs2_slot_info *slot_info; 299 struct ocfs2_slot_info *slot_info;
283 300
@@ -368,6 +385,8 @@ struct ocfs2_super
368 struct ocfs2_alloc_stats alloc_stats; 385 struct ocfs2_alloc_stats alloc_stats;
369 char dev_str[20]; /* "major,minor" of the device */ 386 char dev_str[20]; /* "major,minor" of the device */
370 387
388 u8 osb_stackflags;
389
371 char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1]; 390 char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1];
372 struct ocfs2_cluster_connection *cconn; 391 struct ocfs2_cluster_connection *cconn;
373 struct ocfs2_lock_res osb_super_lockres; 392 struct ocfs2_lock_res osb_super_lockres;
@@ -406,6 +425,11 @@ struct ocfs2_super
406 struct inode *osb_tl_inode; 425 struct inode *osb_tl_inode;
407 struct buffer_head *osb_tl_bh; 426 struct buffer_head *osb_tl_bh;
408 struct delayed_work osb_truncate_log_wq; 427 struct delayed_work osb_truncate_log_wq;
428 /*
429 * How many clusters in our truncate log.
430 * It must be protected by osb_tl_inode->i_mutex.
431 */
432 unsigned int truncated_clusters;
409 433
410 struct ocfs2_node_map osb_recovering_orphan_dirs; 434 struct ocfs2_node_map osb_recovering_orphan_dirs;
411 unsigned int *osb_orphan_wipes; 435 unsigned int *osb_orphan_wipes;
@@ -601,10 +625,35 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb)
601 return ret; 625 return ret;
602} 626}
603 627
604static inline int ocfs2_userspace_stack(struct ocfs2_super *osb) 628static inline int ocfs2_clusterinfo_valid(struct ocfs2_super *osb)
605{ 629{
606 return (osb->s_feature_incompat & 630 return (osb->s_feature_incompat &
607 OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK); 631 (OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK |
632 OCFS2_FEATURE_INCOMPAT_CLUSTERINFO));
633}
634
635static inline int ocfs2_userspace_stack(struct ocfs2_super *osb)
636{
637 if (ocfs2_clusterinfo_valid(osb) &&
638 memcmp(osb->osb_cluster_stack, OCFS2_CLASSIC_CLUSTER_STACK,
639 OCFS2_STACK_LABEL_LEN))
640 return 1;
641 return 0;
642}
643
644static inline int ocfs2_o2cb_stack(struct ocfs2_super *osb)
645{
646 if (ocfs2_clusterinfo_valid(osb) &&
647 !memcmp(osb->osb_cluster_stack, OCFS2_CLASSIC_CLUSTER_STACK,
648 OCFS2_STACK_LABEL_LEN))
649 return 1;
650 return 0;
651}
652
653static inline int ocfs2_cluster_o2cb_global_heartbeat(struct ocfs2_super *osb)
654{
655 return ocfs2_o2cb_stack(osb) &&
656 (osb->osb_stackflags & OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT);
608} 657}
609 658
610static inline int ocfs2_mount_local(struct ocfs2_super *osb) 659static inline int ocfs2_mount_local(struct ocfs2_super *osb)
@@ -787,18 +836,18 @@ static inline unsigned int ocfs2_clusters_to_megabytes(struct super_block *sb,
787 836
788static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) 837static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap)
789{ 838{
790 ext2_set_bit(bit, bitmap); 839 __test_and_set_bit_le(bit, bitmap);
791} 840}
792#define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr)) 841#define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr))
793 842
794static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap) 843static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap)
795{ 844{
796 ext2_clear_bit(bit, bitmap); 845 __test_and_clear_bit_le(bit, bitmap);
797} 846}
798#define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr)) 847#define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr))
799 848
800#define ocfs2_test_bit ext2_test_bit 849#define ocfs2_test_bit test_bit_le
801#define ocfs2_find_next_zero_bit ext2_find_next_zero_bit 850#define ocfs2_find_next_zero_bit find_next_zero_bit_le
802#define ocfs2_find_next_bit ext2_find_next_bit 851#define ocfs2_find_next_bit find_next_bit_le
803#endif /* OCFS2_H */ 852#endif /* OCFS2_H */
804 853