]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/xfs_mount.h
Update copyright dates
[thirdparty/xfsprogs-dev.git] / include / xfs_mount.h
1 /*
2 * Copyright (c) 2000-2002 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 #define SPLDECL(s) unsigned long s
86 #define AIL_LOCK_T lock_t
87 #define AIL_LOCKINIT(x,y) spinlock_init(x,y)
88 #define AIL_LOCK_DESTROY(x) spinlock_destroy(x)
89 #define AIL_LOCK(mp,s) s=mutex_spinlock(&(mp)->m_ail_lock)
90 #define AIL_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_ail_lock, s)
91
92
93 /* Prototypes and functions for I/O core modularization, a vector
94 * of functions is used to indirect from xfs/cxfs independent code
95 * to the xfs/cxfs dependent code.
96 * The vector is placed in the mount structure so that we can
97 * minimize the number of memory indirections involved.
98 */
99
100 typedef int (*xfs_dio_write_t)(struct xfs_dio *);
101 typedef int (*xfs_dio_read_t)(struct xfs_dio *);
102 typedef int (*xfs_strat_write_t)(struct xfs_iocore *, struct xfs_buf *);
103 typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
104 xfs_fileoff_t, xfs_filblks_t, int,
105 xfs_fsblock_t *, xfs_extlen_t,
106 struct xfs_bmbt_irec *, int *,
107 struct xfs_bmap_free *);
108 typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *);
109 typedef int (*xfs_rsync_t)(void *, int, xfs_off_t, xfs_off_t);
110 typedef uint (*xfs_lck_map_shared_t)(void *);
111 typedef void (*xfs_lock_t)(void *, uint);
112 typedef void (*xfs_lock_demote_t)(void *, uint);
113 typedef int (*xfs_lock_nowait_t)(void *, uint);
114 typedef void (*xfs_unlk_t)(void *, unsigned int);
115 typedef void (*xfs_chgtime_t)(void *, int);
116 typedef xfs_fsize_t (*xfs_size_t)(void *);
117 typedef xfs_fsize_t (*xfs_setsize_t)(void *, xfs_off_t);
118 typedef xfs_fsize_t (*xfs_lastbyte_t)(void *);
119
120 #ifdef CELL_CAPABLE
121 typedef int (*xfs_checklock_t)(bhv_desc_t *, struct vnode *,
122 int, off_t, off_t, int, struct cred *,
123 struct flid *, vrwlock_t, int);
124 #endif
125
126 typedef struct xfs_ioops {
127 xfs_dio_write_t xfs_dio_write_func;
128 xfs_dio_read_t xfs_dio_read_func;
129 xfs_strat_write_t xfs_strat_write_func;
130 xfs_bmapi_t xfs_bmapi_func;
131 xfs_bmap_eof_t xfs_bmap_eof_func;
132 xfs_rsync_t xfs_rsync_func;
133 xfs_lck_map_shared_t xfs_lck_map_shared;
134 xfs_lock_t xfs_ilock;
135 xfs_lock_demote_t xfs_ilock_demote;
136 xfs_lock_nowait_t xfs_ilock_nowait;
137 xfs_unlk_t xfs_unlock;
138 xfs_chgtime_t xfs_chgtime;
139 xfs_size_t xfs_size_func;
140 xfs_setsize_t xfs_setsize_func;
141 xfs_lastbyte_t xfs_lastbyte;
142 #ifdef CELL_CAPABLE
143 xfs_checklock_t xfs_checklock;
144 #endif
145 } xfs_ioops_t;
146
147
148 #define XFS_DIO_WRITE(mp, diop) \
149 (*(mp)->m_io_ops.xfs_dio_write_func)(diop)
150
151 #define XFS_DIO_READ(mp, diop) \
152 (*(mp)->m_io_ops.xfs_dio_read_func)(diop)
153
154 #define XFS_STRAT_WRITE(mp, io, bp) \
155 (*(mp)->m_io_ops.xfs_strat_write_func)(io, bp)
156
157 #define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist) \
158 (*(mp)->m_io_ops.xfs_bmapi_func) \
159 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist)
160
161 #define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \
162 (*(mp)->m_io_ops.xfs_bmap_eof_func) \
163 ((io)->io_obj, endoff, whichfork, eof)
164
165 #define XFS_RSYNC(mp, io, ioflag, start, end) \
166 (*(mp)->m_io_ops.xfs_rsync_func)((io)->io_obj, ioflag, start, end)
167
168 #define XFS_LCK_MAP_SHARED(mp, io) \
169 (*(mp)->m_io_ops.xfs_lck_map_shared)((io)->io_obj)
170
171 #define XFS_UNLK_MAP_SHARED(mp, io, mode) \
172 (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode)
173
174 #define XFS_ILOCK(mp, io, mode) \
175 (*(mp)->m_io_ops.xfs_ilock)((io)->io_obj, mode)
176
177 #define XFS_ILOCK_NOWAIT(mp, io, mode) \
178 (*(mp)->m_io_ops.xfs_ilock_nowait)((io)->io_obj, mode)
179
180 #define XFS_IUNLOCK(mp, io, mode) \
181 (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode)
182
183 #define XFS_ILOCK_DEMOTE(mp, io, mode) \
184 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
185
186 #define XFS_CHGTIME(mp, io, flags) \
187 (*(mp)->m_io_ops.xfs_chgtime)((io)->io_obj, flags)
188
189 #define XFS_SIZE(mp, io) \
190 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
191
192 #define XFS_SETSIZE(mp, io, newsize) \
193 (*(mp)->m_io_ops.xfs_setsize_func)((io)->io_obj, newsize)
194
195 #define XFS_LASTBYTE(mp, io) \
196 (*(mp)->m_io_ops.xfs_lastbyte)((io)->io_obj)
197
198
199 typedef struct xfs_mount {
200 bhv_desc_t m_bhv; /* vfs xfs behavior */
201 xfs_tid_t m_tid; /* next unused tid for fs */
202 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */
203 xfs_ail_entry_t m_ail; /* fs active log item list */
204 uint m_ail_gen; /* fs AIL generation count */
205 xfs_sb_t m_sb; /* copy of fs superblock */
206 lock_t m_sb_lock; /* sb counter mutex */
207 struct xfs_buf *m_sb_bp; /* buffer for superblock */
208 char *m_fsname; /* filesystem name */
209 int m_fsname_len; /* strlen of fs name */
210 int m_bsize; /* fs logical block size */
211 xfs_agnumber_t m_agfrotor; /* last ag where space found */
212 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
213 xfs_agnumber_t m_maxagi; /* highest inode alloc group */
214 int m_ihsize; /* size of next field */
215 struct xfs_ihash *m_ihash; /* fs private inode hash table*/
216 struct xfs_inode *m_inodes; /* active inode list */
217 mutex_t m_ilock; /* inode list mutex */
218 uint m_ireclaims; /* count of calls to reclaim*/
219 uint m_readio_log; /* min read size log bytes */
220 uint m_readio_blocks; /* min read size blocks */
221 uint m_writeio_log; /* min write size log bytes */
222 uint m_writeio_blocks; /* min write size blocks */
223 void *m_log; /* log specific stuff */
224 int m_logbufs; /* number of log buffers */
225 int m_logbsize; /* size of each log buffer */
226 uint m_rsumlevels; /* rt summary levels */
227 uint m_rsumsize; /* size of rt summary, bytes */
228 struct xfs_inode *m_rbmip; /* pointer to bitmap inode */
229 struct xfs_inode *m_rsumip; /* pointer to summary inode */
230 struct xfs_inode *m_rootip; /* pointer to root directory */
231 struct xfs_quotainfo *m_quotainfo; /* disk quota information */
232 buftarg_t m_ddev_targ; /* ptr to data device */
233 buftarg_t m_logdev_targ; /* ptr to log device */
234 buftarg_t m_rtdev_targ; /* ptr to rt device */
235 buftarg_t *m_ddev_targp; /* saves taking the address */
236 #define m_rtdev_targp(m)(&(m)->m_rtdev_targ)
237 #define m_dev m_ddev_targ.dev
238 #define m_logdev m_logdev_targ.dev
239 #define m_rtdev m_rtdev_targ.dev
240 __uint8_t m_dircook_elog; /* log d-cookie entry bits */
241 __uint8_t m_blkbit_log; /* blocklog + NBBY */
242 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
243 __uint8_t m_agno_log; /* log #ag's */
244 __uint8_t m_agino_log; /* #bits for agino in inum */
245 __uint8_t m_nreadaheads; /* #readahead buffers */
246 __uint16_t m_inode_cluster_size;/* min inode buf size */
247 uint m_blockmask; /* sb_blocksize-1 */
248 uint m_blockwsize; /* sb_blocksize in words */
249 uint m_blockwmask; /* blockwsize-1 */
250 uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS */
251 uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS */
252 uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS */
253 uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */
254 uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS */
255 uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS */
256 uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */
257 uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */
258 uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */
259 struct xfs_perag *m_perag; /* per-ag accounting info */
260 struct rw_semaphore m_peraglock; /* lock for m_perag (pointer) */
261 sema_t m_growlock; /* growfs mutex */
262 int m_fixedfsid[2]; /* unchanged for life of FS */
263 uint m_dmevmask; /* DMI events for this FS */
264 uint m_flags; /* global mount flags */
265 uint m_attroffset; /* inode attribute offset */
266 int m_da_node_ents; /* how many entries in danode */
267 int m_ialloc_inos; /* inodes in inode allocation */
268 int m_ialloc_blks; /* blocks in inode allocation */
269 int m_litino; /* size of inode union area */
270 int m_inoalign_mask;/* mask sb_inoalignmt if used */
271 uint m_qflags; /* quota status flags */
272 xfs_trans_reservations_t m_reservations;/* precomputed res values */
273 __uint64_t m_maxicount; /* maximum inode count */
274 __uint64_t m_resblks; /* total reserved blocks */
275 __uint64_t m_resblks_avail;/* available reserved blocks */
276 #if XFS_BIG_FILESYSTEMS
277 xfs_ino_t m_inoadd; /* add value for ino64_offset */
278 #endif
279 int m_dalign; /* stripe unit */
280 int m_swidth; /* stripe width */
281 int m_sinoalign; /* stripe unit inode alignmnt */
282 int m_attr_magicpct;/* 37% of the blocksize */
283 int m_dir_magicpct; /* 37% of the dir blocksize */
284 __uint8_t m_mk_sharedro; /* mark shared ro on unmount */
285 __uint8_t m_inode_quiesce;/* call quiesce on new inodes.
286 field governed by m_ilock */
287 __uint8_t m_dirversion; /* 1 or 2 */
288 xfs_dirops_t m_dirops; /* table of dir funcs */
289 int m_dirblksize; /* directory block sz--bytes */
290 int m_dirblkfsbs; /* directory block sz--fsbs */
291 xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */
292 xfs_dablk_t m_dirleafblk; /* blockno of dir non-data v2 */
293 xfs_dablk_t m_dirfreeblk; /* blockno of dirfreeindex v2 */
294 int m_chsize; /* size of next field */
295 struct xfs_chash *m_chash; /* fs private inode per-cluster
296 * hash table */
297 struct xfs_ioops m_io_ops; /* vector of I/O ops */
298 struct xfs_expinfo *m_expinfo; /* info to export to other
299 cells. */
300 uint64_t m_shadow_pinmask;
301 /* which bits matter in rpc
302 log item pin masks */
303 uint m_cxfstype; /* mounted shared, etc. */
304 lock_t m_freeze_lock; /* Lock for m_frozen */
305 uint m_frozen; /* FS frozen for shutdown or
306 * snapshot */
307 sv_t m_wait_unfreeze;/* waiting to unfreeze */
308 atomic_t m_active_trans; /* number trans frozen */
309 struct timer_list m_sbdirty_timer;/* superblock dirty timer
310 * for nfs refcache */
311 } xfs_mount_t;
312
313 /*
314 * Flags for m_flags.
315 */
316 #define XFS_MOUNT_WSYNC 0x00000001 /* for nfs - all metadata ops
317 must be synchronous except
318 for space allocations */
319 #if XFS_BIG_FILESYSTEMS
320 #define XFS_MOUNT_INO64 0x00000002
321 #endif
322 #define XFS_MOUNT_ROOTQCHECK 0x00000004
323 /* 0x00000008 -- currently unused */
324 #define XFS_MOUNT_FS_SHUTDOWN 0x00000010 /* atomic stop of all filesystem
325 operations, typically for
326 disk errors in metadata */
327 #define XFS_MOUNT_NOATIME 0x00000020 /* don't modify inode access
328 times on reads */
329 #define XFS_MOUNT_RETERR 0x00000040 /* return alignment errors to
330 user */
331 #define XFS_MOUNT_NOALIGN 0x00000080 /* turn off stripe alignment
332 allocations */
333 /* 0x00000100 -- currently unused */
334 #define XFS_MOUNT_REGISTERED 0x00000200 /* registered with cxfs master
335 cell logic */
336 #define XFS_MOUNT_NORECOVERY 0x00000400 /* no recovery - dirty fs */
337 #define XFS_MOUNT_SHARED 0x00000800 /* shared mount */
338 #define XFS_MOUNT_DFLT_IOSIZE 0x00001000 /* set default i/o size */
339 #define XFS_MOUNT_OSYNCISOSYNC 0x00002000 /* o_sync is REALLY o_sync */
340 /* osyncisdsync is now default*/
341 #define XFS_MOUNT_NOUUID 0x00004000 /* ignore uuid during mount */
342 #define XFS_MOUNT_32BITINODES 0x00008000 /* do not create inodes above
343 * 32 bits in size */
344 #define XFS_MOUNT_IRIXSGID 0x00010000 /* Irix-style sgid inheritance */
345 #define XFS_MOUNT_NOLOGFLUSH 0x00020000
346
347 /*
348 * Flags for m_cxfstype
349 */
350 #define XFS_CXFS_NOT 0x00000001 /* local mount */
351 #define XFS_CXFS_SERVER 0x00000002 /* we're the CXFS server */
352 #define XFS_CXFS_CLIENT 0x00000004 /* We're a CXFS client */
353 #define XFS_CXFS_REC_ENABLED 0x00000008 /* recovery is enabled */
354
355 #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
356
357 /*
358 * Default minimum read and write sizes.
359 */
360 #define XFS_READIO_LOG_LARGE 12 /* > 32MB memory */
361 #define XFS_WRITEIO_LOG_LARGE 12
362
363 /*
364 * Max and min values for UIO and mount-option defined I/O sizes;
365 * min value can't be less than a page. Currently unused.
366 */
367 #define XFS_MAX_IO_LOG 16 /* 64K */
368 #define XFS_MIN_IO_LOG PAGE_SHIFT
369
370 /*
371 * Synchronous read and write sizes. This should be
372 * better for NFSv2 wsync filesystems.
373 */
374 #define XFS_WSYNC_READIO_LOG 15 /* 32K */
375 #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */
376
377 #define xfs_force_shutdown(m,f) _xfs_force_shutdown(m,f,__FILE__,__LINE__);
378 /*
379 * Flags sent to xfs_force_shutdown.
380 */
381 #define XFS_METADATA_IO_ERROR 0x1
382 #define XFS_LOG_IO_ERROR 0x2
383 #define XFS_FORCE_UMOUNT 0x4
384 #define XFS_CORRUPT_INCORE 0x8 /* corrupt in-memory data structures */
385 #if CELL_CAPABLE
386 #define XFS_SHUTDOWN_REMOTE_REQ 0x10 /* shutdown req came from remote cell */
387 #endif
388
389 /*
390 * xflags for xfs_syncsub
391 */
392 #define XFS_XSYNC_RELOC 0x01
393
394 /*
395 * Flags for xfs_mountfs
396 */
397 #define XFS_MFSI_SECOND 0x01 /* Is a cxfs secondary mount -- skip */
398 /* stuff which should only be done */
399 /* once. */
400 #define XFS_MFSI_CLIENT 0x02 /* Is a client -- skip lots of stuff */
401 #define XFS_MFSI_NOUNLINK 0x08 /* Skip unlinked inode processing in */
402 /* log recovery */
403
404 /*
405 * Macros for getting from mount to vfs and back.
406 */
407 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS)
408 struct vfs *xfs_mtovfs(xfs_mount_t *mp);
409 #define XFS_MTOVFS(mp) xfs_mtovfs(mp)
410 #else
411 #define XFS_MTOVFS(mp) (bhvtovfs(&(mp)->m_bhv))
412 #endif
413 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM)
414 xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp);
415 #define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
416 #else
417 #define XFS_BHVTOM(bdp) ((xfs_mount_t *)BHV_PDATA(bdp))
418 #endif
419
420
421 /*
422 * Moved here from xfs_ag.h to avoid reordering header files
423 */
424
425 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO)
426 xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d);
427 #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
428 #else
429
430 static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d)
431 {
432 d = XFS_BB_TO_FSBT(mp, d);
433 do_div(d, mp->m_sb.sb_agblocks);
434 return (xfs_agnumber_t) d;
435 }
436
437 #endif
438 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO)
439 xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d);
440 #define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d)
441 #else
442
443 static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d)
444 {
445 d = XFS_BB_TO_FSBT(mp, d);
446 return (xfs_agblock_t) do_div(d, mp->m_sb.sb_agblocks);
447 }
448
449 #endif
450
451 /*
452 * This structure is for use by the xfs_mod_incore_sb_batch() routine.
453 */
454 typedef struct xfs_mod_sb {
455 xfs_sb_field_t msb_field; /* Field to modify, see below */
456 int msb_delta; /* change to make to the specified field */
457 } xfs_mod_sb_t;
458
459 #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock), PINOD)
460 #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock))
461 #define XFS_SB_LOCK(mp) mutex_spinlock(&(mp)->m_sb_lock)
462 #define XFS_SB_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_sb_lock,(s))
463
464 void xfs_mod_sb(xfs_trans_t *, __int64_t);
465 xfs_mount_t *xfs_mount_init(void);
466 void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
467 int xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
468 int xfs_mountargs(struct mounta *, struct xfs_args *);
469
470 int xfs_unmountfs(xfs_mount_t *, int, struct cred *);
471 void xfs_unmountfs_close(xfs_mount_t *, int, struct cred *);
472 int xfs_unmountfs_writesb(xfs_mount_t *);
473 int xfs_unmount_flush(xfs_mount_t *, int);
474 int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int);
475 int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, uint, int);
476 int xfs_readsb(xfs_mount_t *mp, dev_t);
477 struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
478 void xfs_freesb(xfs_mount_t *);
479 void _xfs_force_shutdown(struct xfs_mount *, int, char *, int);
480 int xfs_syncsub(xfs_mount_t *, int, int, int *);
481 void xfs_initialize_perag(xfs_mount_t *, int);
482 void xfs_xlatesb(void *, struct xfs_sb *, int, xfs_arch_t, __int64_t);
483
484 /*
485 * Flags for freeze operations.
486 */
487 #define XFS_FREEZE_WRITE 1
488 #define XFS_FREEZE_TRANS 2
489
490 void xfs_start_freeze(xfs_mount_t *, int);
491 void xfs_finish_freeze(xfs_mount_t *);
492 void xfs_check_frozen(xfs_mount_t *, bhv_desc_t *, int, int);
493
494 extern struct vfsops xfs_vfsops;
495
496 #endif /* __KERNEL__ */
497
498 #endif /* __XFS_MOUNT_H__ */