diff options
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
| -rw-r--r-- | fs/ocfs2/ocfs2.h | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 7f625f2b1117..a21a465490c4 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
| @@ -34,7 +34,12 @@ | |||
| 34 | #include <linux/workqueue.h> | 34 | #include <linux/workqueue.h> |
| 35 | #include <linux/kref.h> | 35 | #include <linux/kref.h> |
| 36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
| 37 | #include <linux/jbd.h> | 37 | #ifndef CONFIG_OCFS2_COMPAT_JBD |
| 38 | # include <linux/jbd2.h> | ||
| 39 | #else | ||
| 40 | # include <linux/jbd.h> | ||
| 41 | # include "ocfs2_jbd_compat.h" | ||
| 42 | #endif | ||
| 38 | 43 | ||
| 39 | /* For union ocfs2_dlm_lksb */ | 44 | /* For union ocfs2_dlm_lksb */ |
| 40 | #include "stackglue.h" | 45 | #include "stackglue.h" |
| @@ -171,9 +176,13 @@ struct ocfs2_alloc_stats | |||
| 171 | 176 | ||
| 172 | enum ocfs2_local_alloc_state | 177 | enum ocfs2_local_alloc_state |
| 173 | { | 178 | { |
| 174 | OCFS2_LA_UNUSED = 0, | 179 | OCFS2_LA_UNUSED = 0, /* Local alloc will never be used for |
| 175 | OCFS2_LA_ENABLED, | 180 | * this mountpoint. */ |
| 176 | OCFS2_LA_DISABLED | 181 | OCFS2_LA_ENABLED, /* Local alloc is in use. */ |
| 182 | OCFS2_LA_THROTTLED, /* Local alloc is in use, but number | ||
| 183 | * of bits has been reduced. */ | ||
| 184 | OCFS2_LA_DISABLED /* Local alloc has temporarily been | ||
| 185 | * disabled. */ | ||
| 177 | }; | 186 | }; |
| 178 | 187 | ||
| 179 | enum ocfs2_mount_options | 188 | enum ocfs2_mount_options |
| @@ -184,6 +193,8 @@ enum ocfs2_mount_options | |||
| 184 | OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */ | 193 | OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */ |
| 185 | OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ | 194 | OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ |
| 186 | OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ | 195 | OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ |
| 196 | OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */ | ||
| 197 | OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */ | ||
| 187 | }; | 198 | }; |
| 188 | 199 | ||
| 189 | #define OCFS2_OSB_SOFT_RO 0x0001 | 200 | #define OCFS2_OSB_SOFT_RO 0x0001 |
| @@ -214,6 +225,7 @@ struct ocfs2_super | |||
| 214 | u32 bitmap_cpg; | 225 | u32 bitmap_cpg; |
| 215 | u8 *uuid; | 226 | u8 *uuid; |
| 216 | char *uuid_str; | 227 | char *uuid_str; |
| 228 | u32 uuid_hash; | ||
| 217 | u8 *vol_label; | 229 | u8 *vol_label; |
| 218 | u64 first_cluster_group_blkno; | 230 | u64 first_cluster_group_blkno; |
| 219 | u32 fs_generation; | 231 | u32 fs_generation; |
| @@ -241,6 +253,7 @@ struct ocfs2_super | |||
| 241 | int s_sectsize_bits; | 253 | int s_sectsize_bits; |
| 242 | int s_clustersize; | 254 | int s_clustersize; |
| 243 | int s_clustersize_bits; | 255 | int s_clustersize_bits; |
| 256 | unsigned int s_xattr_inline_size; | ||
| 244 | 257 | ||
| 245 | atomic_t vol_state; | 258 | atomic_t vol_state; |
| 246 | struct mutex recovery_lock; | 259 | struct mutex recovery_lock; |
| @@ -252,11 +265,27 @@ struct ocfs2_super | |||
| 252 | struct ocfs2_journal *journal; | 265 | struct ocfs2_journal *journal; |
| 253 | unsigned long osb_commit_interval; | 266 | unsigned long osb_commit_interval; |
| 254 | 267 | ||
| 255 | int local_alloc_size; | 268 | struct delayed_work la_enable_wq; |
| 256 | enum ocfs2_local_alloc_state local_alloc_state; | 269 | |
| 270 | /* | ||
| 271 | * Must hold local alloc i_mutex and osb->osb_lock to change | ||
| 272 | * local_alloc_bits. Reads can be done under either lock. | ||
| 273 | */ | ||
| 274 | unsigned int local_alloc_bits; | ||
| 275 | unsigned int local_alloc_default_bits; | ||
| 276 | |||
| 277 | enum ocfs2_local_alloc_state local_alloc_state; /* protected | ||
| 278 | * by osb_lock */ | ||
| 279 | |||
| 257 | struct buffer_head *local_alloc_bh; | 280 | struct buffer_head *local_alloc_bh; |
| 281 | |||
| 258 | u64 la_last_gd; | 282 | u64 la_last_gd; |
| 259 | 283 | ||
| 284 | #ifdef CONFIG_OCFS2_FS_STATS | ||
| 285 | struct dentry *local_alloc_debug; | ||
| 286 | char *local_alloc_debug_buf; | ||
| 287 | #endif | ||
| 288 | |||
| 260 | /* Next two fields are for local node slot recovery during | 289 | /* Next two fields are for local node slot recovery during |
| 261 | * mount. */ | 290 | * mount. */ |
| 262 | int dirty; | 291 | int dirty; |
| @@ -340,6 +369,13 @@ static inline int ocfs2_supports_inline_data(struct ocfs2_super *osb) | |||
| 340 | return 0; | 369 | return 0; |
| 341 | } | 370 | } |
| 342 | 371 | ||
| 372 | static inline int ocfs2_supports_xattr(struct ocfs2_super *osb) | ||
| 373 | { | ||
| 374 | if (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR) | ||
| 375 | return 1; | ||
| 376 | return 0; | ||
| 377 | } | ||
| 378 | |||
| 343 | /* set / clear functions because cluster events can make these happen | 379 | /* set / clear functions because cluster events can make these happen |
| 344 | * in parallel so we want the transitions to be atomic. this also | 380 | * in parallel so we want the transitions to be atomic. this also |
| 345 | * means that any future flags osb_flags must be protected by spinlock | 381 | * means that any future flags osb_flags must be protected by spinlock |
| @@ -554,6 +590,14 @@ static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb) | |||
| 554 | return pages_per_cluster; | 590 | return pages_per_cluster; |
| 555 | } | 591 | } |
| 556 | 592 | ||
| 593 | static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb, | ||
| 594 | unsigned int megs) | ||
| 595 | { | ||
| 596 | BUILD_BUG_ON(OCFS2_MAX_CLUSTERSIZE > 1048576); | ||
| 597 | |||
| 598 | return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); | ||
| 599 | } | ||
| 600 | |||
| 557 | static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb) | 601 | static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb) |
| 558 | { | 602 | { |
| 559 | spin_lock(&osb->osb_lock); | 603 | spin_lock(&osb->osb_lock); |
