0001
0002
0003
0004
0005
0006
0007 #ifndef __INCORE_DOT_H__
0008 #define __INCORE_DOT_H__
0009
0010 #include <linux/fs.h>
0011 #include <linux/kobject.h>
0012 #include <linux/workqueue.h>
0013 #include <linux/dlm.h>
0014 #include <linux/buffer_head.h>
0015 #include <linux/rcupdate.h>
0016 #include <linux/rculist_bl.h>
0017 #include <linux/completion.h>
0018 #include <linux/rbtree.h>
0019 #include <linux/ktime.h>
0020 #include <linux/percpu.h>
0021 #include <linux/lockref.h>
0022 #include <linux/rhashtable.h>
0023 #include <linux/mutex.h>
0024
0025 #define DIO_WAIT 0x00000010
0026 #define DIO_METADATA 0x00000020
0027
0028 struct gfs2_log_operations;
0029 struct gfs2_bufdata;
0030 struct gfs2_holder;
0031 struct gfs2_glock;
0032 struct gfs2_quota_data;
0033 struct gfs2_trans;
0034 struct gfs2_jdesc;
0035 struct gfs2_sbd;
0036 struct lm_lockops;
0037
0038 typedef void (*gfs2_glop_bh_t) (struct gfs2_glock *gl, unsigned int ret);
0039
0040 struct gfs2_log_header_host {
0041 u64 lh_sequence;
0042 u32 lh_flags;
0043 u32 lh_tail;
0044 u32 lh_blkno;
0045
0046 s64 lh_local_total;
0047 s64 lh_local_free;
0048 s64 lh_local_dinodes;
0049 };
0050
0051
0052
0053
0054
0055
0056 struct gfs2_log_operations {
0057 void (*lo_before_commit) (struct gfs2_sbd *sdp, struct gfs2_trans *tr);
0058 void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_trans *tr);
0059 void (*lo_before_scan) (struct gfs2_jdesc *jd,
0060 struct gfs2_log_header_host *head, int pass);
0061 int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start,
0062 struct gfs2_log_descriptor *ld, __be64 *ptr,
0063 int pass);
0064 void (*lo_after_scan) (struct gfs2_jdesc *jd, int error, int pass);
0065 const char *lo_name;
0066 };
0067
0068 #define GBF_FULL 1
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091 struct gfs2_bitmap {
0092 struct buffer_head *bi_bh;
0093 char *bi_clone;
0094 unsigned long bi_flags;
0095 u32 bi_offset;
0096 u32 bi_start;
0097 u32 bi_bytes;
0098 u32 bi_blocks;
0099 };
0100
0101 struct gfs2_rgrpd {
0102 struct rb_node rd_node;
0103 struct gfs2_glock *rd_gl;
0104 u64 rd_addr;
0105 u64 rd_data0;
0106 u32 rd_length;
0107 u32 rd_data;
0108 u32 rd_bitbytes;
0109 u32 rd_free;
0110 u32 rd_requested;
0111 u32 rd_reserved;
0112 u32 rd_free_clone;
0113 u32 rd_dinodes;
0114 u64 rd_igeneration;
0115 struct gfs2_bitmap *rd_bits;
0116 struct gfs2_sbd *rd_sbd;
0117 struct gfs2_rgrp_lvb *rd_rgl;
0118 u32 rd_last_alloc;
0119 u32 rd_flags;
0120 u32 rd_extfail_pt;
0121 #define GFS2_RDF_CHECK 0x10000000
0122 #define GFS2_RDF_ERROR 0x40000000
0123 #define GFS2_RDF_PREFERRED 0x80000000
0124 #define GFS2_RDF_MASK 0xf0000000
0125 spinlock_t rd_rsspin;
0126 struct mutex rd_mutex;
0127 struct rb_root rd_rstree;
0128 };
0129
0130 enum gfs2_state_bits {
0131 BH_Pinned = BH_PrivateStart,
0132 BH_Escaped = BH_PrivateStart + 1,
0133 };
0134
0135 BUFFER_FNS(Pinned, pinned)
0136 TAS_BUFFER_FNS(Pinned, pinned)
0137 BUFFER_FNS(Escaped, escaped)
0138 TAS_BUFFER_FNS(Escaped, escaped)
0139
0140 struct gfs2_bufdata {
0141 struct buffer_head *bd_bh;
0142 struct gfs2_glock *bd_gl;
0143 u64 bd_blkno;
0144
0145 struct list_head bd_list;
0146
0147 struct gfs2_trans *bd_tr;
0148 struct list_head bd_ail_st_list;
0149 struct list_head bd_ail_gl_list;
0150 };
0151
0152
0153
0154
0155
0156
0157 #define GDLM_STRNAME_BYTES 25
0158 #define GDLM_LVB_SIZE 32
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191 enum {
0192 DFL_BLOCK_LOCKS = 0,
0193 DFL_NO_DLM_OPS = 1,
0194 DFL_FIRST_MOUNT = 2,
0195 DFL_FIRST_MOUNT_DONE = 3,
0196 DFL_MOUNT_DONE = 4,
0197 DFL_UNMOUNT = 5,
0198 DFL_DLM_RECOVERY = 6,
0199 };
0200
0201
0202
0203
0204
0205 struct lm_lockname {
0206 u64 ln_number;
0207 struct gfs2_sbd *ln_sbd;
0208 unsigned int ln_type;
0209 };
0210
0211 #define lm_name_equal(name1, name2) \
0212 (((name1)->ln_number == (name2)->ln_number) && \
0213 ((name1)->ln_type == (name2)->ln_type) && \
0214 ((name1)->ln_sbd == (name2)->ln_sbd))
0215
0216
0217 struct gfs2_glock_operations {
0218 int (*go_sync) (struct gfs2_glock *gl);
0219 int (*go_xmote_bh)(struct gfs2_glock *gl);
0220 void (*go_inval) (struct gfs2_glock *gl, int flags);
0221 int (*go_demote_ok) (const struct gfs2_glock *gl);
0222 int (*go_instantiate) (struct gfs2_glock *gl);
0223 int (*go_held)(struct gfs2_holder *gh);
0224 void (*go_dump)(struct seq_file *seq, struct gfs2_glock *gl,
0225 const char *fs_id_buf);
0226 void (*go_callback)(struct gfs2_glock *gl, bool remote);
0227 void (*go_free)(struct gfs2_glock *gl);
0228 const int go_subclass;
0229 const int go_type;
0230 const unsigned long go_flags;
0231 #define GLOF_ASPACE 1
0232 #define GLOF_LVB 2
0233 #define GLOF_LRU 4
0234 #define GLOF_NONDISK 8
0235 };
0236
0237 enum {
0238 GFS2_LKS_SRTT = 0,
0239 GFS2_LKS_SRTTVAR = 1,
0240 GFS2_LKS_SRTTB = 2,
0241 GFS2_LKS_SRTTVARB = 3,
0242 GFS2_LKS_SIRT = 4,
0243 GFS2_LKS_SIRTVAR = 5,
0244 GFS2_LKS_DCOUNT = 6,
0245 GFS2_LKS_QCOUNT = 7,
0246 GFS2_NR_LKSTATS
0247 };
0248
0249 struct gfs2_lkstats {
0250 u64 stats[GFS2_NR_LKSTATS];
0251 };
0252
0253 enum {
0254
0255 HIF_MAY_DEMOTE = 1,
0256 HIF_HOLDER = 6,
0257 HIF_WAIT = 10,
0258 };
0259
0260 struct gfs2_holder {
0261 struct list_head gh_list;
0262
0263 struct gfs2_glock *gh_gl;
0264 struct pid *gh_owner_pid;
0265 u16 gh_flags;
0266 u16 gh_state;
0267
0268 int gh_error;
0269 unsigned long gh_iflags;
0270 unsigned long gh_ip;
0271 };
0272
0273
0274 #define GFS2_MAXQUOTAS 2
0275
0276 struct gfs2_qadata {
0277
0278 struct gfs2_quota_data *qa_qd[2 * GFS2_MAXQUOTAS];
0279 struct gfs2_holder qa_qd_ghs[2 * GFS2_MAXQUOTAS];
0280 unsigned int qa_qd_num;
0281 int qa_ref;
0282 };
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293 struct gfs2_blkreserv {
0294 struct rb_node rs_node;
0295 struct gfs2_rgrpd *rs_rgd;
0296 u64 rs_start;
0297 u32 rs_requested;
0298 u32 rs_reserved;
0299 };
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310 struct gfs2_alloc_parms {
0311 u64 target;
0312 u32 min_target;
0313 u32 aflags;
0314 u64 allowed;
0315 };
0316
0317 enum {
0318 GLF_LOCK = 1,
0319 GLF_INSTANTIATE_NEEDED = 2,
0320 GLF_DEMOTE = 3,
0321 GLF_PENDING_DEMOTE = 4,
0322 GLF_DEMOTE_IN_PROGRESS = 5,
0323 GLF_DIRTY = 6,
0324 GLF_LFLUSH = 7,
0325 GLF_INVALIDATE_IN_PROGRESS = 8,
0326 GLF_REPLY_PENDING = 9,
0327 GLF_INITIAL = 10,
0328 GLF_FROZEN = 11,
0329 GLF_INSTANTIATE_IN_PROG = 12,
0330 GLF_LRU = 13,
0331 GLF_OBJECT = 14,
0332 GLF_BLOCKING = 15,
0333 GLF_PENDING_DELETE = 17,
0334 GLF_FREEING = 18,
0335 };
0336
0337 struct gfs2_glock {
0338 unsigned long gl_flags;
0339 struct lm_lockname gl_name;
0340
0341 struct lockref gl_lockref;
0342
0343
0344 unsigned int gl_state:2,
0345 gl_target:2,
0346 gl_demote_state:2,
0347 gl_req:2,
0348 gl_reply:8;
0349
0350 unsigned long gl_demote_time;
0351 long gl_hold_time;
0352 struct list_head gl_holders;
0353
0354 const struct gfs2_glock_operations *gl_ops;
0355 ktime_t gl_dstamp;
0356 struct gfs2_lkstats gl_stats;
0357 struct dlm_lksb gl_lksb;
0358 unsigned long gl_tchange;
0359 void *gl_object;
0360
0361 struct list_head gl_lru;
0362 struct list_head gl_ail_list;
0363 atomic_t gl_ail_count;
0364 atomic_t gl_revokes;
0365 struct delayed_work gl_work;
0366
0367 struct {
0368 struct delayed_work gl_delete;
0369 u64 gl_no_formal_ino;
0370 };
0371 struct rcu_head gl_rcu;
0372 struct rhash_head gl_node;
0373 };
0374
0375 enum {
0376 GIF_QD_LOCKED = 1,
0377 GIF_ALLOC_FAILED = 2,
0378 GIF_SW_PAGED = 3,
0379 GIF_FREE_VFS_INODE = 5,
0380 GIF_GLOP_PENDING = 6,
0381 GIF_DEFERRED_DELETE = 7,
0382 };
0383
0384 struct gfs2_inode {
0385 struct inode i_inode;
0386 u64 i_no_addr;
0387 u64 i_no_formal_ino;
0388 u64 i_generation;
0389 u64 i_eattr;
0390 unsigned long i_flags;
0391 struct gfs2_glock *i_gl;
0392 struct gfs2_holder i_iopen_gh;
0393 struct gfs2_qadata *i_qadata;
0394 struct gfs2_holder i_rgd_gh;
0395 struct gfs2_blkreserv i_res;
0396 u64 i_goal;
0397 atomic_t i_sizehint;
0398 struct rw_semaphore i_rw_mutex;
0399 struct list_head i_ordered;
0400 __be64 *i_hash_cache;
0401 u32 i_entries;
0402 u32 i_diskflags;
0403 u8 i_height;
0404 u8 i_depth;
0405 u16 i_rahead;
0406 };
0407
0408
0409
0410
0411
0412 static inline struct gfs2_inode *GFS2_I(struct inode *inode)
0413 {
0414 return container_of(inode, struct gfs2_inode, i_inode);
0415 }
0416
0417 static inline struct gfs2_sbd *GFS2_SB(const struct inode *inode)
0418 {
0419 return inode->i_sb->s_fs_info;
0420 }
0421
0422 struct gfs2_file {
0423 struct mutex f_fl_mutex;
0424 struct gfs2_holder f_fl_gh;
0425 };
0426
0427 struct gfs2_revoke_replay {
0428 struct list_head rr_list;
0429 u64 rr_blkno;
0430 unsigned int rr_where;
0431 };
0432
0433 enum {
0434 QDF_CHANGE = 1,
0435 QDF_LOCKED = 2,
0436 QDF_REFRESH = 3,
0437 QDF_QMSG_QUIET = 4,
0438 };
0439
0440 struct gfs2_quota_data {
0441 struct hlist_bl_node qd_hlist;
0442 struct list_head qd_list;
0443 struct kqid qd_id;
0444 struct gfs2_sbd *qd_sbd;
0445 struct lockref qd_lockref;
0446 struct list_head qd_lru;
0447 unsigned qd_hash;
0448
0449 unsigned long qd_flags;
0450
0451 s64 qd_change;
0452 s64 qd_change_sync;
0453
0454 unsigned int qd_slot;
0455 unsigned int qd_slot_count;
0456
0457 struct buffer_head *qd_bh;
0458 struct gfs2_quota_change *qd_bh_qc;
0459 unsigned int qd_bh_count;
0460
0461 struct gfs2_glock *qd_gl;
0462 struct gfs2_quota_lvb qd_qb;
0463
0464 u64 qd_sync_gen;
0465 unsigned long qd_last_warn;
0466 struct rcu_head qd_rcu;
0467 };
0468
0469 enum {
0470 TR_TOUCHED = 1,
0471 TR_ATTACHED = 2,
0472 TR_ONSTACK = 3,
0473 };
0474
0475 struct gfs2_trans {
0476 unsigned long tr_ip;
0477
0478 unsigned int tr_blocks;
0479 unsigned int tr_revokes;
0480 unsigned int tr_reserved;
0481 unsigned long tr_flags;
0482
0483 unsigned int tr_num_buf_new;
0484 unsigned int tr_num_databuf_new;
0485 unsigned int tr_num_buf_rm;
0486 unsigned int tr_num_databuf_rm;
0487 unsigned int tr_num_revoke;
0488
0489 struct list_head tr_list;
0490 struct list_head tr_databuf;
0491 struct list_head tr_buf;
0492
0493 unsigned int tr_first;
0494 struct list_head tr_ail1_list;
0495 struct list_head tr_ail2_list;
0496 };
0497
0498 struct gfs2_journal_extent {
0499 struct list_head list;
0500
0501 unsigned int lblock;
0502 u64 dblock;
0503 u64 blocks;
0504 };
0505
0506 struct gfs2_jdesc {
0507 struct list_head jd_list;
0508 struct list_head extent_list;
0509 unsigned int nr_extents;
0510 struct work_struct jd_work;
0511 struct inode *jd_inode;
0512 struct bio *jd_log_bio;
0513 unsigned long jd_flags;
0514 #define JDF_RECOVERY 1
0515 unsigned int jd_jid;
0516 u32 jd_blocks;
0517 int jd_recover_error;
0518
0519
0520 unsigned int jd_found_blocks;
0521 unsigned int jd_found_revokes;
0522 unsigned int jd_replayed_blocks;
0523
0524 struct list_head jd_revoke_list;
0525 unsigned int jd_replay_tail;
0526
0527 u64 jd_no_addr;
0528 };
0529
0530 struct gfs2_statfs_change_host {
0531 s64 sc_total;
0532 s64 sc_free;
0533 s64 sc_dinodes;
0534 };
0535
0536 #define GFS2_QUOTA_DEFAULT GFS2_QUOTA_OFF
0537 #define GFS2_QUOTA_OFF 0
0538 #define GFS2_QUOTA_ACCOUNT 1
0539 #define GFS2_QUOTA_ON 2
0540
0541 #define GFS2_DATA_DEFAULT GFS2_DATA_ORDERED
0542 #define GFS2_DATA_WRITEBACK 1
0543 #define GFS2_DATA_ORDERED 2
0544
0545 #define GFS2_ERRORS_DEFAULT GFS2_ERRORS_WITHDRAW
0546 #define GFS2_ERRORS_WITHDRAW 0
0547 #define GFS2_ERRORS_CONTINUE 1
0548 #define GFS2_ERRORS_RO 2
0549 #define GFS2_ERRORS_PANIC 3
0550
0551 struct gfs2_args {
0552 char ar_lockproto[GFS2_LOCKNAME_LEN];
0553 char ar_locktable[GFS2_LOCKNAME_LEN];
0554 char ar_hostdata[GFS2_LOCKNAME_LEN];
0555 unsigned int ar_spectator:1;
0556 unsigned int ar_localflocks:1;
0557 unsigned int ar_debug:1;
0558 unsigned int ar_posix_acl:1;
0559 unsigned int ar_quota:2;
0560 unsigned int ar_suiddir:1;
0561 unsigned int ar_data:2;
0562 unsigned int ar_meta:1;
0563 unsigned int ar_discard:1;
0564 unsigned int ar_errors:2;
0565 unsigned int ar_nobarrier:1;
0566 unsigned int ar_rgrplvb:1;
0567 unsigned int ar_got_rgrplvb:1;
0568 unsigned int ar_loccookie:1;
0569
0570 s32 ar_commit;
0571 s32 ar_statfs_quantum;
0572 s32 ar_quota_quantum;
0573 s32 ar_statfs_percent;
0574 };
0575
0576 struct gfs2_tune {
0577 spinlock_t gt_spin;
0578
0579 unsigned int gt_logd_secs;
0580
0581 unsigned int gt_quota_warn_period;
0582 unsigned int gt_quota_scale_num;
0583 unsigned int gt_quota_scale_den;
0584 unsigned int gt_quota_quantum;
0585 unsigned int gt_new_files_jdata;
0586 unsigned int gt_max_readahead;
0587 unsigned int gt_complain_secs;
0588 unsigned int gt_statfs_quantum;
0589 unsigned int gt_statfs_slow;
0590 };
0591
0592 enum {
0593 SDF_JOURNAL_CHECKED = 0,
0594 SDF_JOURNAL_LIVE = 1,
0595 SDF_WITHDRAWN = 2,
0596 SDF_NOBARRIERS = 3,
0597 SDF_NORECOVERY = 4,
0598 SDF_DEMOTE = 5,
0599 SDF_NOJOURNALID = 6,
0600 SDF_RORECOVERY = 7,
0601 SDF_SKIP_DLM_UNLOCK = 8,
0602 SDF_FORCE_AIL_FLUSH = 9,
0603 SDF_FS_FROZEN = 10,
0604 SDF_WITHDRAWING = 11,
0605 SDF_WITHDRAW_IN_PROG = 12,
0606 SDF_REMOTE_WITHDRAW = 13,
0607 SDF_WITHDRAW_RECOVERY = 14,
0608
0609 };
0610
0611 enum gfs2_freeze_state {
0612 SFS_UNFROZEN = 0,
0613 SFS_STARTING_FREEZE = 1,
0614 SFS_FROZEN = 2,
0615 };
0616
0617 #define GFS2_FSNAME_LEN 256
0618
0619 struct gfs2_inum_host {
0620 u64 no_formal_ino;
0621 u64 no_addr;
0622 };
0623
0624 struct gfs2_sb_host {
0625 u32 sb_magic;
0626 u32 sb_type;
0627
0628 u32 sb_fs_format;
0629 u32 sb_multihost_format;
0630 u32 sb_bsize;
0631 u32 sb_bsize_shift;
0632
0633 struct gfs2_inum_host sb_master_dir;
0634 struct gfs2_inum_host sb_root_dir;
0635
0636 char sb_lockproto[GFS2_LOCKNAME_LEN];
0637 char sb_locktable[GFS2_LOCKNAME_LEN];
0638 };
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649 struct lm_lockstruct {
0650 int ls_jid;
0651 unsigned int ls_first;
0652 const struct lm_lockops *ls_ops;
0653 dlm_lockspace_t *ls_dlm;
0654
0655 int ls_recover_jid_done;
0656 int ls_recover_jid_status;
0657
0658 struct dlm_lksb ls_mounted_lksb;
0659 struct dlm_lksb ls_control_lksb;
0660 char ls_control_lvb[GDLM_LVB_SIZE];
0661 struct completion ls_sync_wait;
0662 char *ls_lvb_bits;
0663
0664 spinlock_t ls_recover_spin;
0665 unsigned long ls_recover_flags;
0666 uint32_t ls_recover_mount;
0667 uint32_t ls_recover_start;
0668 uint32_t ls_recover_block;
0669 uint32_t ls_recover_size;
0670 uint32_t *ls_recover_submit;
0671 uint32_t *ls_recover_result;
0672 };
0673
0674 struct gfs2_pcpu_lkstats {
0675
0676 struct gfs2_lkstats lkstats[10];
0677 };
0678
0679
0680 struct local_statfs_inode {
0681 struct list_head si_list;
0682 struct inode *si_sc_inode;
0683 unsigned int si_jid;
0684 };
0685
0686 struct gfs2_sbd {
0687 struct super_block *sd_vfs;
0688 struct gfs2_pcpu_lkstats __percpu *sd_lkstats;
0689 struct kobject sd_kobj;
0690 struct completion sd_kobj_unregister;
0691 unsigned long sd_flags;
0692 struct gfs2_sb_host sd_sb;
0693
0694
0695
0696 u32 sd_fsb2bb;
0697 u32 sd_fsb2bb_shift;
0698 u32 sd_diptrs;
0699 u32 sd_inptrs;
0700 u32 sd_ldptrs;
0701 u32 sd_jbsize;
0702 u32 sd_hash_bsize;
0703 u32 sd_hash_bsize_shift;
0704 u32 sd_hash_ptrs;
0705 u32 sd_qc_per_block;
0706 u32 sd_blocks_per_bitmap;
0707 u32 sd_max_dirres;
0708 u32 sd_max_height;
0709 u64 sd_heightsize[GFS2_MAX_META_HEIGHT + 1];
0710 u32 sd_max_dents_per_leaf;
0711
0712 struct gfs2_args sd_args;
0713 struct gfs2_tune sd_tune;
0714
0715
0716
0717 struct lm_lockstruct sd_lockstruct;
0718 struct gfs2_holder sd_live_gh;
0719 struct gfs2_glock *sd_rename_gl;
0720 struct gfs2_glock *sd_freeze_gl;
0721 struct work_struct sd_freeze_work;
0722 wait_queue_head_t sd_glock_wait;
0723 wait_queue_head_t sd_async_glock_wait;
0724 atomic_t sd_glock_disposal;
0725 struct completion sd_locking_init;
0726 struct completion sd_wdack;
0727 struct delayed_work sd_control_work;
0728
0729
0730
0731 struct dentry *sd_master_dir;
0732 struct dentry *sd_root_dir;
0733
0734 struct inode *sd_jindex;
0735 struct inode *sd_statfs_inode;
0736 struct inode *sd_sc_inode;
0737 struct list_head sd_sc_inodes_list;
0738 struct inode *sd_qc_inode;
0739 struct inode *sd_rindex;
0740 struct inode *sd_quota_inode;
0741
0742
0743
0744 spinlock_t sd_statfs_spin;
0745 struct gfs2_statfs_change_host sd_statfs_master;
0746 struct gfs2_statfs_change_host sd_statfs_local;
0747 int sd_statfs_force_sync;
0748
0749
0750
0751 int sd_rindex_uptodate;
0752 spinlock_t sd_rindex_spin;
0753 struct rb_root sd_rindex_tree;
0754 unsigned int sd_rgrps;
0755 unsigned int sd_max_rg_data;
0756
0757
0758
0759 struct list_head sd_jindex_list;
0760 spinlock_t sd_jindex_spin;
0761 struct mutex sd_jindex_mutex;
0762 unsigned int sd_journals;
0763
0764 struct gfs2_jdesc *sd_jdesc;
0765 struct gfs2_holder sd_journal_gh;
0766 struct gfs2_holder sd_jinode_gh;
0767 struct gfs2_glock *sd_jinode_gl;
0768
0769 struct gfs2_holder sd_sc_gh;
0770 struct buffer_head *sd_sc_bh;
0771 struct gfs2_holder sd_qc_gh;
0772
0773 struct completion sd_journal_ready;
0774
0775
0776
0777 struct task_struct *sd_logd_process;
0778 struct task_struct *sd_quotad_process;
0779
0780
0781
0782 struct list_head sd_quota_list;
0783 atomic_t sd_quota_count;
0784 struct mutex sd_quota_mutex;
0785 struct mutex sd_quota_sync_mutex;
0786 wait_queue_head_t sd_quota_wait;
0787
0788 unsigned int sd_quota_slots;
0789 unsigned long *sd_quota_bitmap;
0790 spinlock_t sd_bitmap_lock;
0791
0792 u64 sd_quota_sync_gen;
0793
0794
0795
0796 struct address_space sd_aspace;
0797
0798 spinlock_t sd_log_lock;
0799
0800 struct gfs2_trans *sd_log_tr;
0801 unsigned int sd_log_blks_reserved;
0802
0803 atomic_t sd_log_pinned;
0804 unsigned int sd_log_num_revoke;
0805
0806 struct list_head sd_log_revokes;
0807 struct list_head sd_log_ordered;
0808 spinlock_t sd_ordered_lock;
0809
0810 atomic_t sd_log_thresh1;
0811 atomic_t sd_log_thresh2;
0812 atomic_t sd_log_blks_free;
0813 atomic_t sd_log_blks_needed;
0814 atomic_t sd_log_revokes_available;
0815 wait_queue_head_t sd_log_waitq;
0816 wait_queue_head_t sd_logd_waitq;
0817
0818 u64 sd_log_sequence;
0819 int sd_log_idle;
0820
0821 struct rw_semaphore sd_log_flush_lock;
0822 atomic_t sd_log_in_flight;
0823 wait_queue_head_t sd_log_flush_wait;
0824 int sd_log_error;
0825 wait_queue_head_t sd_withdraw_wait;
0826
0827 unsigned int sd_log_tail;
0828 unsigned int sd_log_flush_tail;
0829 unsigned int sd_log_head;
0830 unsigned int sd_log_flush_head;
0831
0832 spinlock_t sd_ail_lock;
0833 struct list_head sd_ail1_list;
0834 struct list_head sd_ail2_list;
0835
0836
0837 struct gfs2_holder sd_freeze_gh;
0838 atomic_t sd_freeze_state;
0839 struct mutex sd_freeze_mutex;
0840
0841 char sd_fsname[GFS2_FSNAME_LEN + 3 * sizeof(int) + 2];
0842 char sd_table_name[GFS2_FSNAME_LEN];
0843 char sd_proto_name[GFS2_FSNAME_LEN];
0844
0845
0846
0847 unsigned long sd_last_warning;
0848 struct dentry *debugfs_dir;
0849 unsigned long sd_glock_dqs_held;
0850 };
0851
0852 static inline void gfs2_glstats_inc(struct gfs2_glock *gl, int which)
0853 {
0854 gl->gl_stats.stats[which]++;
0855 }
0856
0857 static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which)
0858 {
0859 const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
0860 preempt_disable();
0861 this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++;
0862 preempt_enable();
0863 }
0864
0865 extern struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl);
0866
0867 static inline unsigned gfs2_max_stuffed_size(const struct gfs2_inode *ip)
0868 {
0869 return GFS2_SB(&ip->i_inode)->sd_sb.sb_bsize - sizeof(struct gfs2_dinode);
0870 }
0871
0872 #endif
0873