diff options
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 0653beecf93a..b71af184aea6 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -421,6 +421,9 @@ typedef struct xfs_mount { | |||
421 | * allocation */ | 421 | * allocation */ |
422 | #define XFS_MOUNT_IHASHSIZE 0x00100000 /* inode hash table size */ | 422 | #define XFS_MOUNT_IHASHSIZE 0x00100000 /* inode hash table size */ |
423 | #define XFS_MOUNT_DIRSYNC 0x00200000 /* synchronous directory ops */ | 423 | #define XFS_MOUNT_DIRSYNC 0x00200000 /* synchronous directory ops */ |
424 | #define XFS_MOUNT_COMPAT_IOSIZE 0x00400000 /* don't report large preferred | ||
425 | * I/O size in stat() */ | ||
426 | |||
424 | 427 | ||
425 | /* | 428 | /* |
426 | * Default minimum read and write sizes. | 429 | * Default minimum read and write sizes. |
@@ -442,6 +445,30 @@ typedef struct xfs_mount { | |||
442 | #define XFS_WSYNC_READIO_LOG 15 /* 32K */ | 445 | #define XFS_WSYNC_READIO_LOG 15 /* 32K */ |
443 | #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */ | 446 | #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */ |
444 | 447 | ||
448 | /* | ||
449 | * Allow large block sizes to be reported to userspace programs if the | ||
450 | * "largeio" mount option is used. | ||
451 | * | ||
452 | * If compatibility mode is specified, simply return the basic unit of caching | ||
453 | * so that we don't get inefficient read/modify/write I/O from user apps. | ||
454 | * Otherwise.... | ||
455 | * | ||
456 | * If the underlying volume is a stripe, then return the stripe width in bytes | ||
457 | * as the recommended I/O size. It is not a stripe and we've set a default | ||
458 | * buffered I/O size, return that, otherwise return the compat default. | ||
459 | */ | ||
460 | static inline unsigned long | ||
461 | xfs_preferred_iosize(xfs_mount_t *mp) | ||
462 | { | ||
463 | if (mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE) | ||
464 | return PAGE_CACHE_SIZE; | ||
465 | return (mp->m_swidth ? | ||
466 | (mp->m_swidth << mp->m_sb.sb_blocklog) : | ||
467 | ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ? | ||
468 | (1 << (int)MAX(mp->m_readio_log, mp->m_writeio_log)) : | ||
469 | PAGE_CACHE_SIZE)); | ||
470 | } | ||
471 | |||
445 | #define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) | 472 | #define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) |
446 | 473 | ||
447 | #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) | 474 | #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) |