aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h176
1 files changed, 93 insertions, 83 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 76ad74758696..c618f7cb5f0e 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -54,13 +54,8 @@ typedef struct xfs_trans_reservations {
54#else 54#else
55struct cred; 55struct cred;
56struct log; 56struct log;
57struct bhv_vfs;
58struct bhv_vnode;
59struct xfs_mount_args; 57struct xfs_mount_args;
60struct xfs_ihash;
61struct xfs_chash;
62struct xfs_inode; 58struct xfs_inode;
63struct xfs_perag;
64struct xfs_iocore; 59struct xfs_iocore;
65struct xfs_bmbt_irec; 60struct xfs_bmbt_irec;
66struct xfs_bmap_free; 61struct xfs_bmap_free;
@@ -68,9 +63,6 @@ struct xfs_extdelta;
68struct xfs_swapext; 63struct xfs_swapext;
69struct xfs_mru_cache; 64struct xfs_mru_cache;
70 65
71extern struct bhv_vfsops xfs_vfsops;
72extern struct bhv_vnodeops xfs_vnodeops;
73
74#define AIL_LOCK_T lock_t 66#define AIL_LOCK_T lock_t
75#define AIL_LOCKINIT(x,y) spinlock_init(x,y) 67#define AIL_LOCKINIT(x,y) spinlock_init(x,y)
76#define AIL_LOCK_DESTROY(x) spinlock_destroy(x) 68#define AIL_LOCK_DESTROY(x) spinlock_destroy(x)
@@ -82,15 +74,17 @@ extern struct bhv_vnodeops xfs_vnodeops;
82 * Prototypes and functions for the Data Migration subsystem. 74 * Prototypes and functions for the Data Migration subsystem.
83 */ 75 */
84 76
85typedef int (*xfs_send_data_t)(int, struct bhv_vnode *, 77typedef int (*xfs_send_data_t)(int, bhv_vnode_t *,
86 xfs_off_t, size_t, int, bhv_vrwlock_t *); 78 xfs_off_t, size_t, int, bhv_vrwlock_t *);
87typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); 79typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
88typedef int (*xfs_send_destroy_t)(struct bhv_vnode *, dm_right_t); 80typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t);
89typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *, 81typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *,
90 struct bhv_vnode *, 82 bhv_vnode_t *,
91 dm_right_t, struct bhv_vnode *, dm_right_t, 83 dm_right_t, bhv_vnode_t *, dm_right_t,
92 char *, char *, mode_t, int, int); 84 char *, char *, mode_t, int, int);
93typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, struct bhv_vnode *, 85typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t,
86 char *, char *);
87typedef void (*xfs_send_unmount_t)(struct xfs_mount *, bhv_vnode_t *,
94 dm_right_t, mode_t, int, int); 88 dm_right_t, mode_t, int, int);
95 89
96typedef struct xfs_dmops { 90typedef struct xfs_dmops {
@@ -98,21 +92,24 @@ typedef struct xfs_dmops {
98 xfs_send_mmap_t xfs_send_mmap; 92 xfs_send_mmap_t xfs_send_mmap;
99 xfs_send_destroy_t xfs_send_destroy; 93 xfs_send_destroy_t xfs_send_destroy;
100 xfs_send_namesp_t xfs_send_namesp; 94 xfs_send_namesp_t xfs_send_namesp;
95 xfs_send_mount_t xfs_send_mount;
101 xfs_send_unmount_t xfs_send_unmount; 96 xfs_send_unmount_t xfs_send_unmount;
102} xfs_dmops_t; 97} xfs_dmops_t;
103 98
104#define XFS_SEND_DATA(mp, ev,vp,off,len,fl,lock) \ 99#define XFS_SEND_DATA(mp, ev,vp,off,len,fl,lock) \
105 (*(mp)->m_dm_ops.xfs_send_data)(ev,vp,off,len,fl,lock) 100 (*(mp)->m_dm_ops->xfs_send_data)(ev,vp,off,len,fl,lock)
106#define XFS_SEND_MMAP(mp, vma,fl) \ 101#define XFS_SEND_MMAP(mp, vma,fl) \
107 (*(mp)->m_dm_ops.xfs_send_mmap)(vma,fl) 102 (*(mp)->m_dm_ops->xfs_send_mmap)(vma,fl)
108#define XFS_SEND_DESTROY(mp, vp,right) \ 103#define XFS_SEND_DESTROY(mp, vp,right) \
109 (*(mp)->m_dm_ops.xfs_send_destroy)(vp,right) 104 (*(mp)->m_dm_ops->xfs_send_destroy)(vp,right)
110#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ 105#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
111 (*(mp)->m_dm_ops.xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) 106 (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
112#define XFS_SEND_PREUNMOUNT(mp, vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ 107#define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
113 (*(mp)->m_dm_ops.xfs_send_namesp)(DM_EVENT_PREUNMOUNT,vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) 108 (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl)
114#define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \ 109#define XFS_SEND_MOUNT(mp,right,path,name) \
115 (*(mp)->m_dm_ops.xfs_send_unmount)(vfsp,vp,right,mode,rval,fl) 110 (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name)
111#define XFS_SEND_UNMOUNT(mp, vp,right,mode,rval,fl) \
112 (*(mp)->m_dm_ops->xfs_send_unmount)(mp,vp,right,mode,rval,fl)
116 113
117 114
118/* 115/*
@@ -142,6 +139,9 @@ typedef struct xfs_dquot * (*xfs_dqvopchown_t)(
142 struct xfs_dquot **, struct xfs_dquot *); 139 struct xfs_dquot **, struct xfs_dquot *);
143typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *, 140typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *,
144 struct xfs_dquot *, struct xfs_dquot *, uint); 141 struct xfs_dquot *, struct xfs_dquot *, uint);
142typedef void (*xfs_dqstatvfs_t)(struct xfs_inode *, bhv_statvfs_t *);
143typedef int (*xfs_dqsync_t)(struct xfs_mount *, int flags);
144typedef int (*xfs_quotactl_t)(struct xfs_mount *, int, int, xfs_caddr_t);
145 145
146typedef struct xfs_qmops { 146typedef struct xfs_qmops {
147 xfs_qminit_t xfs_qminit; 147 xfs_qminit_t xfs_qminit;
@@ -157,42 +157,51 @@ typedef struct xfs_qmops {
157 xfs_dqvoprename_t xfs_dqvoprename; 157 xfs_dqvoprename_t xfs_dqvoprename;
158 xfs_dqvopchown_t xfs_dqvopchown; 158 xfs_dqvopchown_t xfs_dqvopchown;
159 xfs_dqvopchownresv_t xfs_dqvopchownresv; 159 xfs_dqvopchownresv_t xfs_dqvopchownresv;
160 xfs_dqstatvfs_t xfs_dqstatvfs;
161 xfs_dqsync_t xfs_dqsync;
162 xfs_quotactl_t xfs_quotactl;
160 struct xfs_dqtrxops *xfs_dqtrxops; 163 struct xfs_dqtrxops *xfs_dqtrxops;
161} xfs_qmops_t; 164} xfs_qmops_t;
162 165
163#define XFS_QM_INIT(mp, mnt, fl) \ 166#define XFS_QM_INIT(mp, mnt, fl) \
164 (*(mp)->m_qm_ops.xfs_qminit)(mp, mnt, fl) 167 (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl)
165#define XFS_QM_MOUNT(mp, mnt, fl, mfsi_flags) \ 168#define XFS_QM_MOUNT(mp, mnt, fl, mfsi_flags) \
166 (*(mp)->m_qm_ops.xfs_qmmount)(mp, mnt, fl, mfsi_flags) 169 (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl, mfsi_flags)
167#define XFS_QM_UNMOUNT(mp) \ 170#define XFS_QM_UNMOUNT(mp) \
168 (*(mp)->m_qm_ops.xfs_qmunmount)(mp) 171 (*(mp)->m_qm_ops->xfs_qmunmount)(mp)
169#define XFS_QM_DONE(mp) \ 172#define XFS_QM_DONE(mp) \
170 (*(mp)->m_qm_ops.xfs_qmdone)(mp) 173 (*(mp)->m_qm_ops->xfs_qmdone)(mp)
171#define XFS_QM_DQRELE(mp, dq) \ 174#define XFS_QM_DQRELE(mp, dq) \
172 (*(mp)->m_qm_ops.xfs_dqrele)(dq) 175 (*(mp)->m_qm_ops->xfs_dqrele)(dq)
173#define XFS_QM_DQATTACH(mp, ip, fl) \ 176#define XFS_QM_DQATTACH(mp, ip, fl) \
174 (*(mp)->m_qm_ops.xfs_dqattach)(ip, fl) 177 (*(mp)->m_qm_ops->xfs_dqattach)(ip, fl)
175#define XFS_QM_DQDETACH(mp, ip) \ 178#define XFS_QM_DQDETACH(mp, ip) \
176 (*(mp)->m_qm_ops.xfs_dqdetach)(ip) 179 (*(mp)->m_qm_ops->xfs_dqdetach)(ip)
177#define XFS_QM_DQPURGEALL(mp, fl) \ 180#define XFS_QM_DQPURGEALL(mp, fl) \
178 (*(mp)->m_qm_ops.xfs_dqpurgeall)(mp, fl) 181 (*(mp)->m_qm_ops->xfs_dqpurgeall)(mp, fl)
179#define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, prid, fl, dq1, dq2) \ 182#define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, prid, fl, dq1, dq2) \
180 (*(mp)->m_qm_ops.xfs_dqvopalloc)(mp, ip, uid, gid, prid, fl, dq1, dq2) 183 (*(mp)->m_qm_ops->xfs_dqvopalloc)(mp, ip, uid, gid, prid, fl, dq1, dq2)
181#define XFS_QM_DQVOPCREATE(mp, tp, ip, dq1, dq2) \ 184#define XFS_QM_DQVOPCREATE(mp, tp, ip, dq1, dq2) \
182 (*(mp)->m_qm_ops.xfs_dqvopcreate)(tp, ip, dq1, dq2) 185 (*(mp)->m_qm_ops->xfs_dqvopcreate)(tp, ip, dq1, dq2)
183#define XFS_QM_DQVOPRENAME(mp, ip) \ 186#define XFS_QM_DQVOPRENAME(mp, ip) \
184 (*(mp)->m_qm_ops.xfs_dqvoprename)(ip) 187 (*(mp)->m_qm_ops->xfs_dqvoprename)(ip)
185#define XFS_QM_DQVOPCHOWN(mp, tp, ip, dqp, dq) \ 188#define XFS_QM_DQVOPCHOWN(mp, tp, ip, dqp, dq) \
186 (*(mp)->m_qm_ops.xfs_dqvopchown)(tp, ip, dqp, dq) 189 (*(mp)->m_qm_ops->xfs_dqvopchown)(tp, ip, dqp, dq)
187#define XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, dq1, dq2, fl) \ 190#define XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, dq1, dq2, fl) \
188 (*(mp)->m_qm_ops.xfs_dqvopchownresv)(tp, ip, dq1, dq2, fl) 191 (*(mp)->m_qm_ops->xfs_dqvopchownresv)(tp, ip, dq1, dq2, fl)
192#define XFS_QM_DQSTATVFS(ip, statp) \
193 (*(ip)->i_mount->m_qm_ops->xfs_dqstatvfs)(ip, statp)
194#define XFS_QM_DQSYNC(mp, flags) \
195 (*(mp)->m_qm_ops->xfs_dqsync)(mp, flags)
196#define XFS_QM_QUOTACTL(mp, cmd, id, addr) \
197 (*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr)
189 198
190 199
191/* 200/*
192 * Prototypes and functions for I/O core modularization. 201 * Prototypes and functions for I/O core modularization.
193 */ 202 */
194 203
195typedef int (*xfs_ioinit_t)(struct bhv_vfs *, 204typedef int (*xfs_ioinit_t)(struct xfs_mount *,
196 struct xfs_mount_args *, int); 205 struct xfs_mount_args *, int);
197typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, 206typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
198 xfs_fileoff_t, xfs_filblks_t, int, 207 xfs_fileoff_t, xfs_filblks_t, int,
@@ -222,7 +231,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint);
222typedef int (*xfs_lock_nowait_t)(void *, uint); 231typedef int (*xfs_lock_nowait_t)(void *, uint);
223typedef void (*xfs_unlk_t)(void *, unsigned int); 232typedef void (*xfs_unlk_t)(void *, unsigned int);
224typedef xfs_fsize_t (*xfs_size_t)(void *); 233typedef xfs_fsize_t (*xfs_size_t)(void *);
225typedef xfs_fsize_t (*xfs_iodone_t)(struct bhv_vfs *); 234typedef xfs_fsize_t (*xfs_iodone_t)(struct xfs_mount *);
226typedef int (*xfs_swap_extents_t)(void *, void *, 235typedef int (*xfs_swap_extents_t)(void *, void *,
227 struct xfs_swapext*); 236 struct xfs_swapext*);
228 237
@@ -245,8 +254,8 @@ typedef struct xfs_ioops {
245 xfs_swap_extents_t xfs_swap_extents_func; 254 xfs_swap_extents_t xfs_swap_extents_func;
246} xfs_ioops_t; 255} xfs_ioops_t;
247 256
248#define XFS_IOINIT(vfsp, args, flags) \ 257#define XFS_IOINIT(mp, args, flags) \
249 (*(mp)->m_io_ops.xfs_ioinit)(vfsp, args, flags) 258 (*(mp)->m_io_ops.xfs_ioinit)(mp, args, flags)
250#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \ 259#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \
251 (*(mp)->m_io_ops.xfs_bmapi_func) \ 260 (*(mp)->m_io_ops.xfs_bmapi_func) \
252 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta) 261 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta)
@@ -280,8 +289,8 @@ typedef struct xfs_ioops {
280 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode) 289 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
281#define XFS_SIZE(mp, io) \ 290#define XFS_SIZE(mp, io) \
282 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj) 291 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
283#define XFS_IODONE(vfsp) \ 292#define XFS_IODONE(mp) \
284 (*(mp)->m_io_ops.xfs_iodone)(vfsp) 293 (*(mp)->m_io_ops.xfs_iodone)(mp)
285#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \ 294#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \
286 (*(mp)->m_io_ops.xfs_swap_extents_func) \ 295 (*(mp)->m_io_ops.xfs_swap_extents_func) \
287 ((io)->io_obj, (tio)->io_obj, sxp) 296 ((io)->io_obj, (tio)->io_obj, sxp)
@@ -318,7 +327,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
318#endif 327#endif
319 328
320typedef struct xfs_mount { 329typedef struct xfs_mount {
321 bhv_desc_t m_bhv; /* vfs xfs behavior */ 330 struct super_block *m_super;
322 xfs_tid_t m_tid; /* next unused tid for fs */ 331 xfs_tid_t m_tid; /* next unused tid for fs */
323 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */ 332 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */
324 xfs_ail_entry_t m_ail; /* fs active log item list */ 333 xfs_ail_entry_t m_ail; /* fs active log item list */
@@ -335,8 +344,6 @@ typedef struct xfs_mount {
335 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ 344 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
336 lock_t m_agirotor_lock;/* .. and lock protecting it */ 345 lock_t m_agirotor_lock;/* .. and lock protecting it */
337 xfs_agnumber_t m_maxagi; /* highest inode alloc group */ 346 xfs_agnumber_t m_maxagi; /* highest inode alloc group */
338 size_t m_ihsize; /* size of next field */
339 struct xfs_ihash *m_ihash; /* fs private inode hash table*/
340 struct xfs_inode *m_inodes; /* active inode list */ 347 struct xfs_inode *m_inodes; /* active inode list */
341 struct list_head m_del_inodes; /* inodes to reclaim */ 348 struct list_head m_del_inodes; /* inodes to reclaim */
342 mutex_t m_ilock; /* inode list mutex */ 349 mutex_t m_ilock; /* inode list mutex */
@@ -362,7 +369,6 @@ typedef struct xfs_mount {
362 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ 369 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
363 __uint8_t m_agno_log; /* log #ag's */ 370 __uint8_t m_agno_log; /* log #ag's */
364 __uint8_t m_agino_log; /* #bits for agino in inum */ 371 __uint8_t m_agino_log; /* #bits for agino in inum */
365 __uint8_t m_nreadaheads; /* #readahead buffers */
366 __uint16_t m_inode_cluster_size;/* min inode buf size */ 372 __uint16_t m_inode_cluster_size;/* min inode buf size */
367 uint m_blockmask; /* sb_blocksize-1 */ 373 uint m_blockmask; /* sb_blocksize-1 */
368 uint m_blockwsize; /* sb_blocksize in words */ 374 uint m_blockwsize; /* sb_blocksize in words */
@@ -378,7 +384,7 @@ typedef struct xfs_mount {
378 uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ 384 uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */
379 struct xfs_perag *m_perag; /* per-ag accounting info */ 385 struct xfs_perag *m_perag; /* per-ag accounting info */
380 struct rw_semaphore m_peraglock; /* lock for m_perag (pointer) */ 386 struct rw_semaphore m_peraglock; /* lock for m_perag (pointer) */
381 sema_t m_growlock; /* growfs mutex */ 387 struct mutex m_growlock; /* growfs mutex */
382 int m_fixedfsid[2]; /* unchanged for life of FS */ 388 int m_fixedfsid[2]; /* unchanged for life of FS */
383 uint m_dmevmask; /* DMI events for this FS */ 389 uint m_dmevmask; /* DMI events for this FS */
384 __uint64_t m_flags; /* global mount flags */ 390 __uint64_t m_flags; /* global mount flags */
@@ -415,8 +421,8 @@ typedef struct xfs_mount {
415 uint m_chsize; /* size of next field */ 421 uint m_chsize; /* size of next field */
416 struct xfs_chash *m_chash; /* fs private inode per-cluster 422 struct xfs_chash *m_chash; /* fs private inode per-cluster
417 * hash table */ 423 * hash table */
418 struct xfs_dmops m_dm_ops; /* vector of DMI ops */ 424 struct xfs_dmops *m_dm_ops; /* vector of DMI ops */
419 struct xfs_qmops m_qm_ops; /* vector of XQM ops */ 425 struct xfs_qmops *m_qm_ops; /* vector of XQM ops */
420 struct xfs_ioops m_io_ops; /* vector of I/O ops */ 426 struct xfs_ioops m_io_ops; /* vector of I/O ops */
421 atomic_t m_active_trans; /* number trans frozen */ 427 atomic_t m_active_trans; /* number trans frozen */
422#ifdef HAVE_PERCPU_SB 428#ifdef HAVE_PERCPU_SB
@@ -426,6 +432,12 @@ typedef struct xfs_mount {
426 struct mutex m_icsb_mutex; /* balancer sync lock */ 432 struct mutex m_icsb_mutex; /* balancer sync lock */
427#endif 433#endif
428 struct xfs_mru_cache *m_filestream; /* per-mount filestream data */ 434 struct xfs_mru_cache *m_filestream; /* per-mount filestream data */
435 struct task_struct *m_sync_task; /* generalised sync thread */
436 bhv_vfs_sync_work_t m_sync_work; /* work item for VFS_SYNC */
437 struct list_head m_sync_list; /* sync thread work item list */
438 spinlock_t m_sync_lock; /* work item list lock */
439 int m_sync_seq; /* sync thread generation no. */
440 wait_queue_head_t m_wait_single_sync_task;
429} xfs_mount_t; 441} xfs_mount_t;
430 442
431/* 443/*
@@ -435,7 +447,7 @@ typedef struct xfs_mount {
435 must be synchronous except 447 must be synchronous except
436 for space allocations */ 448 for space allocations */
437#define XFS_MOUNT_INO64 (1ULL << 1) 449#define XFS_MOUNT_INO64 (1ULL << 1)
438 /* (1ULL << 2) -- currently unused */ 450#define XFS_MOUNT_DMAPI (1ULL << 2) /* dmapi is enabled */
439#define XFS_MOUNT_WAS_CLEAN (1ULL << 3) 451#define XFS_MOUNT_WAS_CLEAN (1ULL << 3)
440#define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem 452#define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem
441 operations, typically for 453 operations, typically for
@@ -445,7 +457,7 @@ typedef struct xfs_mount {
445#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment 457#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment
446 allocations */ 458 allocations */
447#define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */ 459#define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */
448 /* (1ULL << 9) -- currently unused */ 460#define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned from directory */
449#define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ 461#define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */
450#define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */ 462#define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */
451#define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ 463#define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */
@@ -453,13 +465,13 @@ typedef struct xfs_mount {
453 /* osyncisdsync is now default*/ 465 /* osyncisdsync is now default*/
454#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above 466#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above
455 * 32 bits in size */ 467 * 32 bits in size */
456 /* (1ULL << 15) -- currently unused */ 468#define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes */
457#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */ 469#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */
458#define XFS_MOUNT_BARRIER (1ULL << 17) 470#define XFS_MOUNT_BARRIER (1ULL << 17)
459#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ 471#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/
460#define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width 472#define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width
461 * allocation */ 473 * allocation */
462#define XFS_MOUNT_IHASHSIZE (1ULL << 20) /* inode hash table size */ 474#define XFS_MOUNT_RDONLY (1ULL << 20) /* read-only fs */
463#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ 475#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */
464#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred 476#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred
465 * I/O size in stat() */ 477 * I/O size in stat() */
@@ -518,8 +530,10 @@ xfs_preferred_iosize(xfs_mount_t *mp)
518#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ 530#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
519 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) 531 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
520#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) 532#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
533void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
534 int lnnum);
521#define xfs_force_shutdown(m,f) \ 535#define xfs_force_shutdown(m,f) \
522 bhv_vfs_force_shutdown((XFS_MTOVFS(m)), f, __FILE__, __LINE__) 536 xfs_do_force_shutdown(m, f, __FILE__, __LINE__)
523 537
524/* 538/*
525 * Flags for xfs_mountfs 539 * Flags for xfs_mountfs
@@ -533,28 +547,6 @@ xfs_preferred_iosize(xfs_mount_t *mp)
533/* XFS_MFSI_CONVERT_SUNIT */ 547/* XFS_MFSI_CONVERT_SUNIT */
534#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ 548#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */
535 549
536/*
537 * Macros for getting from mount to vfs and back.
538 */
539#define XFS_MTOVFS(mp) xfs_mtovfs(mp)
540static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
541{
542 return bhvtovfs(&mp->m_bhv);
543}
544
545#define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
546static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
547{
548 return (xfs_mount_t *)BHV_PDATA(bdp);
549}
550
551#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
552static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
553{
554 return XFS_BHVTOM(bhv_lookup_range(VFS_BHVHEAD(vfs),
555 VFS_POSITION_XFS, VFS_POSITION_XFS));
556}
557
558#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) 550#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
559static inline xfs_agnumber_t 551static inline xfs_agnumber_t
560xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) 552xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)
@@ -573,6 +565,21 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d)
573} 565}
574 566
575/* 567/*
568 * perag get/put wrappers for eventual ref counting
569 */
570static inline xfs_perag_t *
571xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino)
572{
573 return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)];
574}
575
576static inline void
577xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag)
578{
579 /* nothing to see here, move along */
580}
581
582/*
576 * Per-cpu superblock locking functions 583 * Per-cpu superblock locking functions
577 */ 584 */
578#ifdef HAVE_PERCPU_SB 585#ifdef HAVE_PERCPU_SB
@@ -609,8 +616,8 @@ typedef struct xfs_mod_sb {
609extern xfs_mount_t *xfs_mount_init(void); 616extern xfs_mount_t *xfs_mount_init(void);
610extern void xfs_mod_sb(xfs_trans_t *, __int64_t); 617extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
611extern int xfs_log_sbcount(xfs_mount_t *, uint); 618extern int xfs_log_sbcount(xfs_mount_t *, uint);
612extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv); 619extern void xfs_mount_free(xfs_mount_t *mp);
613extern int xfs_mountfs(struct bhv_vfs *, xfs_mount_t *mp, int); 620extern int xfs_mountfs(xfs_mount_t *mp, int);
614extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); 621extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
615 622
616extern int xfs_unmountfs(xfs_mount_t *, struct cred *); 623extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
@@ -626,16 +633,19 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
626extern int xfs_readsb(xfs_mount_t *, int); 633extern int xfs_readsb(xfs_mount_t *, int);
627extern void xfs_freesb(xfs_mount_t *); 634extern void xfs_freesb(xfs_mount_t *);
628extern int xfs_fs_writable(xfs_mount_t *); 635extern int xfs_fs_writable(xfs_mount_t *);
629extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
630extern int xfs_syncsub(xfs_mount_t *, int, int *); 636extern int xfs_syncsub(xfs_mount_t *, int, int *);
631extern int xfs_sync_inodes(xfs_mount_t *, int, int *); 637extern int xfs_sync_inodes(xfs_mount_t *, int, int *);
632extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, 638extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
633 xfs_agnumber_t); 639extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);
634extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 640extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t);
635extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); 641extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
636 642
637extern struct xfs_dmops xfs_dmcore_stub; 643extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *);
638extern struct xfs_qmops xfs_qmcore_stub; 644extern void xfs_dmops_put(struct xfs_mount *);
645extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *);
646extern void xfs_qmops_put(struct xfs_mount *);
647
648extern struct xfs_dmops xfs_dmcore_xfs;
639extern struct xfs_ioops xfs_iocore_xfs; 649extern struct xfs_ioops xfs_iocore_xfs;
640 650
641extern int xfs_init(void); 651extern int xfs_init(void);