]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/xfs_mount.h
bump version to 1.3.14.
[thirdparty/xfsprogs-dev.git] / include / xfs_mount.h
1 /*
2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
25 *
26 * http://www.sgi.com
27 *
28 * For further information regarding this notice, see:
29 *
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31 */
32 #ifndef __XFS_MOUNT_H__
33 #define __XFS_MOUNT_H__
34
35
36 typedef struct xfs_trans_reservations {
37 uint tr_write; /* extent alloc trans */
38 uint tr_itruncate; /* truncate trans */
39 uint tr_rename; /* rename trans */
40 uint tr_link; /* link trans */
41 uint tr_remove; /* unlink trans */
42 uint tr_symlink; /* symlink trans */
43 uint tr_create; /* create trans */
44 uint tr_mkdir; /* mkdir trans */
45 uint tr_ifree; /* inode free trans */
46 uint tr_ichange; /* inode update trans */
47 uint tr_growdata; /* fs data section grow trans */
48 uint tr_swrite; /* sync write inode trans */
49 uint tr_addafork; /* cvt inode to attributed trans */
50 uint tr_writeid; /* write setuid/setgid file */
51 uint tr_attrinval; /* attr fork buffer invalidation */
52 uint tr_attrset; /* set/create an attribute */
53 uint tr_attrrm; /* remove an attribute */
54 uint tr_clearagi; /* clear bad agi unlinked ino bucket */
55 uint tr_growrtalloc; /* grow realtime allocations */
56 uint tr_growrtzero; /* grow realtime zeroing */
57 uint tr_growrtfree; /* grow realtime freeing */
58 } xfs_trans_reservations_t;
59
60
61 #ifndef __KERNEL__
62 /*
63 * Moved here from xfs_ag.h to avoid reordering header files
64 */
65 #define XFS_DADDR_TO_AGNO(mp,d) \
66 ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks))
67 #define XFS_DADDR_TO_AGBNO(mp,d) \
68 ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks))
69 #else
70 struct cred;
71 struct mounta;
72 struct vfs;
73 struct vnode;
74 struct xfs_args;
75 struct xfs_ihash;
76 struct xfs_chash;
77 struct xfs_inode;
78 struct xfs_perag;
79 struct xfs_quotainfo;
80 struct xfs_iocore;
81 struct xfs_dio;
82 struct xfs_bmbt_irec;
83 struct xfs_bmap_free;
84
85 #if defined(INTERRUPT_LATENCY_TESTING)
86 #define SPLDECL(s)
87 #define AIL_LOCK_T mutex_t
88 #define AIL_LOCKINIT(x,y) mutex_init(x,MUTEX_DEFAULT, y)
89 #define AIL_LOCK_DESTROY(x) mutex_destroy(x)
90 #define AIL_LOCK(mp,s) mutex_lock(&(mp)->m_ail_lock, PZERO)
91 #define AIL_UNLOCK(mp,s) mutex_unlock(&(mp)->m_ail_lock)
92 #else /* !INTERRUPT_LATENCY_TESTING */
93 #define SPLDECL(s) int s
94 #define AIL_LOCK_T lock_t
95 #define AIL_LOCKINIT(x,y) spinlock_init(x,y)
96 #define AIL_LOCK_DESTROY(x) spinlock_destroy(x)
97 #define AIL_LOCK(mp,s) s=mutex_spinlock(&(mp)->m_ail_lock)
98 #define AIL_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_ail_lock, s)
99 #endif /* !INTERRUPT_LATENCY_TESTING */
100
101
102 /* Prototypes and functions for I/O core modularization, a vector
103 * of functions is used to indirect from xfs/cxfs independent code
104 * to the xfs/cxfs dependent code.
105 * The vector is placed in the mount structure so that we can
106 * minimize the number of memory indirections involved.
107 */
108
109 typedef int (*xfs_dio_write_t)(struct xfs_dio *);
110 typedef int (*xfs_dio_read_t)(struct xfs_dio *);
111 typedef int (*xfs_strat_write_t)(struct xfs_iocore *, struct xfs_buf *);
112 typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
113 xfs_fileoff_t, xfs_filblks_t, int,
114 xfs_fsblock_t *, xfs_extlen_t,
115 struct xfs_bmbt_irec *, int *,
116 struct xfs_bmap_free *);
117 typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *);
118 typedef int (*xfs_rsync_t)(void *, int, xfs_off_t, xfs_off_t);
119 typedef uint (*xfs_lck_map_shared_t)(void *);
120 typedef void (*xfs_lock_t)(void *, uint);
121 typedef void (*xfs_lock_demote_t)(void *, uint);
122 typedef int (*xfs_lock_nowait_t)(void *, uint);
123 typedef void (*xfs_unlk_t)(void *, unsigned int);
124 typedef void (*xfs_chgtime_t)(void *, int);
125 typedef xfs_fsize_t (*xfs_size_t)(void *);
126 typedef xfs_fsize_t (*xfs_setsize_t)(void *, xfs_off_t);
127 typedef xfs_fsize_t (*xfs_lastbyte_t)(void *);
128
129 #ifdef CELL_CAPABLE
130 typedef int (*xfs_checklock_t)(bhv_desc_t *, struct vnode *,
131 int, off_t, off_t, int, struct cred *,
132 struct flid *, vrwlock_t, int);
133 #endif
134
135 typedef struct xfs_ioops {
136 xfs_dio_write_t xfs_dio_write_func;
137 xfs_dio_read_t xfs_dio_read_func;
138 xfs_strat_write_t xfs_strat_write_func;
139 xfs_bmapi_t xfs_bmapi_func;
140 xfs_bmap_eof_t xfs_bmap_eof_func;
141 xfs_rsync_t xfs_rsync_func;
142 xfs_lck_map_shared_t xfs_lck_map_shared;
143 xfs_lock_t xfs_ilock;
144 xfs_lock_demote_t xfs_ilock_demote;
145 xfs_lock_nowait_t xfs_ilock_nowait;
146 xfs_unlk_t xfs_unlock;
147 xfs_chgtime_t xfs_chgtime;
148 xfs_size_t xfs_size_func;
149 xfs_setsize_t xfs_setsize_func;
150 xfs_lastbyte_t xfs_lastbyte;
151 #ifdef CELL_CAPABLE
152 xfs_checklock_t xfs_checklock;
153 #endif
154 } xfs_ioops_t;
155
156
157 #define XFS_DIO_WRITE(mp, diop) \
158 (*(mp)->m_io_ops.xfs_dio_write_func)(diop)
159
160 #define XFS_DIO_READ(mp, diop) \
161 (*(mp)->m_io_ops.xfs_dio_read_func)(diop)
162
163 #define XFS_STRAT_WRITE(mp, io, bp) \
164 (*(mp)->m_io_ops.xfs_strat_write_func)(io, bp)
165
166 #define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist) \
167 (*(mp)->m_io_ops.xfs_bmapi_func) \
168 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist)
169
170 #define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \
171 (*(mp)->m_io_ops.xfs_bmap_eof_func) \
172 ((io)->io_obj, endoff, whichfork, eof)
173
174 #define XFS_RSYNC(mp, io, ioflag, start, end) \
175 (*(mp)->m_io_ops.xfs_rsync_func)((io)->io_obj, ioflag, start, end)
176
177 #define XFS_LCK_MAP_SHARED(mp, io) \
178 (*(mp)->m_io_ops.xfs_lck_map_shared)((io)->io_obj)
179
180 #define XFS_UNLK_MAP_SHARED(mp, io, mode) \
181 (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode)
182
183 #define XFS_ILOCK(mp, io, mode) \
184 (*(mp)->m_io_ops.xfs_ilock)((io)->io_obj, mode)
185
186 #define XFS_ILOCK_NOWAIT(mp, io, mode) \
187 (*(mp)->m_io_ops.xfs_ilock_nowait)((io)->io_obj, mode)
188
189 #define XFS_IUNLOCK(mp, io, mode) \
190 (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode)
191
192 #define XFS_ILOCK_DEMOTE(mp, io, mode) \
193 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
194
195 #define XFS_CHGTIME(mp, io, flags) \
196 (*(mp)->m_io_ops.xfs_chgtime)((io)->io_obj, flags)
197
198 #define XFS_SIZE(mp, io) \
199 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
200
201 #define XFS_SETSIZE(mp, io, newsize) \
202 (*(mp)->m_io_ops.xfs_setsize_func)((io)->io_obj, newsize)
203
204 #define XFS_LASTBYTE(mp, io) \
205 (*(mp)->m_io_ops.xfs_lastbyte)((io)->io_obj)
206
207
208 typedef struct xfs_mount {
209 bhv_desc_t m_bhv; /* vfs xfs behavior */
210 xfs_tid_t m_tid; /* next unused tid for fs */
211 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */
212 xfs_ail_entry_t m_ail; /* fs active log item list */
213 uint m_ail_gen; /* fs AIL generation count */
214 xfs_sb_t m_sb; /* copy of fs superblock */
215 lock_t m_sb_lock; /* sb counter mutex */
216 struct xfs_buf *m_sb_bp; /* buffer for superblock */
217 char *m_fsname; /* filesystem name */
218 int m_fsname_len; /* strlen of fs name */
219 int m_bsize; /* fs logical block size */
220 xfs_agnumber_t m_agfrotor; /* last ag where space found */
221 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
222 xfs_agnumber_t m_maxagi; /* highest inode alloc group */
223 int m_ihsize; /* size of next field */
224 struct xfs_ihash *m_ihash; /* fs private inode hash table*/
225 struct xfs_inode *m_inodes; /* active inode list */
226 mutex_t m_ilock; /* inode list mutex */
227 uint m_ireclaims; /* count of calls to reclaim*/
228 uint m_readio_log; /* min read size log bytes */
229 uint m_readio_blocks; /* min read size blocks */
230 uint m_writeio_log; /* min write size log bytes */
231 uint m_writeio_blocks; /* min write size blocks */
232 void *m_log; /* log specific stuff */
233 int m_logbufs; /* number of log buffers */
234 int m_logbsize; /* size of each log buffer */
235 uint m_rsumlevels; /* rt summary levels */
236 uint m_rsumsize; /* size of rt summary, bytes */
237 struct xfs_inode *m_rbmip; /* pointer to bitmap inode */
238 struct xfs_inode *m_rsumip; /* pointer to summary inode */
239 struct xfs_inode *m_rootip; /* pointer to root directory */
240 struct xfs_quotainfo *m_quotainfo; /* disk quota information */
241 buftarg_t m_ddev_targ; /* ptr to data device */
242 buftarg_t m_logdev_targ; /* ptr to log device */
243 buftarg_t m_rtdev_targ; /* ptr to rt device */
244 buftarg_t *m_ddev_targp; /* saves taking the address */
245 #define m_rtdev_targp(m)(&(m)->m_rtdev_targ)
246 #define m_dev m_ddev_targ.dev
247 #define m_logdev m_logdev_targ.dev
248 #define m_rtdev m_rtdev_targ.dev
249 __uint8_t m_dircook_elog; /* log d-cookie entry bits */
250 __uint8_t m_blkbit_log; /* blocklog + NBBY */
251 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
252 __uint8_t m_agno_log; /* log #ag's */
253 __uint8_t m_agino_log; /* #bits for agino in inum */
254 __uint8_t m_nreadaheads; /* #readahead buffers */
255 __uint16_t m_inode_cluster_size;/* min inode buf size */
256 uint m_blockmask; /* sb_blocksize-1 */
257 uint m_blockwsize; /* sb_blocksize in words */
258 uint m_blockwmask; /* blockwsize-1 */
259 uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS */
260 uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS */
261 uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS */
262 uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */
263 uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS */
264 uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS */
265 uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */
266 uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */
267 uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */
268 struct xfs_perag *m_perag; /* per-ag accounting info */
269 mrlock_t m_peraglock; /* lock for m_perag (pointer) */
270 sema_t m_growlock; /* growfs mutex */
271 int m_fixedfsid[2]; /* unchanged for life of FS */
272 uint m_dmevmask; /* DMI events for this FS */
273 uint m_flags; /* global mount flags */
274 uint m_attroffset; /* inode attribute offset */
275 int m_da_node_ents; /* how many entries in danode */
276 int m_ialloc_inos; /* inodes in inode allocation */
277 int m_ialloc_blks; /* blocks in inode allocation */
278 int m_litino; /* size of inode union area */
279 int m_inoalign_mask;/* mask sb_inoalignmt if used */
280 uint m_qflags; /* quota status flags */
281 xfs_trans_reservations_t m_reservations;/* precomputed res values */
282 __uint64_t m_maxicount; /* maximum inode count */
283 __uint64_t m_resblks; /* total reserved blocks */
284 __uint64_t m_resblks_avail;/* available reserved blocks */
285 #if XFS_BIG_FILESYSTEMS
286 xfs_ino_t m_inoadd; /* add value for ino64_offset */
287 #endif
288 int m_dalign; /* stripe unit */
289 int m_swidth; /* stripe width */
290 int m_sinoalign; /* stripe unit inode alignmnt */
291 int m_attr_magicpct;/* 37% of the blocksize */
292 int m_dir_magicpct; /* 37% of the dir blocksize */
293 __uint8_t m_mk_sharedro; /* mark shared ro on unmount */
294 __uint8_t m_inode_quiesce;/* call quiesce on new inodes.
295 field governed by m_ilock */
296 __uint8_t m_dirversion; /* 1 or 2 */
297 xfs_dirops_t m_dirops; /* table of dir funcs */
298 int m_dirblksize; /* directory block sz--bytes */
299 int m_dirblkfsbs; /* directory block sz--fsbs */
300 xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */
301 xfs_dablk_t m_dirleafblk; /* blockno of dir non-data v2 */
302 xfs_dablk_t m_dirfreeblk; /* blockno of dirfreeindex v2 */
303 int m_chsize; /* size of next field */
304 struct xfs_chash *m_chash; /* fs private inode per-cluster
305 * hash table */
306 struct xfs_ioops m_io_ops; /* vector of I/O ops */
307 struct xfs_expinfo *m_expinfo; /* info to export to other
308 cells. */
309 uint64_t m_shadow_pinmask;
310 /* which bits matter in rpc
311 log item pin masks */
312 uint m_cxfstype; /* mounted shared, etc. */
313 lock_t m_freeze_lock; /* Lock for m_frozen */
314 uint m_frozen; /* FS frozen for shutdown or
315 * snapshot */
316 sv_t m_wait_unfreeze;/* waiting to unfreeze */
317 atomic_t m_active_trans; /* number trans frozen */
318 } xfs_mount_t;
319
320 /*
321 * Flags for m_flags.
322 */
323 #define XFS_MOUNT_WSYNC 0x00000001 /* for nfs - all metadata ops
324 must be synchronous except
325 for space allocations */
326 #if XFS_BIG_FILESYSTEMS
327 #define XFS_MOUNT_INO64 0x00000002
328 #endif
329 #define XFS_MOUNT_ROOTQCHECK 0x00000004
330 /* 0x00000008 -- currently unused */
331 #define XFS_MOUNT_FS_SHUTDOWN 0x00000010 /* atomic stop of all filesystem
332 operations, typically for
333 disk errors in metadata */
334 #define XFS_MOUNT_NOATIME 0x00000020 /* don't modify inode access
335 times on reads */
336 #define XFS_MOUNT_RETERR 0x00000040 /* return alignment errors to
337 user */
338 #define XFS_MOUNT_NOALIGN 0x00000080 /* turn off stripe alignment
339 allocations */
340 /* 0x00000100 -- currently unused */
341 #define XFS_MOUNT_REGISTERED 0x00000200 /* registered with cxfs master
342 cell logic */
343 #define XFS_MOUNT_NORECOVERY 0x00000400 /* no recovery - dirty fs */
344 #define XFS_MOUNT_SHARED 0x00000800 /* shared mount */
345 #define XFS_MOUNT_DFLT_IOSIZE 0x00001000 /* set default i/o size */
346 #define XFS_MOUNT_OSYNCISDSYNC 0x00002000 /* treat o_sync like o_dsync */
347 #define XFS_MOUNT_NOUUID 0x00004000 /* ignore uuid during mount */
348 #define XFS_MOUNT_32BITINODES 0x00008000 /* do not create inodes above
349 * 32 bits in size */
350
351 /*
352 * Flags for m_cxfstype
353 */
354 #define XFS_CXFS_NOT 0x00000001 /* local mount */
355 #define XFS_CXFS_SERVER 0x00000002 /* we're the CXFS server */
356 #define XFS_CXFS_CLIENT 0x00000004 /* We're a CXFS client */
357 #define XFS_CXFS_REC_ENABLED 0x00000008 /* recovery is enabled */
358
359 #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
360
361 /*
362 * Default minimum read and write sizes.
363 */
364 #define XFS_READIO_LOG_LARGE 12 /* > 32MB memory */
365 #define XFS_WRITEIO_LOG_LARGE 12
366
367 /*
368 * max and min values for UIO and mount-option defined I/O sizes
369 * min value can't be less than a page. Lower limit for 4K machines
370 * is 4K because that's what was tested.
371 */
372 #define XFS_MAX_IO_LOG 16 /* 64K */
373
374 #if (_PAGESZ == 16384) || (_PAGESZ == 8192)
375 #define XFS_MIN_IO_LOG 14 /* 16K */
376 #elif _PAGESZ == 4096
377 #define XFS_MIN_IO_LOG 12 /* 4K */
378 #else
379 #error "Unknown page size"
380 #endif
381
382
383 /*
384 * Synchronous read and write sizes. This should be
385 * better for NFSv2 wsync filesystems.
386 */
387 #define XFS_WSYNC_READIO_LOG 15 /* 32K */
388 #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */
389
390 #define xfs_force_shutdown(m,f) _xfs_force_shutdown(m,f,__FILE__,__LINE__);
391 /*
392 * Flags sent to xfs_force_shutdown.
393 */
394 #define XFS_METADATA_IO_ERROR 0x1
395 #define XFS_LOG_IO_ERROR 0x2
396 #define XFS_FORCE_UMOUNT 0x4
397 #define XFS_CORRUPT_INCORE 0x8 /* corrupt in-memory data structures */
398 #if CELL_CAPABLE
399 #define XFS_SHUTDOWN_REMOTE_REQ 0x10 /* shutdown req came from remote cell */
400 #endif
401
402 /*
403 * xflags for xfs_syncsub
404 */
405 #define XFS_XSYNC_RELOC 0x01
406
407 /*
408 * Flags for xfs_mountfs
409 */
410 #define XFS_MFSI_SECOND 0x01 /* Is a cxfs secondary mount -- skip */
411 /* stuff which should only be done */
412 /* once. */
413 #define XFS_MFSI_CLIENT 0x02 /* Is a client -- skip lots of stuff */
414 #define XFS_MFSI_NOUNLINK 0x08 /* Skip unlinked inode processing in */
415 /* log recovery */
416
417 /*
418 * Macros for getting from mount to vfs and back.
419 */
420 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS)
421 struct vfs *xfs_mtovfs(xfs_mount_t *mp);
422 #define XFS_MTOVFS(mp) xfs_mtovfs(mp)
423 #else
424 #define XFS_MTOVFS(mp) (bhvtovfs(&(mp)->m_bhv))
425 #endif
426 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM)
427 xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp);
428 #define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
429 #else
430 #define XFS_BHVTOM(bdp) ((xfs_mount_t *)BHV_PDATA(bdp))
431 #endif
432
433
434 /*
435 * Moved here from xfs_ag.h to avoid reordering header files
436 */
437
438 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO)
439 xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d);
440 #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
441 #else
442
443 static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d)
444 {
445 d = XFS_BB_TO_FSBT(mp, d);
446 do_div(d, mp->m_sb.sb_agblocks);
447 return (xfs_agnumber_t) d;
448 }
449
450 #endif
451 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO)
452 xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d);
453 #define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d)
454 #else
455
456 static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d)
457 {
458 d = XFS_BB_TO_FSBT(mp, d);
459 return (xfs_agblock_t) do_div(d, mp->m_sb.sb_agblocks);
460 }
461
462 #endif
463
464 /*
465 * This structure is for use by the xfs_mod_incore_sb_batch() routine.
466 */
467 typedef struct xfs_mod_sb {
468 xfs_sb_field_t msb_field; /* Field to modify, see below */
469 int msb_delta; /* change to make to the specified field */
470 } xfs_mod_sb_t;
471
472 #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock), PINOD)
473 #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock))
474 #define XFS_SB_LOCK(mp) mutex_spinlock(&(mp)->m_sb_lock)
475 #define XFS_SB_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_sb_lock,(s))
476
477 void xfs_mod_sb(xfs_trans_t *, __int64_t);
478 xfs_mount_t *xfs_mount_init(void);
479 void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
480 int xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
481 int xfs_mountargs(struct mounta *, struct xfs_args *);
482
483 int xfs_unmountfs(xfs_mount_t *, int, struct cred *);
484 void xfs_unmountfs_close(xfs_mount_t *, int, struct cred *);
485 int xfs_unmountfs_writesb(xfs_mount_t *);
486 int xfs_unmount_flush(xfs_mount_t *, int);
487 int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int);
488 int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, uint, int);
489 int xfs_readsb(xfs_mount_t *mp, dev_t);
490 struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
491 void xfs_freesb(xfs_mount_t *);
492 void _xfs_force_shutdown(struct xfs_mount *, int, char *, int);
493 int xfs_syncsub(xfs_mount_t *, int, int, int *);
494 void xfs_initialize_perag(xfs_mount_t *, int);
495 void xfs_xlatesb(void *, struct xfs_sb *, int, xfs_arch_t, __int64_t);
496
497 /*
498 * Flags for freeze operations.
499 */
500 #define XFS_FREEZE_WRITE 1
501 #define XFS_FREEZE_TRANS 2
502
503 void xfs_start_freeze(xfs_mount_t *, int);
504 void xfs_finish_freeze(xfs_mount_t *);
505 void xfs_check_frozen(xfs_mount_t *, bhv_desc_t *, int, int);
506
507 extern struct vfsops xfs_vfsops;
508
509 #endif /* __KERNEL__ */
510
511 #endif /* __XFS_MOUNT_H__ */