aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r--fs/ocfs2/ocfs2.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 3fed9e3d8992..077384135f4e 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -161,6 +161,7 @@ enum ocfs2_vol_state
161{ 161{
162 VOLUME_INIT = 0, 162 VOLUME_INIT = 0,
163 VOLUME_MOUNTED, 163 VOLUME_MOUNTED,
164 VOLUME_MOUNTED_QUOTAS,
164 VOLUME_DISMOUNTED, 165 VOLUME_DISMOUNTED,
165 VOLUME_DISABLED 166 VOLUME_DISABLED
166}; 167};
@@ -195,6 +196,9 @@ enum ocfs2_mount_options
195 OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ 196 OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
196 OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */ 197 OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */
197 OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */ 198 OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */
199 OCFS2_MOUNT_POSIX_ACL = 1 << 8, /* POSIX access control lists */
200 OCFS2_MOUNT_USRQUOTA = 1 << 9, /* We support user quotas */
201 OCFS2_MOUNT_GRPQUOTA = 1 << 10, /* We support group quotas */
198}; 202};
199 203
200#define OCFS2_OSB_SOFT_RO 0x0001 204#define OCFS2_OSB_SOFT_RO 0x0001
@@ -205,6 +209,8 @@ enum ocfs2_mount_options
205struct ocfs2_journal; 209struct ocfs2_journal;
206struct ocfs2_slot_info; 210struct ocfs2_slot_info;
207struct ocfs2_recovery_map; 211struct ocfs2_recovery_map;
212struct ocfs2_quota_recovery;
213struct ocfs2_dentry_lock;
208struct ocfs2_super 214struct ocfs2_super
209{ 215{
210 struct task_struct *commit_task; 216 struct task_struct *commit_task;
@@ -286,10 +292,11 @@ struct ocfs2_super
286 char *local_alloc_debug_buf; 292 char *local_alloc_debug_buf;
287#endif 293#endif
288 294
289 /* Next two fields are for local node slot recovery during 295 /* Next three fields are for local node slot recovery during
290 * mount. */ 296 * mount. */
291 int dirty; 297 int dirty;
292 struct ocfs2_dinode *local_alloc_copy; 298 struct ocfs2_dinode *local_alloc_copy;
299 struct ocfs2_quota_recovery *quota_rec;
293 300
294 struct ocfs2_alloc_stats alloc_stats; 301 struct ocfs2_alloc_stats alloc_stats;
295 char dev_str[20]; /* "major,minor" of the device */ 302 char dev_str[20]; /* "major,minor" of the device */
@@ -319,6 +326,11 @@ struct ocfs2_super
319 struct list_head blocked_lock_list; 326 struct list_head blocked_lock_list;
320 unsigned long blocked_lock_count; 327 unsigned long blocked_lock_count;
321 328
329 /* List of dentry locks to release. Anyone can add locks to
330 * the list, ocfs2_wq processes the list */
331 struct ocfs2_dentry_lock *dentry_lock_list;
332 struct work_struct dentry_lock_work;
333
322 wait_queue_head_t osb_mount_event; 334 wait_queue_head_t osb_mount_event;
323 335
324 /* Truncate log info */ 336 /* Truncate log info */
@@ -333,6 +345,10 @@ struct ocfs2_super
333 345
334#define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) 346#define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info)
335 347
348/* Useful typedef for passing around journal access functions */
349typedef int (*ocfs2_journal_access_func)(handle_t *handle, struct inode *inode,
350 struct buffer_head *bh, int type);
351
336static inline int ocfs2_should_order_data(struct inode *inode) 352static inline int ocfs2_should_order_data(struct inode *inode)
337{ 353{
338 if (!S_ISREG(inode->i_mode)) 354 if (!S_ISREG(inode->i_mode))
@@ -376,6 +392,13 @@ static inline int ocfs2_supports_xattr(struct ocfs2_super *osb)
376 return 0; 392 return 0;
377} 393}
378 394
395static inline int ocfs2_meta_ecc(struct ocfs2_super *osb)
396{
397 if (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_META_ECC)
398 return 1;
399 return 0;
400}
401
379/* set / clear functions because cluster events can make these happen 402/* set / clear functions because cluster events can make these happen
380 * in parallel so we want the transitions to be atomic. this also 403 * in parallel so we want the transitions to be atomic. this also
381 * means that any future flags osb_flags must be protected by spinlock 404 * means that any future flags osb_flags must be protected by spinlock
@@ -443,39 +466,19 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
443#define OCFS2_IS_VALID_DINODE(ptr) \ 466#define OCFS2_IS_VALID_DINODE(ptr) \
444 (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE)) 467 (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE))
445 468
446#define OCFS2_RO_ON_INVALID_DINODE(__sb, __di) do { \
447 typeof(__di) ____di = (__di); \
448 ocfs2_error((__sb), \
449 "Dinode # %llu has bad signature %.*s", \
450 (unsigned long long)le64_to_cpu((____di)->i_blkno), 7, \
451 (____di)->i_signature); \
452} while (0)
453
454#define OCFS2_IS_VALID_EXTENT_BLOCK(ptr) \ 469#define OCFS2_IS_VALID_EXTENT_BLOCK(ptr) \
455 (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE)) 470 (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE))
456 471
457#define OCFS2_RO_ON_INVALID_EXTENT_BLOCK(__sb, __eb) do { \
458 typeof(__eb) ____eb = (__eb); \
459 ocfs2_error((__sb), \
460 "Extent Block # %llu has bad signature %.*s", \
461 (unsigned long long)le64_to_cpu((____eb)->h_blkno), 7, \
462 (____eb)->h_signature); \
463} while (0)
464
465#define OCFS2_IS_VALID_GROUP_DESC(ptr) \ 472#define OCFS2_IS_VALID_GROUP_DESC(ptr) \
466 (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE)) 473 (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE))
467 474
468#define OCFS2_RO_ON_INVALID_GROUP_DESC(__sb, __gd) do { \
469 typeof(__gd) ____gd = (__gd); \
470 ocfs2_error((__sb), \
471 "Group Descriptor # %llu has bad signature %.*s", \
472 (unsigned long long)le64_to_cpu((____gd)->bg_blkno), 7, \
473 (____gd)->bg_signature); \
474} while (0)
475 475
476#define OCFS2_IS_VALID_XATTR_BLOCK(ptr) \ 476#define OCFS2_IS_VALID_XATTR_BLOCK(ptr) \
477 (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE)) 477 (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE))
478 478
479#define OCFS2_IS_VALID_DIR_TRAILER(ptr) \
480 (!strcmp((ptr)->db_signature, OCFS2_DIR_TRAILER_SIGNATURE))
481
479static inline unsigned long ino_from_blkno(struct super_block *sb, 482static inline unsigned long ino_from_blkno(struct super_block *sb,
480 u64 blkno) 483 u64 blkno)
481{ 484{
@@ -632,5 +635,6 @@ static inline s16 ocfs2_get_inode_steal_slot(struct ocfs2_super *osb)
632#define ocfs2_clear_bit ext2_clear_bit 635#define ocfs2_clear_bit ext2_clear_bit
633#define ocfs2_test_bit ext2_test_bit 636#define ocfs2_test_bit ext2_test_bit
634#define ocfs2_find_next_zero_bit ext2_find_next_zero_bit 637#define ocfs2_find_next_zero_bit ext2_find_next_zero_bit
638#define ocfs2_find_next_bit ext2_find_next_bit
635#endif /* OCFS2_H */ 639#endif /* OCFS2_H */
636 640