diff options
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 73 |
1 files changed, 33 insertions, 40 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index f3c1024b1241..c1e028467327 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #ifndef __XFS_MOUNT_H__ | 18 | #ifndef __XFS_MOUNT_H__ |
19 | #define __XFS_MOUNT_H__ | 19 | #define __XFS_MOUNT_H__ |
20 | 20 | ||
21 | |||
22 | typedef struct xfs_trans_reservations { | 21 | typedef struct xfs_trans_reservations { |
23 | uint tr_write; /* extent alloc trans */ | 22 | uint tr_write; /* extent alloc trans */ |
24 | uint tr_itruncate; /* truncate trans */ | 23 | uint tr_itruncate; /* truncate trans */ |
@@ -44,14 +43,16 @@ typedef struct xfs_trans_reservations { | |||
44 | } xfs_trans_reservations_t; | 43 | } xfs_trans_reservations_t; |
45 | 44 | ||
46 | #ifndef __KERNEL__ | 45 | #ifndef __KERNEL__ |
47 | /* | 46 | |
48 | * Moved here from xfs_ag.h to avoid reordering header files | ||
49 | */ | ||
50 | #define XFS_DADDR_TO_AGNO(mp,d) \ | 47 | #define XFS_DADDR_TO_AGNO(mp,d) \ |
51 | ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) | 48 | ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) |
52 | #define XFS_DADDR_TO_AGBNO(mp,d) \ | 49 | #define XFS_DADDR_TO_AGBNO(mp,d) \ |
53 | ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) | 50 | ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) |
54 | #else | 51 | |
52 | #else /* __KERNEL__ */ | ||
53 | |||
54 | #include "xfs_sync.h" | ||
55 | |||
55 | struct cred; | 56 | struct cred; |
56 | struct log; | 57 | struct log; |
57 | struct xfs_mount_args; | 58 | struct xfs_mount_args; |
@@ -62,6 +63,7 @@ struct xfs_extdelta; | |||
62 | struct xfs_swapext; | 63 | struct xfs_swapext; |
63 | struct xfs_mru_cache; | 64 | struct xfs_mru_cache; |
64 | struct xfs_nameops; | 65 | struct xfs_nameops; |
66 | struct xfs_ail; | ||
65 | 67 | ||
66 | /* | 68 | /* |
67 | * Prototypes and functions for the Data Migration subsystem. | 69 | * Prototypes and functions for the Data Migration subsystem. |
@@ -115,7 +117,7 @@ struct xfs_quotainfo; | |||
115 | 117 | ||
116 | typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); | 118 | typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); |
117 | typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint); | 119 | typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint); |
118 | typedef int (*xfs_qmunmount_t)(struct xfs_mount *); | 120 | typedef void (*xfs_qmunmount_t)(struct xfs_mount *); |
119 | typedef void (*xfs_qmdone_t)(struct xfs_mount *); | 121 | typedef void (*xfs_qmdone_t)(struct xfs_mount *); |
120 | typedef void (*xfs_dqrele_t)(struct xfs_dquot *); | 122 | typedef void (*xfs_dqrele_t)(struct xfs_dquot *); |
121 | typedef int (*xfs_dqattach_t)(struct xfs_inode *, uint); | 123 | typedef int (*xfs_dqattach_t)(struct xfs_inode *, uint); |
@@ -132,7 +134,7 @@ typedef struct xfs_dquot * (*xfs_dqvopchown_t)( | |||
132 | struct xfs_dquot **, struct xfs_dquot *); | 134 | struct xfs_dquot **, struct xfs_dquot *); |
133 | typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *, | 135 | typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *, |
134 | struct xfs_dquot *, struct xfs_dquot *, uint); | 136 | struct xfs_dquot *, struct xfs_dquot *, uint); |
135 | typedef void (*xfs_dqstatvfs_t)(struct xfs_inode *, bhv_statvfs_t *); | 137 | typedef void (*xfs_dqstatvfs_t)(struct xfs_inode *, struct kstatfs *); |
136 | typedef int (*xfs_dqsync_t)(struct xfs_mount *, int flags); | 138 | typedef int (*xfs_dqsync_t)(struct xfs_mount *, int flags); |
137 | typedef int (*xfs_quotactl_t)(struct xfs_mount *, int, int, xfs_caddr_t); | 139 | typedef int (*xfs_quotactl_t)(struct xfs_mount *, int, int, xfs_caddr_t); |
138 | 140 | ||
@@ -223,18 +225,10 @@ extern void xfs_icsb_sync_counters_locked(struct xfs_mount *, int); | |||
223 | #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0) | 225 | #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0) |
224 | #endif | 226 | #endif |
225 | 227 | ||
226 | typedef struct xfs_ail { | ||
227 | struct list_head xa_ail; | ||
228 | uint xa_gen; | ||
229 | struct task_struct *xa_task; | ||
230 | xfs_lsn_t xa_target; | ||
231 | } xfs_ail_t; | ||
232 | |||
233 | typedef struct xfs_mount { | 228 | typedef struct xfs_mount { |
234 | struct super_block *m_super; | 229 | struct super_block *m_super; |
235 | xfs_tid_t m_tid; /* next unused tid for fs */ | 230 | xfs_tid_t m_tid; /* next unused tid for fs */ |
236 | spinlock_t m_ail_lock; /* fs AIL mutex */ | 231 | struct xfs_ail *m_ail; /* fs active log item list */ |
237 | xfs_ail_t m_ail; /* fs active log item list */ | ||
238 | xfs_sb_t m_sb; /* copy of fs superblock */ | 232 | xfs_sb_t m_sb; /* copy of fs superblock */ |
239 | spinlock_t m_sb_lock; /* sb counter lock */ | 233 | spinlock_t m_sb_lock; /* sb counter lock */ |
240 | struct xfs_buf *m_sb_bp; /* buffer for superblock */ | 234 | struct xfs_buf *m_sb_bp; /* buffer for superblock */ |
@@ -247,10 +241,6 @@ typedef struct xfs_mount { | |||
247 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ | 241 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ |
248 | spinlock_t m_agirotor_lock;/* .. and lock protecting it */ | 242 | spinlock_t m_agirotor_lock;/* .. and lock protecting it */ |
249 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ | 243 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ |
250 | struct xfs_inode *m_inodes; /* active inode list */ | ||
251 | struct list_head m_del_inodes; /* inodes to reclaim */ | ||
252 | mutex_t m_ilock; /* inode list mutex */ | ||
253 | uint m_ireclaims; /* count of calls to reclaim*/ | ||
254 | uint m_readio_log; /* min read size log bytes */ | 244 | uint m_readio_log; /* min read size log bytes */ |
255 | uint m_readio_blocks; /* min read size blocks */ | 245 | uint m_readio_blocks; /* min read size blocks */ |
256 | uint m_writeio_log; /* min write size log bytes */ | 246 | uint m_writeio_log; /* min write size log bytes */ |
@@ -267,7 +257,6 @@ typedef struct xfs_mount { | |||
267 | xfs_buftarg_t *m_ddev_targp; /* saves taking the address */ | 257 | xfs_buftarg_t *m_ddev_targp; /* saves taking the address */ |
268 | xfs_buftarg_t *m_logdev_targp;/* ptr to log device */ | 258 | xfs_buftarg_t *m_logdev_targp;/* ptr to log device */ |
269 | xfs_buftarg_t *m_rtdev_targp; /* ptr to rt device */ | 259 | xfs_buftarg_t *m_rtdev_targp; /* ptr to rt device */ |
270 | __uint8_t m_dircook_elog; /* log d-cookie entry bits */ | ||
271 | __uint8_t m_blkbit_log; /* blocklog + NBBY */ | 260 | __uint8_t m_blkbit_log; /* blocklog + NBBY */ |
272 | __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ | 261 | __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ |
273 | __uint8_t m_agno_log; /* log #ag's */ | 262 | __uint8_t m_agno_log; /* log #ag's */ |
@@ -276,12 +265,12 @@ typedef struct xfs_mount { | |||
276 | uint m_blockmask; /* sb_blocksize-1 */ | 265 | uint m_blockmask; /* sb_blocksize-1 */ |
277 | uint m_blockwsize; /* sb_blocksize in words */ | 266 | uint m_blockwsize; /* sb_blocksize in words */ |
278 | uint m_blockwmask; /* blockwsize-1 */ | 267 | uint m_blockwmask; /* blockwsize-1 */ |
279 | uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS */ | 268 | uint m_alloc_mxr[2]; /* max alloc btree records */ |
280 | uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS */ | 269 | uint m_alloc_mnr[2]; /* min alloc btree records */ |
281 | uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS */ | 270 | uint m_bmap_dmxr[2]; /* max bmap btree records */ |
282 | uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */ | 271 | uint m_bmap_dmnr[2]; /* min bmap btree records */ |
283 | uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS */ | 272 | uint m_inobt_mxr[2]; /* max inobt btree records */ |
284 | uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS */ | 273 | uint m_inobt_mnr[2]; /* min inobt btree records */ |
285 | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | 274 | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ |
286 | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | 275 | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ |
287 | uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ | 276 | uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ |
@@ -312,9 +301,6 @@ typedef struct xfs_mount { | |||
312 | int m_sinoalign; /* stripe unit inode alignment */ | 301 | int m_sinoalign; /* stripe unit inode alignment */ |
313 | int m_attr_magicpct;/* 37% of the blocksize */ | 302 | int m_attr_magicpct;/* 37% of the blocksize */ |
314 | int m_dir_magicpct; /* 37% of the dir blocksize */ | 303 | int m_dir_magicpct; /* 37% of the dir blocksize */ |
315 | __uint8_t m_mk_sharedro; /* mark shared ro on unmount */ | ||
316 | __uint8_t m_inode_quiesce;/* call quiesce on new inodes. | ||
317 | field governed by m_ilock */ | ||
318 | __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ | 304 | __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ |
319 | const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ | 305 | const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ |
320 | int m_dirblksize; /* directory block sz--bytes */ | 306 | int m_dirblksize; /* directory block sz--bytes */ |
@@ -362,7 +348,6 @@ typedef struct xfs_mount { | |||
362 | #define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */ | 348 | #define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */ |
363 | #define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned from directory */ | 349 | #define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned from directory */ |
364 | #define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ | 350 | #define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ |
365 | #define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */ | ||
366 | #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ | 351 | #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ |
367 | #define XFS_MOUNT_OSYNCISOSYNC (1ULL << 13) /* o_sync is REALLY o_sync */ | 352 | #define XFS_MOUNT_OSYNCISOSYNC (1ULL << 13) /* o_sync is REALLY o_sync */ |
368 | /* osyncisdsync is now default*/ | 353 | /* osyncisdsync is now default*/ |
@@ -439,6 +424,16 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, | |||
439 | #define xfs_force_shutdown(m,f) \ | 424 | #define xfs_force_shutdown(m,f) \ |
440 | xfs_do_force_shutdown(m, f, __FILE__, __LINE__) | 425 | xfs_do_force_shutdown(m, f, __FILE__, __LINE__) |
441 | 426 | ||
427 | #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ | ||
428 | #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ | ||
429 | #define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */ | ||
430 | #define SHUTDOWN_CORRUPT_INCORE 0x0008 /* corrupt in-memory data structures */ | ||
431 | #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ | ||
432 | #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ | ||
433 | |||
434 | #define xfs_test_for_freeze(mp) ((mp)->m_super->s_frozen) | ||
435 | #define xfs_wait_for_freeze(mp,l) vfs_check_frozen((mp)->m_super, (l)) | ||
436 | |||
442 | /* | 437 | /* |
443 | * Flags for xfs_mountfs | 438 | * Flags for xfs_mountfs |
444 | */ | 439 | */ |
@@ -508,14 +503,12 @@ typedef struct xfs_mod_sb { | |||
508 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) | 503 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) |
509 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) | 504 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) |
510 | 505 | ||
511 | extern void xfs_mod_sb(xfs_trans_t *, __int64_t); | ||
512 | extern int xfs_log_sbcount(xfs_mount_t *, uint); | 506 | extern int xfs_log_sbcount(xfs_mount_t *, uint); |
513 | extern int xfs_mountfs(xfs_mount_t *mp); | 507 | extern int xfs_mountfs(xfs_mount_t *mp); |
514 | extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); | 508 | extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); |
515 | 509 | ||
516 | extern void xfs_unmountfs(xfs_mount_t *); | 510 | extern void xfs_unmountfs(xfs_mount_t *); |
517 | extern int xfs_unmountfs_writesb(xfs_mount_t *); | 511 | extern int xfs_unmountfs_writesb(xfs_mount_t *); |
518 | extern int xfs_unmount_flush(xfs_mount_t *, int); | ||
519 | extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int); | 512 | extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int); |
520 | extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t, | 513 | extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t, |
521 | int64_t, int); | 514 | int64_t, int); |
@@ -525,20 +518,20 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); | |||
525 | extern int xfs_readsb(xfs_mount_t *, int); | 518 | extern int xfs_readsb(xfs_mount_t *, int); |
526 | extern void xfs_freesb(xfs_mount_t *); | 519 | extern void xfs_freesb(xfs_mount_t *); |
527 | extern int xfs_fs_writable(xfs_mount_t *); | 520 | extern int xfs_fs_writable(xfs_mount_t *); |
528 | extern int xfs_syncsub(xfs_mount_t *, int, int *); | ||
529 | extern int xfs_sync_inodes(xfs_mount_t *, int, int *); | ||
530 | extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); | ||
531 | extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); | ||
532 | extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); | ||
533 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | 521 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); |
534 | 522 | ||
535 | extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); | 523 | extern int xfs_dmops_get(struct xfs_mount *); |
536 | extern void xfs_dmops_put(struct xfs_mount *); | 524 | extern void xfs_dmops_put(struct xfs_mount *); |
537 | extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); | 525 | extern int xfs_qmops_get(struct xfs_mount *); |
538 | extern void xfs_qmops_put(struct xfs_mount *); | 526 | extern void xfs_qmops_put(struct xfs_mount *); |
539 | 527 | ||
540 | extern struct xfs_dmops xfs_dmcore_xfs; | 528 | extern struct xfs_dmops xfs_dmcore_xfs; |
541 | 529 | ||
542 | #endif /* __KERNEL__ */ | 530 | #endif /* __KERNEL__ */ |
543 | 531 | ||
532 | extern void xfs_mod_sb(struct xfs_trans *, __int64_t); | ||
533 | extern xfs_agnumber_t xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t); | ||
534 | extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); | ||
535 | extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); | ||
536 | |||
544 | #endif /* __XFS_MOUNT_H__ */ | 537 | #endif /* __XFS_MOUNT_H__ */ |