diff options
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 3fed9e3d8992..ad5c24a29edd 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,7 @@ enum ocfs2_mount_options | |||
205 | struct ocfs2_journal; | 209 | struct ocfs2_journal; |
206 | struct ocfs2_slot_info; | 210 | struct ocfs2_slot_info; |
207 | struct ocfs2_recovery_map; | 211 | struct ocfs2_recovery_map; |
212 | struct ocfs2_quota_recovery; | ||
208 | struct ocfs2_super | 213 | struct ocfs2_super |
209 | { | 214 | { |
210 | struct task_struct *commit_task; | 215 | struct task_struct *commit_task; |
@@ -286,10 +291,11 @@ struct ocfs2_super | |||
286 | char *local_alloc_debug_buf; | 291 | char *local_alloc_debug_buf; |
287 | #endif | 292 | #endif |
288 | 293 | ||
289 | /* Next two fields are for local node slot recovery during | 294 | /* Next three fields are for local node slot recovery during |
290 | * mount. */ | 295 | * mount. */ |
291 | int dirty; | 296 | int dirty; |
292 | struct ocfs2_dinode *local_alloc_copy; | 297 | struct ocfs2_dinode *local_alloc_copy; |
298 | struct ocfs2_quota_recovery *quota_rec; | ||
293 | 299 | ||
294 | struct ocfs2_alloc_stats alloc_stats; | 300 | struct ocfs2_alloc_stats alloc_stats; |
295 | char dev_str[20]; /* "major,minor" of the device */ | 301 | char dev_str[20]; /* "major,minor" of the device */ |
@@ -333,6 +339,10 @@ struct ocfs2_super | |||
333 | 339 | ||
334 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) | 340 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) |
335 | 341 | ||
342 | /* Useful typedef for passing around journal access functions */ | ||
343 | typedef int (*ocfs2_journal_access_func)(handle_t *handle, struct inode *inode, | ||
344 | struct buffer_head *bh, int type); | ||
345 | |||
336 | static inline int ocfs2_should_order_data(struct inode *inode) | 346 | static inline int ocfs2_should_order_data(struct inode *inode) |
337 | { | 347 | { |
338 | if (!S_ISREG(inode->i_mode)) | 348 | if (!S_ISREG(inode->i_mode)) |
@@ -376,6 +386,13 @@ static inline int ocfs2_supports_xattr(struct ocfs2_super *osb) | |||
376 | return 0; | 386 | return 0; |
377 | } | 387 | } |
378 | 388 | ||
389 | static inline int ocfs2_meta_ecc(struct ocfs2_super *osb) | ||
390 | { | ||
391 | if (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_META_ECC) | ||
392 | return 1; | ||
393 | return 0; | ||
394 | } | ||
395 | |||
379 | /* set / clear functions because cluster events can make these happen | 396 | /* set / clear functions because cluster events can make these happen |
380 | * in parallel so we want the transitions to be atomic. this also | 397 | * 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 | 398 | * means that any future flags osb_flags must be protected by spinlock |
@@ -443,39 +460,19 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb) | |||
443 | #define OCFS2_IS_VALID_DINODE(ptr) \ | 460 | #define OCFS2_IS_VALID_DINODE(ptr) \ |
444 | (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE)) | 461 | (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE)) |
445 | 462 | ||
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) \ | 463 | #define OCFS2_IS_VALID_EXTENT_BLOCK(ptr) \ |
455 | (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE)) | 464 | (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE)) |
456 | 465 | ||
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) \ | 466 | #define OCFS2_IS_VALID_GROUP_DESC(ptr) \ |
466 | (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE)) | 467 | (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE)) |
467 | 468 | ||
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 | 469 | ||
476 | #define OCFS2_IS_VALID_XATTR_BLOCK(ptr) \ | 470 | #define OCFS2_IS_VALID_XATTR_BLOCK(ptr) \ |
477 | (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE)) | 471 | (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE)) |
478 | 472 | ||
473 | #define OCFS2_IS_VALID_DIR_TRAILER(ptr) \ | ||
474 | (!strcmp((ptr)->db_signature, OCFS2_DIR_TRAILER_SIGNATURE)) | ||
475 | |||
479 | static inline unsigned long ino_from_blkno(struct super_block *sb, | 476 | static inline unsigned long ino_from_blkno(struct super_block *sb, |
480 | u64 blkno) | 477 | u64 blkno) |
481 | { | 478 | { |
@@ -632,5 +629,6 @@ static inline s16 ocfs2_get_inode_steal_slot(struct ocfs2_super *osb) | |||
632 | #define ocfs2_clear_bit ext2_clear_bit | 629 | #define ocfs2_clear_bit ext2_clear_bit |
633 | #define ocfs2_test_bit ext2_test_bit | 630 | #define ocfs2_test_bit ext2_test_bit |
634 | #define ocfs2_find_next_zero_bit ext2_find_next_zero_bit | 631 | #define ocfs2_find_next_zero_bit ext2_find_next_zero_bit |
632 | #define ocfs2_find_next_bit ext2_find_next_bit | ||
635 | #endif /* OCFS2_H */ | 633 | #endif /* OCFS2_H */ |
636 | 634 | ||