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.h186
1 files changed, 93 insertions, 93 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 5affba38a577..08b2e0a5d807 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -1,38 +1,23 @@
1/* 1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
3 * 4 *
4 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or
5 * under the terms of version 2 of the GNU General Public License as 6 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
7 * 8 *
8 * This program is distributed in the hope that it would be useful, but 9 * This program is distributed in the hope that it would be useful,
9 * WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
11 * 13 *
12 * Further, this software is distributed without any warranty that it is 14 * You should have received a copy of the GNU General Public License
13 * free of the rightful claim of any third person regarding infringement 15 * along with this program; if not, write the Free Software Foundation,
14 * or the like. Any license provided herein, whether implied or 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
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 */ 17 */
32#ifndef __XFS_MOUNT_H__ 18#ifndef __XFS_MOUNT_H__
33#define __XFS_MOUNT_H__ 19#define __XFS_MOUNT_H__
34 20
35
36typedef struct xfs_trans_reservations { 21typedef struct xfs_trans_reservations {
37 uint tr_write; /* extent alloc trans */ 22 uint tr_write; /* extent alloc trans */
38 uint tr_itruncate; /* truncate trans */ 23 uint tr_itruncate; /* truncate trans */
@@ -57,7 +42,6 @@ typedef struct xfs_trans_reservations {
57 uint tr_growrtfree; /* grow realtime freeing */ 42 uint tr_growrtfree; /* grow realtime freeing */
58} xfs_trans_reservations_t; 43} xfs_trans_reservations_t;
59 44
60
61#ifndef __KERNEL__ 45#ifndef __KERNEL__
62/* 46/*
63 * Moved here from xfs_ag.h to avoid reordering header files 47 * Moved here from xfs_ag.h to avoid reordering header files
@@ -80,6 +64,9 @@ struct xfs_iocore;
80struct xfs_bmbt_irec; 64struct xfs_bmbt_irec;
81struct xfs_bmap_free; 65struct xfs_bmap_free;
82 66
67extern struct vfsops xfs_vfsops;
68extern struct vnodeops xfs_vnodeops;
69
83#define AIL_LOCK_T lock_t 70#define AIL_LOCK_T lock_t
84#define AIL_LOCKINIT(x,y) spinlock_init(x,y) 71#define AIL_LOCKINIT(x,y) spinlock_init(x,y)
85#define AIL_LOCK_DESTROY(x) spinlock_destroy(x) 72#define AIL_LOCK_DESTROY(x) spinlock_destroy(x)
@@ -292,6 +279,8 @@ typedef struct xfs_mount {
292 struct xfs_buf *m_sb_bp; /* buffer for superblock */ 279 struct xfs_buf *m_sb_bp; /* buffer for superblock */
293 char *m_fsname; /* filesystem name */ 280 char *m_fsname; /* filesystem name */
294 int m_fsname_len; /* strlen of fs name */ 281 int m_fsname_len; /* strlen of fs name */
282 char *m_rtname; /* realtime device name */
283 char *m_logname; /* external log device name */
295 int m_bsize; /* fs logical block size */ 284 int m_bsize; /* fs logical block size */
296 xfs_agnumber_t m_agfrotor; /* last ag where space found */ 285 xfs_agnumber_t m_agfrotor; /* last ag where space found */
297 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ 286 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
@@ -344,7 +333,7 @@ typedef struct xfs_mount {
344 sema_t m_growlock; /* growfs mutex */ 333 sema_t m_growlock; /* growfs mutex */
345 int m_fixedfsid[2]; /* unchanged for life of FS */ 334 int m_fixedfsid[2]; /* unchanged for life of FS */
346 uint m_dmevmask; /* DMI events for this FS */ 335 uint m_dmevmask; /* DMI events for this FS */
347 uint m_flags; /* global mount flags */ 336 __uint64_t m_flags; /* global mount flags */
348 uint m_attroffset; /* inode attribute offset */ 337 uint m_attroffset; /* inode attribute offset */
349 uint m_dir_node_ents; /* #entries in a dir danode */ 338 uint m_dir_node_ents; /* #entries in a dir danode */
350 uint m_attr_node_ents; /* #entries in attr danode */ 339 uint m_attr_node_ents; /* #entries in attr danode */
@@ -389,38 +378,41 @@ typedef struct xfs_mount {
389/* 378/*
390 * Flags for m_flags. 379 * Flags for m_flags.
391 */ 380 */
392#define XFS_MOUNT_WSYNC 0x00000001 /* for nfs - all metadata ops 381#define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops
393 must be synchronous except 382 must be synchronous except
394 for space allocations */ 383 for space allocations */
395#define XFS_MOUNT_INO64 0x00000002 384#define XFS_MOUNT_INO64 (1ULL << 1)
396 /* 0x00000004 -- currently unused */ 385 /* (1ULL << 2) -- currently unused */
397 /* 0x00000008 -- currently unused */ 386 /* (1ULL << 3) -- currently unused */
398#define XFS_MOUNT_FS_SHUTDOWN 0x00000010 /* atomic stop of all filesystem 387#define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem
399 operations, typically for 388 operations, typically for
400 disk errors in metadata */ 389 disk errors in metadata */
401#define XFS_MOUNT_NOATIME 0x00000020 /* don't modify inode access 390#define XFS_MOUNT_NOATIME (1ULL << 5) /* don't modify inode access
402 times on reads */ 391 times on reads */
403#define XFS_MOUNT_RETERR 0x00000040 /* return alignment errors to 392#define XFS_MOUNT_RETERR (1ULL << 6) /* return alignment errors to
404 user */ 393 user */
405#define XFS_MOUNT_NOALIGN 0x00000080 /* turn off stripe alignment 394#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment
406 allocations */ 395 allocations */
407 /* 0x00000100 -- currently unused */ 396#define XFS_MOUNT_COMPAT_ATTR (1ULL << 8) /* do not use attr2 format */
408 /* 0x00000200 -- currently unused */ 397 /* (1ULL << 9) -- currently unused */
409#define XFS_MOUNT_NORECOVERY 0x00000400 /* no recovery - dirty fs */ 398#define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */
410#define XFS_MOUNT_SHARED 0x00000800 /* shared mount */ 399#define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */
411#define XFS_MOUNT_DFLT_IOSIZE 0x00001000 /* set default i/o size */ 400#define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */
412#define XFS_MOUNT_OSYNCISOSYNC 0x00002000 /* o_sync is REALLY o_sync */ 401#define XFS_MOUNT_OSYNCISOSYNC (1ULL << 13) /* o_sync is REALLY o_sync */
413 /* osyncisdsync is now default*/ 402 /* osyncisdsync is now default*/
414#define XFS_MOUNT_32BITINODES 0x00004000 /* do not create inodes above 403#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above
415 * 32 bits in size */ 404 * 32 bits in size */
416#define XFS_MOUNT_32BITINOOPT 0x00008000 /* saved mount option state */ 405 /* (1ULL << 15) -- currently unused */
417#define XFS_MOUNT_NOUUID 0x00010000 /* ignore uuid during mount */ 406#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */
418#define XFS_MOUNT_NOLOGFLUSH 0x00020000 407#define XFS_MOUNT_BARRIER (1ULL << 17)
419#define XFS_MOUNT_IDELETE 0x00040000 /* delete empty inode clusters*/ 408#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/
420#define XFS_MOUNT_SWALLOC 0x00080000 /* turn on stripe width 409#define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width
421 * allocation */ 410 * allocation */
422#define XFS_MOUNT_IHASHSIZE 0x00100000 /* inode hash table size */ 411#define XFS_MOUNT_IHASHSIZE (1ULL << 20) /* inode hash table size */
423#define XFS_MOUNT_DIRSYNC 0x00200000 /* synchronous directory ops */ 412#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */
413#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred
414 * I/O size in stat() */
415
424 416
425/* 417/*
426 * Default minimum read and write sizes. 418 * Default minimum read and write sizes.
@@ -442,6 +434,30 @@ typedef struct xfs_mount {
442#define XFS_WSYNC_READIO_LOG 15 /* 32K */ 434#define XFS_WSYNC_READIO_LOG 15 /* 32K */
443#define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */ 435#define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */
444 436
437/*
438 * Allow large block sizes to be reported to userspace programs if the
439 * "largeio" mount option is used.
440 *
441 * If compatibility mode is specified, simply return the basic unit of caching
442 * so that we don't get inefficient read/modify/write I/O from user apps.
443 * Otherwise....
444 *
445 * If the underlying volume is a stripe, then return the stripe width in bytes
446 * as the recommended I/O size. It is not a stripe and we've set a default
447 * buffered I/O size, return that, otherwise return the compat default.
448 */
449static inline unsigned long
450xfs_preferred_iosize(xfs_mount_t *mp)
451{
452 if (mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)
453 return PAGE_CACHE_SIZE;
454 return (mp->m_swidth ?
455 (mp->m_swidth << mp->m_sb.sb_blocklog) :
456 ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ?
457 (1 << (int)MAX(mp->m_readio_log, mp->m_writeio_log)) :
458 PAGE_CACHE_SIZE));
459}
460
445#define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) 461#define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset)
446 462
447#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) 463#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
@@ -474,57 +490,41 @@ typedef struct xfs_mount {
474/* 490/*
475 * Macros for getting from mount to vfs and back. 491 * Macros for getting from mount to vfs and back.
476 */ 492 */
477#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS)
478struct vfs *xfs_mtovfs(xfs_mount_t *mp);
479#define XFS_MTOVFS(mp) xfs_mtovfs(mp) 493#define XFS_MTOVFS(mp) xfs_mtovfs(mp)
480#else 494static inline struct vfs *xfs_mtovfs(xfs_mount_t *mp)
481#define XFS_MTOVFS(mp) (bhvtovfs(&(mp)->m_bhv)) 495{
482#endif 496 return bhvtovfs(&mp->m_bhv);
483#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM) 497}
484xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp);
485#define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
486#else
487#define XFS_BHVTOM(bdp) ((xfs_mount_t *)BHV_PDATA(bdp))
488#endif
489#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_VFSTOM)
490xfs_mount_t *xfs_vfstom(vfs_t *vfs);
491#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
492#else
493#define XFS_VFSTOM(vfs) \
494 (XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops)))
495#endif
496 498
499#define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
500static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
501{
502 return (xfs_mount_t *)BHV_PDATA(bdp);
503}
497 504
498/* 505#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
499 * Moved here from xfs_ag.h to avoid reordering header files 506static inline xfs_mount_t *xfs_vfstom(vfs_t *vfs)
500 */ 507{
508 return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops));
509}
501 510
502#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO)
503xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d);
504#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) 511#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
505#else 512static inline xfs_agnumber_t
506 513xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)
507static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d)
508{ 514{
509 d = XFS_BB_TO_FSBT(mp, d); 515 xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d);
510 do_div(d, mp->m_sb.sb_agblocks); 516 do_div(ld, mp->m_sb.sb_agblocks);
511 return (xfs_agnumber_t) d; 517 return (xfs_agnumber_t) ld;
512} 518}
513 519
514#endif
515#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO)
516xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d);
517#define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d) 520#define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d)
518#else 521static inline xfs_agblock_t
519 522xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d)
520static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d)
521{ 523{
522 d = XFS_BB_TO_FSBT(mp, d); 524 xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d);
523 return (xfs_agblock_t) do_div(d, mp->m_sb.sb_agblocks); 525 return (xfs_agblock_t) do_div(ld, mp->m_sb.sb_agblocks);
524} 526}
525 527
526#endif
527
528/* 528/*
529 * This structure is for use by the xfs_mod_incore_sb_batch() routine. 529 * This structure is for use by the xfs_mod_incore_sb_batch() routine.
530 */ 530 */
@@ -542,6 +542,7 @@ extern xfs_mount_t *xfs_mount_init(void);
542extern void xfs_mod_sb(xfs_trans_t *, __int64_t); 542extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
543extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv); 543extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
544extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int); 544extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int);
545extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
545 546
546extern int xfs_unmountfs(xfs_mount_t *, struct cred *); 547extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
547extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *); 548extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
@@ -555,12 +556,11 @@ extern int xfs_readsb(xfs_mount_t *mp);
555extern void xfs_freesb(xfs_mount_t *); 556extern void xfs_freesb(xfs_mount_t *);
556extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); 557extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
557extern int xfs_syncsub(xfs_mount_t *, int, int, int *); 558extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
558extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); 559extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
560extern xfs_agnumber_t xfs_initialize_perag(struct vfs *, xfs_mount_t *,
561 xfs_agnumber_t);
559extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 562extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
560 563
561extern struct vfsops xfs_vfsops;
562extern struct vnodeops xfs_vnodeops;
563
564extern struct xfs_dmops xfs_dmcore_stub; 564extern struct xfs_dmops xfs_dmcore_stub;
565extern struct xfs_qmops xfs_qmcore_stub; 565extern struct xfs_qmops xfs_qmcore_stub;
566extern struct xfs_ioops xfs_iocore_xfs; 566extern struct xfs_ioops xfs_iocore_xfs;