18 #ifndef __XFS_MOUNT_H__
19 #define __XFS_MOUNT_H__
47 #define xfs_daddr_to_agno(mp,d) \
48 ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks))
49 #define xfs_daddr_to_agbno(mp,d) \
50 ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks))
72 typedef struct xfs_icsb_cnts {
76 unsigned long icsb_flags;
79 #define XFS_ICSB_FLAG_LOCK (1 << 0)
81 #define XFS_ICSB_LAZY_COUNT (1 << 1)
83 extern int xfs_icsb_init_counters(
struct xfs_mount *);
84 extern void xfs_icsb_reinit_counters(
struct xfs_mount *);
85 extern void xfs_icsb_destroy_counters(
struct xfs_mount *);
86 extern void xfs_icsb_sync_counters(
struct xfs_mount *,
int);
87 extern void xfs_icsb_sync_counters_locked(
struct xfs_mount *,
int);
88 extern int xfs_icsb_modify_counters(
struct xfs_mount *,
xfs_sb_field_t,
92 #define xfs_icsb_init_counters(mp) (0)
93 #define xfs_icsb_destroy_counters(mp) do { } while (0)
94 #define xfs_icsb_reinit_counters(mp) do { } while (0)
95 #define xfs_icsb_sync_counters(mp, flags) do { } while (0)
96 #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0)
97 #define xfs_icsb_modify_counters(mp, field, delta, rsvd) \
98 xfs_mod_incore_sb(mp, field, delta, rsvd)
103 XFS_LOWSP_1_PCNT = 0,
111 typedef struct xfs_mount {
128 uint m_readio_blocks;
130 uint m_writeio_blocks;
136 struct xfs_inode *m_rbmip;
137 struct xfs_inode *m_rsumip;
138 struct xfs_inode *m_rootip;
143 __uint8_t m_blkbit_log;
144 __uint8_t m_blkbb_log;
145 __uint8_t m_agno_log;
146 __uint8_t m_agino_log;
147 __uint16_t m_inode_cluster_size;
158 uint m_bm_maxlevels[2];
162 struct mutex m_growlock;
166 uint m_dir_node_ents;
167 uint m_attr_node_ents;
173 __uint64_t m_maxicount;
174 __uint64_t m_resblks;
175 __uint64_t m_resblks_avail;
176 __uint64_t m_resblks_save;
182 __uint8_t m_sectbb_log;
190 struct xfs_chash *m_chash;
193 #ifdef HAVE_PERCPU_SB
194 xfs_icsb_cnts_t
__percpu *m_sb_cnts;
195 unsigned long m_icsb_counters;
197 struct mutex m_icsb_mutex;
203 __int64_t m_update_flags;
206 int64_t m_low_space[XFS_LOWSP_MAX];
217 #define XFS_MOUNT_WSYNC (1ULL << 0)
220 #define XFS_MOUNT_WAS_CLEAN (1ULL << 3)
221 #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4)
224 #define XFS_MOUNT_DISCARD (1ULL << 5)
225 #define XFS_MOUNT_RETERR (1ULL << 6)
227 #define XFS_MOUNT_NOALIGN (1ULL << 7)
229 #define XFS_MOUNT_ATTR2 (1ULL << 8)
230 #define XFS_MOUNT_GRPID (1ULL << 9)
231 #define XFS_MOUNT_NORECOVERY (1ULL << 10)
232 #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12)
233 #define XFS_MOUNT_32BITINODES (1ULL << 14)
235 #define XFS_MOUNT_SMALL_INUMS (1ULL << 15)
236 #define XFS_MOUNT_NOUUID (1ULL << 16)
237 #define XFS_MOUNT_BARRIER (1ULL << 17)
238 #define XFS_MOUNT_IKEEP (1ULL << 18)
239 #define XFS_MOUNT_SWALLOC (1ULL << 19)
241 #define XFS_MOUNT_RDONLY (1ULL << 20)
242 #define XFS_MOUNT_DIRSYNC (1ULL << 21)
243 #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22)
245 #define XFS_MOUNT_FILESTREAMS (1ULL << 24)
247 #define XFS_MOUNT_NOATTR2 (1ULL << 25)
253 #define XFS_READIO_LOG_LARGE 16
254 #define XFS_WRITEIO_LOG_LARGE 16
260 #define XFS_MAX_IO_LOG 30
261 #define XFS_MIN_IO_LOG PAGE_SHIFT
267 #define XFS_WSYNC_READIO_LOG 15
268 #define XFS_WSYNC_WRITEIO_LOG 14
282 static inline unsigned long
283 xfs_preferred_iosize(xfs_mount_t *
mp)
285 if (mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)
287 return (mp->m_swidth ?
288 (mp->m_swidth << mp->m_sb.sb_blocklog) :
289 ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ?
290 (1 << (
int)
MAX(mp->m_readio_log, mp->m_writeio_log)) :
294 #define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
295 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
296 #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
299 #define xfs_force_shutdown(m,f) \
300 xfs_do_force_shutdown(m, f, __FILE__, __LINE__)
302 #define SHUTDOWN_META_IO_ERROR 0x0001
303 #define SHUTDOWN_LOG_IO_ERROR 0x0002
304 #define SHUTDOWN_FORCE_UMOUNT 0x0004
305 #define SHUTDOWN_CORRUPT_INCORE 0x0008
306 #define SHUTDOWN_REMOTE_REQ 0x0010
307 #define SHUTDOWN_DEVICE_REQ 0x0020
312 #define XFS_MFSI_QUIET 0x40
318 do_div(ld, mp->m_sb.sb_agblocks);
340 #ifdef HAVE_PERCPU_SB
342 xfs_icsb_lock(xfs_mount_t *mp)
348 xfs_icsb_unlock(xfs_mount_t *mp)
353 #define xfs_icsb_lock(mp)
354 #define xfs_icsb_unlock(mp)
387 extern void xfs_mod_sb(
struct xfs_trans *, __int64_t);