[XFS] Track external log/realtime device names for correct reporting in
[powerpc.git] / fs / xfs / xfs_mount.h
index 30dd08f..7341f49 100644 (file)
@@ -141,7 +141,7 @@ typedef int (*xfs_dqattach_t)(struct xfs_inode *, uint);
 typedef void   (*xfs_dqdetach_t)(struct xfs_inode *);
 typedef int    (*xfs_dqpurgeall_t)(struct xfs_mount *, uint);
 typedef int    (*xfs_dqvopalloc_t)(struct xfs_mount *,
-                       struct xfs_inode *, uid_t, gid_t, uint,
+                       struct xfs_inode *, uid_t, gid_t, prid_t, uint,
                        struct xfs_dquot **, struct xfs_dquot **);
 typedef void   (*xfs_dqvopcreate_t)(struct xfs_trans *, struct xfs_inode *,
                        struct xfs_dquot *, struct xfs_dquot *);
@@ -185,8 +185,8 @@ typedef struct xfs_qmops {
        (*(mp)->m_qm_ops.xfs_dqdetach)(ip)
 #define XFS_QM_DQPURGEALL(mp, fl) \
        (*(mp)->m_qm_ops.xfs_dqpurgeall)(mp, fl)
-#define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, fl, dq1, dq2) \
-       (*(mp)->m_qm_ops.xfs_dqvopalloc)(mp, ip, uid, gid, fl, dq1, dq2)
+#define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, prid, fl, dq1, dq2) \
+       (*(mp)->m_qm_ops.xfs_dqvopalloc)(mp, ip, uid, gid, prid, fl, dq1, dq2)
 #define XFS_QM_DQVOPCREATE(mp, tp, ip, dq1, dq2) \
        (*(mp)->m_qm_ops.xfs_dqvopcreate)(tp, ip, dq1, dq2)
 #define XFS_QM_DQVOPRENAME(mp, ip) \
@@ -292,6 +292,8 @@ typedef struct xfs_mount {
        struct xfs_buf          *m_sb_bp;       /* buffer for superblock */
        char                    *m_fsname;      /* filesystem name */
        int                     m_fsname_len;   /* strlen of fs name */
+       char                    *m_rtname;      /* realtime device name */
+       char                    *m_logname;     /* external log device name */
        int                     m_bsize;        /* fs logical block size */
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        xfs_agnumber_t          m_agirotor;     /* last ag dir inode alloced */
@@ -404,7 +406,7 @@ typedef struct xfs_mount {
                                                   user */
 #define XFS_MOUNT_NOALIGN      0x00000080      /* turn off stripe alignment
                                                   allocations */
-                            /* 0x00000100      -- currently unused */
+#define XFS_MOUNT_COMPAT_ATTR  0x00000100      /* do not use attr2 format */
                             /* 0x00000200      -- currently unused */
 #define XFS_MOUNT_NORECOVERY   0x00000400      /* no recovery - dirty fs */
 #define XFS_MOUNT_SHARED       0x00000800      /* shared mount */
@@ -415,12 +417,15 @@ typedef struct xfs_mount {
                                                 * 32 bits in size */
 #define XFS_MOUNT_32BITINOOPT  0x00008000      /* saved mount option state */
 #define XFS_MOUNT_NOUUID       0x00010000      /* ignore uuid during mount */
-#define XFS_MOUNT_NOLOGFLUSH   0x00020000
+#define XFS_MOUNT_BARRIER      0x00020000
 #define XFS_MOUNT_IDELETE      0x00040000      /* delete empty inode clusters*/
 #define XFS_MOUNT_SWALLOC      0x00080000      /* turn on stripe width
                                                 * allocation */
 #define XFS_MOUNT_IHASHSIZE    0x00100000      /* inode hash table size */
 #define XFS_MOUNT_DIRSYNC      0x00200000      /* synchronous directory ops */
+#define XFS_MOUNT_COMPAT_IOSIZE        0x00400000      /* don't report large preferred
+                                                * I/O size in stat() */
+
 
 /*
  * Default minimum read and write sizes.
@@ -442,6 +447,30 @@ typedef struct xfs_mount {
 #define        XFS_WSYNC_READIO_LOG    15      /* 32K */
 #define        XFS_WSYNC_WRITEIO_LOG   14      /* 16K */
 
+/*
+ * Allow large block sizes to be reported to userspace programs if the
+ * "largeio" mount option is used. 
+ *
+ * If compatibility mode is specified, simply return the basic unit of caching
+ * so that we don't get inefficient read/modify/write I/O from user apps.
+ * Otherwise....
+ *
+ * If the underlying volume is a stripe, then return the stripe width in bytes
+ * as the recommended I/O size. It is not a stripe and we've set a default
+ * buffered I/O size, return that, otherwise return the compat default.
+ */
+static inline unsigned long
+xfs_preferred_iosize(xfs_mount_t *mp)
+{
+       if (mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)
+               return PAGE_CACHE_SIZE;
+       return (mp->m_swidth ?
+               (mp->m_swidth << mp->m_sb.sb_blocklog) :
+               ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ?
+                       (1 << (int)MAX(mp->m_readio_log, mp->m_writeio_log)) :
+                       PAGE_CACHE_SIZE));
+}
+
 #define XFS_MAXIOFFSET(mp)     ((mp)->m_maxioffset)
 
 #define XFS_FORCED_SHUTDOWN(mp)        ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
@@ -542,9 +571,9 @@ extern xfs_mount_t *xfs_mount_init(void);
 extern void    xfs_mod_sb(xfs_trans_t *, __int64_t);
 extern void    xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
 extern int     xfs_mountfs(struct vfs *, xfs_mount_t *mp, int);
+extern void    xfs_mountfs_check_barriers(xfs_mount_t *mp);
 
 extern int     xfs_unmountfs(xfs_mount_t *, struct cred *);
-extern void    xfs_unmountfs_wait(xfs_mount_t *);
 extern void    xfs_unmountfs_close(xfs_mount_t *, struct cred *);
 extern int     xfs_unmountfs_writesb(xfs_mount_t *);
 extern int     xfs_unmount_flush(xfs_mount_t *, int);
@@ -556,6 +585,7 @@ extern int  xfs_readsb(xfs_mount_t *mp);
 extern void    xfs_freesb(xfs_mount_t *);
 extern void    xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
 extern int     xfs_syncsub(xfs_mount_t *, int, int, int *);
+extern int     xfs_sync_inodes(xfs_mount_t *, int, int, int *);
 extern xfs_agnumber_t  xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
 extern void    xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);