1
2
3
4
5
6
7
8
9
10#ifndef __INCORE_DOT_H__
11#define __INCORE_DOT_H__
12
13#include <linux/fs.h>
14#include <linux/kobject.h>
15#include <linux/workqueue.h>
16#include <linux/dlm.h>
17#include <linux/buffer_head.h>
18#include <linux/rcupdate.h>
19#include <linux/rculist_bl.h>
20#include <linux/completion.h>
21#include <linux/rbtree.h>
22#include <linux/ktime.h>
23#include <linux/percpu.h>
24#include <linux/lockref.h>
25#include <linux/rhashtable.h>
26#include <linux/mutex.h>
27
28#define DIO_WAIT 0x00000010
29#define DIO_METADATA 0x00000020
30
31struct gfs2_log_operations;
32struct gfs2_bufdata;
33struct gfs2_holder;
34struct gfs2_glock;
35struct gfs2_quota_data;
36struct gfs2_trans;
37struct gfs2_jdesc;
38struct gfs2_sbd;
39struct lm_lockops;
40
41typedef void (*gfs2_glop_bh_t) (struct gfs2_glock *gl, unsigned int ret);
42
43struct gfs2_log_header_host {
44 u64 lh_sequence;
45 u32 lh_flags;
46 u32 lh_tail;
47 u32 lh_blkno;
48
49 s64 lh_local_total;
50 s64 lh_local_free;
51 s64 lh_local_dinodes;
52};
53
54
55
56
57
58
59struct gfs2_log_operations {
60 void (*lo_before_commit) (struct gfs2_sbd *sdp, struct gfs2_trans *tr);
61 void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_trans *tr);
62 void (*lo_before_scan) (struct gfs2_jdesc *jd,
63 struct gfs2_log_header_host *head, int pass);
64 int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start,
65 struct gfs2_log_descriptor *ld, __be64 *ptr,
66 int pass);
67 void (*lo_after_scan) (struct gfs2_jdesc *jd, int error, int pass);
68 const char *lo_name;
69};
70
71#define GBF_FULL 1
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94struct gfs2_bitmap {
95 struct buffer_head *bi_bh;
96 char *bi_clone;
97 unsigned long bi_flags;
98 u32 bi_offset;
99 u32 bi_start;
100 u32 bi_bytes;
101 u32 bi_blocks;
102};
103
104struct gfs2_rgrpd {
105 struct rb_node rd_node;
106 struct gfs2_glock *rd_gl;
107 u64 rd_addr;
108 u64 rd_data0;
109 u32 rd_length;
110 u32 rd_data;
111 u32 rd_bitbytes;
112 u32 rd_free;
113 u32 rd_requested;
114 u32 rd_reserved;
115 u32 rd_free_clone;
116 u32 rd_dinodes;
117 u64 rd_igeneration;
118 struct gfs2_bitmap *rd_bits;
119 struct gfs2_sbd *rd_sbd;
120 struct gfs2_rgrp_lvb *rd_rgl;
121 u32 rd_last_alloc;
122 u32 rd_flags;
123 u32 rd_extfail_pt;
124#define GFS2_RDF_CHECK 0x10000000
125#define GFS2_RDF_UPTODATE 0x20000000
126#define GFS2_RDF_ERROR 0x40000000
127#define GFS2_RDF_PREFERRED 0x80000000
128#define GFS2_RDF_MASK 0xf0000000
129 spinlock_t rd_rsspin;
130 struct mutex rd_mutex;
131 struct rb_root rd_rstree;
132};
133
134enum gfs2_state_bits {
135 BH_Pinned = BH_PrivateStart,
136 BH_Escaped = BH_PrivateStart + 1,
137};
138
139BUFFER_FNS(Pinned, pinned)
140TAS_BUFFER_FNS(Pinned, pinned)
141BUFFER_FNS(Escaped, escaped)
142TAS_BUFFER_FNS(Escaped, escaped)
143
144struct gfs2_bufdata {
145 struct buffer_head *bd_bh;
146 struct gfs2_glock *bd_gl;
147 u64 bd_blkno;
148
149 struct list_head bd_list;
150
151 struct gfs2_trans *bd_tr;
152 struct list_head bd_ail_st_list;
153 struct list_head bd_ail_gl_list;
154};
155
156
157
158
159
160
161#define GDLM_STRNAME_BYTES 25
162#define GDLM_LVB_SIZE 32
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195enum {
196 DFL_BLOCK_LOCKS = 0,
197 DFL_NO_DLM_OPS = 1,
198 DFL_FIRST_MOUNT = 2,
199 DFL_FIRST_MOUNT_DONE = 3,
200 DFL_MOUNT_DONE = 4,
201 DFL_UNMOUNT = 5,
202 DFL_DLM_RECOVERY = 6,
203};
204
205
206
207
208
209struct lm_lockname {
210 u64 ln_number;
211 struct gfs2_sbd *ln_sbd;
212 unsigned int ln_type;
213};
214
215#define lm_name_equal(name1, name2) \
216 (((name1)->ln_number == (name2)->ln_number) && \
217 ((name1)->ln_type == (name2)->ln_type) && \
218 ((name1)->ln_sbd == (name2)->ln_sbd))
219
220
221struct gfs2_glock_operations {
222 int (*go_sync) (struct gfs2_glock *gl);
223 int (*go_xmote_bh)(struct gfs2_glock *gl);
224 void (*go_inval) (struct gfs2_glock *gl, int flags);
225 int (*go_demote_ok) (const struct gfs2_glock *gl);
226 int (*go_lock) (struct gfs2_holder *gh);
227 void (*go_dump)(struct seq_file *seq, struct gfs2_glock *gl,
228 const char *fs_id_buf);
229 void (*go_callback)(struct gfs2_glock *gl, bool remote);
230 void (*go_free)(struct gfs2_glock *gl);
231 const int go_subclass;
232 const int go_type;
233 const unsigned long go_flags;
234#define GLOF_ASPACE 1
235#define GLOF_LVB 2
236#define GLOF_LRU 4
237#define GLOF_NONDISK 8
238};
239
240enum {
241 GFS2_LKS_SRTT = 0,
242 GFS2_LKS_SRTTVAR = 1,
243 GFS2_LKS_SRTTB = 2,
244 GFS2_LKS_SRTTVARB = 3,
245 GFS2_LKS_SIRT = 4,
246 GFS2_LKS_SIRTVAR = 5,
247 GFS2_LKS_DCOUNT = 6,
248 GFS2_LKS_QCOUNT = 7,
249 GFS2_NR_LKSTATS
250};
251
252struct gfs2_lkstats {
253 u64 stats[GFS2_NR_LKSTATS];
254};
255
256enum {
257
258 HIF_HOLDER = 6,
259 HIF_FIRST = 7,
260 HIF_WAIT = 10,
261};
262
263struct gfs2_holder {
264 struct list_head gh_list;
265
266 struct gfs2_glock *gh_gl;
267 struct pid *gh_owner_pid;
268 u16 gh_flags;
269 u16 gh_state;
270
271 int gh_error;
272 unsigned long gh_iflags;
273 unsigned long gh_ip;
274};
275
276
277#define GFS2_MAXQUOTAS 2
278
279struct gfs2_qadata {
280
281 struct gfs2_quota_data *qa_qd[2 * GFS2_MAXQUOTAS];
282 struct gfs2_holder qa_qd_ghs[2 * GFS2_MAXQUOTAS];
283 unsigned int qa_qd_num;
284 int qa_ref;
285};
286
287
288
289
290
291
292
293
294
295
296struct gfs2_blkreserv {
297 struct rb_node rs_node;
298 struct gfs2_rgrpd *rs_rgd;
299 u64 rs_start;
300 u32 rs_requested;
301 u32 rs_reserved;
302};
303
304
305
306
307
308
309
310
311
312
313struct gfs2_alloc_parms {
314 u64 target;
315 u32 min_target;
316 u32 aflags;
317 u64 allowed;
318};
319
320enum {
321 GLF_LOCK = 1,
322 GLF_DEMOTE = 3,
323 GLF_PENDING_DEMOTE = 4,
324 GLF_DEMOTE_IN_PROGRESS = 5,
325 GLF_DIRTY = 6,
326 GLF_LFLUSH = 7,
327 GLF_INVALIDATE_IN_PROGRESS = 8,
328 GLF_REPLY_PENDING = 9,
329 GLF_INITIAL = 10,
330 GLF_FROZEN = 11,
331 GLF_LRU = 13,
332 GLF_OBJECT = 14,
333 GLF_BLOCKING = 15,
334 GLF_PENDING_DELETE = 17,
335 GLF_FREEING = 18,
336};
337
338struct gfs2_glock {
339 unsigned long gl_flags;
340 struct lm_lockname gl_name;
341
342 struct lockref gl_lockref;
343
344
345 unsigned int gl_state:2,
346 gl_target:2,
347 gl_demote_state:2,
348 gl_req:2,
349 gl_reply:8;
350
351 unsigned long gl_demote_time;
352 long gl_hold_time;
353 struct list_head gl_holders;
354
355 const struct gfs2_glock_operations *gl_ops;
356 ktime_t gl_dstamp;
357 struct gfs2_lkstats gl_stats;
358 struct dlm_lksb gl_lksb;
359 unsigned long gl_tchange;
360 void *gl_object;
361
362 struct list_head gl_lru;
363 struct list_head gl_ail_list;
364 atomic_t gl_ail_count;
365 atomic_t gl_revokes;
366 struct delayed_work gl_work;
367
368 struct {
369 struct delayed_work gl_delete;
370 u64 gl_no_formal_ino;
371 };
372 struct rcu_head gl_rcu;
373 struct rhash_head gl_node;
374};
375
376#define GFS2_MIN_LVB_SIZE 32
377
378enum {
379 GIF_INVALID = 0,
380 GIF_QD_LOCKED = 1,
381 GIF_ALLOC_FAILED = 2,
382 GIF_SW_PAGED = 3,
383 GIF_ORDERED = 4,
384 GIF_FREE_VFS_INODE = 5,
385 GIF_GLOP_PENDING = 6,
386 GIF_DEFERRED_DELETE = 7,
387};
388
389struct gfs2_inode {
390 struct inode i_inode;
391 u64 i_no_addr;
392 u64 i_no_formal_ino;
393 u64 i_generation;
394 u64 i_eattr;
395 unsigned long i_flags;
396 struct gfs2_glock *i_gl;
397 struct gfs2_holder i_iopen_gh;
398 struct gfs2_holder i_gh;
399 struct gfs2_qadata *i_qadata;
400 struct gfs2_holder i_rgd_gh;
401 struct gfs2_blkreserv i_res;
402 u64 i_goal;
403 atomic_t i_sizehint;
404 struct rw_semaphore i_rw_mutex;
405 struct list_head i_ordered;
406 struct list_head i_trunc_list;
407 __be64 *i_hash_cache;
408 u32 i_entries;
409 u32 i_diskflags;
410 u8 i_height;
411 u8 i_depth;
412 u16 i_rahead;
413};
414
415
416
417
418
419static inline struct gfs2_inode *GFS2_I(struct inode *inode)
420{
421 return container_of(inode, struct gfs2_inode, i_inode);
422}
423
424static inline struct gfs2_sbd *GFS2_SB(const struct inode *inode)
425{
426 return inode->i_sb->s_fs_info;
427}
428
429struct gfs2_file {
430 struct mutex f_fl_mutex;
431 struct gfs2_holder f_fl_gh;
432};
433
434struct gfs2_revoke_replay {
435 struct list_head rr_list;
436 u64 rr_blkno;
437 unsigned int rr_where;
438};
439
440enum {
441 QDF_CHANGE = 1,
442 QDF_LOCKED = 2,
443 QDF_REFRESH = 3,
444 QDF_QMSG_QUIET = 4,
445};
446
447struct gfs2_quota_data {
448 struct hlist_bl_node qd_hlist;
449 struct list_head qd_list;
450 struct kqid qd_id;
451 struct gfs2_sbd *qd_sbd;
452 struct lockref qd_lockref;
453 struct list_head qd_lru;
454 unsigned qd_hash;
455
456 unsigned long qd_flags;
457
458 s64 qd_change;
459 s64 qd_change_sync;
460
461 unsigned int qd_slot;
462 unsigned int qd_slot_count;
463
464 struct buffer_head *qd_bh;
465 struct gfs2_quota_change *qd_bh_qc;
466 unsigned int qd_bh_count;
467
468 struct gfs2_glock *qd_gl;
469 struct gfs2_quota_lvb qd_qb;
470
471 u64 qd_sync_gen;
472 unsigned long qd_last_warn;
473 struct rcu_head qd_rcu;
474};
475
476enum {
477 TR_TOUCHED = 1,
478 TR_ATTACHED = 2,
479 TR_ONSTACK = 3,
480};
481
482struct gfs2_trans {
483 unsigned long tr_ip;
484
485 unsigned int tr_blocks;
486 unsigned int tr_revokes;
487 unsigned int tr_reserved;
488 unsigned long tr_flags;
489
490 unsigned int tr_num_buf_new;
491 unsigned int tr_num_databuf_new;
492 unsigned int tr_num_buf_rm;
493 unsigned int tr_num_databuf_rm;
494 unsigned int tr_num_revoke;
495
496 struct list_head tr_list;
497 struct list_head tr_databuf;
498 struct list_head tr_buf;
499
500 unsigned int tr_first;
501 struct list_head tr_ail1_list;
502 struct list_head tr_ail2_list;
503};
504
505struct gfs2_journal_extent {
506 struct list_head list;
507
508 unsigned int lblock;
509 u64 dblock;
510 u64 blocks;
511};
512
513struct gfs2_jdesc {
514 struct list_head jd_list;
515 struct list_head extent_list;
516 unsigned int nr_extents;
517 struct work_struct jd_work;
518 struct inode *jd_inode;
519 struct bio *jd_log_bio;
520 unsigned long jd_flags;
521#define JDF_RECOVERY 1
522 unsigned int jd_jid;
523 u32 jd_blocks;
524 int jd_recover_error;
525
526
527 unsigned int jd_found_blocks;
528 unsigned int jd_found_revokes;
529 unsigned int jd_replayed_blocks;
530
531 struct list_head jd_revoke_list;
532 unsigned int jd_replay_tail;
533
534 u64 jd_no_addr;
535};
536
537struct gfs2_statfs_change_host {
538 s64 sc_total;
539 s64 sc_free;
540 s64 sc_dinodes;
541};
542
543#define GFS2_QUOTA_DEFAULT GFS2_QUOTA_OFF
544#define GFS2_QUOTA_OFF 0
545#define GFS2_QUOTA_ACCOUNT 1
546#define GFS2_QUOTA_ON 2
547
548#define GFS2_DATA_DEFAULT GFS2_DATA_ORDERED
549#define GFS2_DATA_WRITEBACK 1
550#define GFS2_DATA_ORDERED 2
551
552#define GFS2_ERRORS_DEFAULT GFS2_ERRORS_WITHDRAW
553#define GFS2_ERRORS_WITHDRAW 0
554#define GFS2_ERRORS_CONTINUE 1
555#define GFS2_ERRORS_RO 2
556#define GFS2_ERRORS_PANIC 3
557
558struct gfs2_args {
559 char ar_lockproto[GFS2_LOCKNAME_LEN];
560 char ar_locktable[GFS2_LOCKNAME_LEN];
561 char ar_hostdata[GFS2_LOCKNAME_LEN];
562 unsigned int ar_spectator:1;
563 unsigned int ar_localflocks:1;
564 unsigned int ar_debug:1;
565 unsigned int ar_posix_acl:1;
566 unsigned int ar_quota:2;
567 unsigned int ar_suiddir:1;
568 unsigned int ar_data:2;
569 unsigned int ar_meta:1;
570 unsigned int ar_discard:1;
571 unsigned int ar_errors:2;
572 unsigned int ar_nobarrier:1;
573 unsigned int ar_rgrplvb:1;
574 unsigned int ar_loccookie:1;
575
576 s32 ar_commit;
577 s32 ar_statfs_quantum;
578 s32 ar_quota_quantum;
579 s32 ar_statfs_percent;
580};
581
582struct gfs2_tune {
583 spinlock_t gt_spin;
584
585 unsigned int gt_logd_secs;
586
587 unsigned int gt_quota_warn_period;
588 unsigned int gt_quota_scale_num;
589 unsigned int gt_quota_scale_den;
590 unsigned int gt_quota_quantum;
591 unsigned int gt_new_files_jdata;
592 unsigned int gt_max_readahead;
593 unsigned int gt_complain_secs;
594 unsigned int gt_statfs_quantum;
595 unsigned int gt_statfs_slow;
596};
597
598enum {
599 SDF_JOURNAL_CHECKED = 0,
600 SDF_JOURNAL_LIVE = 1,
601 SDF_WITHDRAWN = 2,
602 SDF_NOBARRIERS = 3,
603 SDF_NORECOVERY = 4,
604 SDF_DEMOTE = 5,
605 SDF_NOJOURNALID = 6,
606 SDF_RORECOVERY = 7,
607 SDF_SKIP_DLM_UNLOCK = 8,
608 SDF_FORCE_AIL_FLUSH = 9,
609 SDF_FS_FROZEN = 10,
610 SDF_WITHDRAWING = 11,
611 SDF_WITHDRAW_IN_PROG = 12,
612 SDF_REMOTE_WITHDRAW = 13,
613 SDF_WITHDRAW_RECOVERY = 14,
614
615};
616
617enum gfs2_freeze_state {
618 SFS_UNFROZEN = 0,
619 SFS_STARTING_FREEZE = 1,
620 SFS_FROZEN = 2,
621};
622
623#define GFS2_FSNAME_LEN 256
624
625struct gfs2_inum_host {
626 u64 no_formal_ino;
627 u64 no_addr;
628};
629
630struct gfs2_sb_host {
631 u32 sb_magic;
632 u32 sb_type;
633
634 u32 sb_fs_format;
635 u32 sb_multihost_format;
636 u32 sb_bsize;
637 u32 sb_bsize_shift;
638
639 struct gfs2_inum_host sb_master_dir;
640 struct gfs2_inum_host sb_root_dir;
641
642 char sb_lockproto[GFS2_LOCKNAME_LEN];
643 char sb_locktable[GFS2_LOCKNAME_LEN];
644};
645
646
647
648
649
650
651
652
653
654
655struct lm_lockstruct {
656 int ls_jid;
657 unsigned int ls_first;
658 const struct lm_lockops *ls_ops;
659 dlm_lockspace_t *ls_dlm;
660
661 int ls_recover_jid_done;
662 int ls_recover_jid_status;
663
664 struct dlm_lksb ls_mounted_lksb;
665 struct dlm_lksb ls_control_lksb;
666 char ls_control_lvb[GDLM_LVB_SIZE];
667 struct completion ls_sync_wait;
668 char *ls_lvb_bits;
669
670 spinlock_t ls_recover_spin;
671 unsigned long ls_recover_flags;
672 uint32_t ls_recover_mount;
673 uint32_t ls_recover_start;
674 uint32_t ls_recover_block;
675 uint32_t ls_recover_size;
676 uint32_t *ls_recover_submit;
677 uint32_t *ls_recover_result;
678};
679
680struct gfs2_pcpu_lkstats {
681
682 struct gfs2_lkstats lkstats[10];
683};
684
685
686struct lcl_statfs_inode {
687 struct list_head si_list;
688 struct inode *si_sc_inode;
689 unsigned int si_jid;
690};
691
692struct gfs2_sbd {
693 struct super_block *sd_vfs;
694 struct gfs2_pcpu_lkstats __percpu *sd_lkstats;
695 struct kobject sd_kobj;
696 struct completion sd_kobj_unregister;
697 unsigned long sd_flags;
698 struct gfs2_sb_host sd_sb;
699
700
701
702 u32 sd_fsb2bb;
703 u32 sd_fsb2bb_shift;
704 u32 sd_diptrs;
705 u32 sd_inptrs;
706 u32 sd_ldptrs;
707 u32 sd_jbsize;
708 u32 sd_hash_bsize;
709 u32 sd_hash_bsize_shift;
710 u32 sd_hash_ptrs;
711 u32 sd_qc_per_block;
712 u32 sd_blocks_per_bitmap;
713 u32 sd_max_dirres;
714 u32 sd_max_height;
715 u64 sd_heightsize[GFS2_MAX_META_HEIGHT + 1];
716 u32 sd_max_dents_per_leaf;
717
718 struct gfs2_args sd_args;
719 struct gfs2_tune sd_tune;
720
721
722
723 struct lm_lockstruct sd_lockstruct;
724 struct gfs2_holder sd_live_gh;
725 struct gfs2_glock *sd_rename_gl;
726 struct gfs2_glock *sd_freeze_gl;
727 struct work_struct sd_freeze_work;
728 wait_queue_head_t sd_glock_wait;
729 wait_queue_head_t sd_async_glock_wait;
730 atomic_t sd_glock_disposal;
731 struct completion sd_locking_init;
732 struct completion sd_wdack;
733 struct delayed_work sd_control_work;
734
735
736
737 struct dentry *sd_master_dir;
738 struct dentry *sd_root_dir;
739
740 struct inode *sd_jindex;
741 struct inode *sd_statfs_inode;
742 struct inode *sd_sc_inode;
743 struct list_head sd_sc_inodes_list;
744 struct inode *sd_qc_inode;
745 struct inode *sd_rindex;
746 struct inode *sd_quota_inode;
747
748
749
750 spinlock_t sd_statfs_spin;
751 struct gfs2_statfs_change_host sd_statfs_master;
752 struct gfs2_statfs_change_host sd_statfs_local;
753 int sd_statfs_force_sync;
754
755
756
757 int sd_rindex_uptodate;
758 spinlock_t sd_rindex_spin;
759 struct rb_root sd_rindex_tree;
760 unsigned int sd_rgrps;
761 unsigned int sd_max_rg_data;
762
763
764
765 struct list_head sd_jindex_list;
766 spinlock_t sd_jindex_spin;
767 struct mutex sd_jindex_mutex;
768 unsigned int sd_journals;
769
770 struct gfs2_jdesc *sd_jdesc;
771 struct gfs2_holder sd_journal_gh;
772 struct gfs2_holder sd_jinode_gh;
773 struct gfs2_glock *sd_jinode_gl;
774
775 struct gfs2_holder sd_sc_gh;
776 struct gfs2_holder sd_qc_gh;
777
778 struct completion sd_journal_ready;
779
780
781
782 struct task_struct *sd_logd_process;
783 struct task_struct *sd_quotad_process;
784
785
786
787 struct list_head sd_quota_list;
788 atomic_t sd_quota_count;
789 struct mutex sd_quota_mutex;
790 struct mutex sd_quota_sync_mutex;
791 wait_queue_head_t sd_quota_wait;
792 struct list_head sd_trunc_list;
793 spinlock_t sd_trunc_lock;
794
795 unsigned int sd_quota_slots;
796 unsigned long *sd_quota_bitmap;
797 spinlock_t sd_bitmap_lock;
798
799 u64 sd_quota_sync_gen;
800
801
802
803 struct address_space sd_aspace;
804
805 spinlock_t sd_log_lock;
806
807 struct gfs2_trans *sd_log_tr;
808 unsigned int sd_log_blks_reserved;
809
810 atomic_t sd_log_pinned;
811 unsigned int sd_log_num_revoke;
812
813 struct list_head sd_log_revokes;
814 struct list_head sd_log_ordered;
815 spinlock_t sd_ordered_lock;
816
817 atomic_t sd_log_thresh1;
818 atomic_t sd_log_thresh2;
819 atomic_t sd_log_blks_free;
820 atomic_t sd_log_blks_needed;
821 atomic_t sd_log_revokes_available;
822 wait_queue_head_t sd_log_waitq;
823 wait_queue_head_t sd_logd_waitq;
824
825 u64 sd_log_sequence;
826 int sd_log_idle;
827
828 struct rw_semaphore sd_log_flush_lock;
829 atomic_t sd_log_in_flight;
830 wait_queue_head_t sd_log_flush_wait;
831 int sd_log_error;
832 wait_queue_head_t sd_withdraw_wait;
833
834 unsigned int sd_log_tail;
835 unsigned int sd_log_flush_tail;
836 unsigned int sd_log_head;
837 unsigned int sd_log_flush_head;
838
839 spinlock_t sd_ail_lock;
840 struct list_head sd_ail1_list;
841 struct list_head sd_ail2_list;
842
843
844 struct gfs2_holder sd_freeze_gh;
845 atomic_t sd_freeze_state;
846 struct mutex sd_freeze_mutex;
847
848 char sd_fsname[GFS2_FSNAME_LEN + 3 * sizeof(int) + 2];
849 char sd_table_name[GFS2_FSNAME_LEN];
850 char sd_proto_name[GFS2_FSNAME_LEN];
851
852
853
854 unsigned long sd_last_warning;
855 struct dentry *debugfs_dir;
856 unsigned long sd_glock_dqs_held;
857};
858
859static inline void gfs2_glstats_inc(struct gfs2_glock *gl, int which)
860{
861 gl->gl_stats.stats[which]++;
862}
863
864static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which)
865{
866 const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
867 preempt_disable();
868 this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++;
869 preempt_enable();
870}
871
872extern struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl);
873
874static inline unsigned gfs2_max_stuffed_size(const struct gfs2_inode *ip)
875{
876 return GFS2_SB(&ip->i_inode)->sd_sb.sb_bsize - sizeof(struct gfs2_dinode);
877}
878
879#endif
880
881