ocfs2: Trivial cleanup of jbd compatibility layer removal
[safe/jmp/linux-2.6] / fs / xfs / xfs_fs.h
index 14010f1..f52ac27 100644 (file)
@@ -22,8 +22,6 @@
  * SGI's XFS filesystem's major stuff (constants, structures)
  */
 
-#define XFS_NAME       "xfs"
-
 /*
  * Direct I/O attribute record used with XFS_IOC_DIOINFO
  * d_miniosz is the min xfer size, xfer size multiple and file seek offset
@@ -67,14 +65,16 @@ struct fsxattr {
 #define XFS_XFLAG_NOSYMLINKS   0x00000400      /* disallow symlink creation */
 #define XFS_XFLAG_EXTSIZE      0x00000800      /* extent size allocator hint */
 #define XFS_XFLAG_EXTSZINHERIT 0x00001000      /* inherit inode extent size */
+#define XFS_XFLAG_NODEFRAG     0x00002000      /* do not defragment */
+#define XFS_XFLAG_FILESTREAM   0x00004000      /* use filestream allocator */
 #define XFS_XFLAG_HASATTR      0x80000000      /* no DIFLAG for this   */
 
 /*
  * Structure for XFS_IOC_GETBMAP.
  * On input, fill in bmv_offset and bmv_length of the first structure
- * to indicate the area of interest in the file, and bmv_entry with the
- * number of array elements given.  The first structure is updated on
- * return to give the offset and length for the next call.
+ * to indicate the area of interest in the file, and bmv_entries with
+ * the number of array elements given back.  The first structure is
+ * updated on return to give the offset and length for the next call.
  */
 #ifndef HAVE_GETBMAP
 struct getbmap {
@@ -113,22 +113,14 @@ struct getbmapx {
 #define BMV_IF_ATTRFORK                0x1     /* return attr fork rather than data */
 #define BMV_IF_NO_DMAPI_READ   0x2     /* Do not generate DMAPI read event  */
 #define BMV_IF_PREALLOC                0x4     /* rtn status BMV_OF_PREALLOC if req */
-#define BMV_IF_VALID   (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC)
-#ifdef __KERNEL__
-#define BMV_IF_EXTENDED 0x40000000     /* getpmapx if set */
-#endif
+#define BMV_IF_DELALLOC                0x8     /* rtn status BMV_OF_DELALLOC if req */
+#define BMV_IF_VALID   \
+       (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC|BMV_IF_DELALLOC)
 
-/*     bmv_oflags values - returned for for each non-header segment */
+/*     bmv_oflags values - returned for each non-header segment */
 #define BMV_OF_PREALLOC                0x1     /* segment = unwritten pre-allocation */
-
-/*     Convert getbmap <-> getbmapx - move fields from p1 to p2. */
-#define GETBMAP_CONVERT(p1,p2) {       \
-       p2.bmv_offset = p1.bmv_offset;  \
-       p2.bmv_block = p1.bmv_block;    \
-       p2.bmv_length = p1.bmv_length;  \
-       p2.bmv_count = p1.bmv_count;    \
-       p2.bmv_entries = p1.bmv_entries;  }
-
+#define BMV_OF_DELALLOC                0x2     /* segment = delayed allocation */
+#define BMV_OF_LAST            0x4     /* segment is the last in the file */
 
 /*
  * Structure for XFS_IOC_FSSETDM.
@@ -239,16 +231,21 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_LOGV2      0x0100  /* log format version 2 */
 #define XFS_FSOP_GEOM_FLAGS_SECTOR     0x0200  /* sector sizes >1BB    */
 #define XFS_FSOP_GEOM_FLAGS_ATTR2      0x0400  /* inline attributes rework */
+#define XFS_FSOP_GEOM_FLAGS_DIRV2CI    0x1000  /* ASCII only CI names */
+#define XFS_FSOP_GEOM_FLAGS_LAZYSB     0x4000  /* lazy superblock counters */
 
 
 /*
  * Minimum and maximum sizes need for growth checks
  */
 #define XFS_MIN_AG_BLOCKS      64
-#define XFS_MIN_LOG_BLOCKS     512
-#define XFS_MAX_LOG_BLOCKS     (64 * 1024)
-#define XFS_MIN_LOG_BYTES      (256 * 1024)
-#define XFS_MAX_LOG_BYTES      (128 * 1024 * 1024)
+#define XFS_MIN_LOG_BLOCKS     512ULL
+#define XFS_MAX_LOG_BLOCKS     (1024 * 1024ULL)
+#define XFS_MIN_LOG_BYTES      (10 * 1024 * 1024ULL)
+
+/* keep the maximum size under 2^31 by a small amount */
+#define XFS_MAX_LOG_BYTES \
+       ((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES)
 
 /*
  * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
@@ -370,6 +367,9 @@ typedef struct xfs_fsop_attrlist_handlereq {
 
 typedef struct xfs_attr_multiop {
        __u32           am_opcode;
+#define ATTR_OP_GET    1       /* return the indicated attr's value */
+#define ATTR_OP_SET    2       /* set/create the indicated attr/value pair */
+#define ATTR_OP_REMOVE 3       /* remove the indicated attr */
        __s32           am_error;
        void            __user *am_attrname;
        void            __user *am_attrvalue;
@@ -388,30 +388,13 @@ typedef struct xfs_fsop_attrmulti_handlereq {
  */
 typedef struct { __u32 val[2]; } xfs_fsid_t; /* file system id type */
 
-
-#ifndef HAVE_FID
-#define MAXFIDSZ       46
-
-typedef struct fid {
-       __u16           fid_len;                /* length of data in bytes */
-       unsigned char   fid_data[MAXFIDSZ];     /* data (fid_len worth)  */
-} fid_t;
-#endif
-
 typedef struct xfs_fid {
-       __u16   xfs_fid_len;            /* length of remainder  */
-       __u16   xfs_fid_pad;
-       __u32   xfs_fid_gen;            /* generation number    */
-       __u64   xfs_fid_ino;            /* 64 bits inode number */
+       __u16   fid_len;                /* length of remainder  */
+       __u16   fid_pad;
+       __u32   fid_gen;                /* generation number    */
+       __u64   fid_ino;                /* 64 bits inode number */
 } xfs_fid_t;
 
-typedef struct xfs_fid2 {
-       __u16   fid_len;        /* length of remainder */
-       __u16   fid_pad;        /* padding, must be zero */
-       __u32   fid_gen;        /* generation number */
-       __u64   fid_ino;        /* inode number */
-} xfs_fid2_t;
-
 typedef struct xfs_handle {
        union {
                __s64       align;      /* force alignment of ha_fid     */
@@ -421,15 +404,11 @@ typedef struct xfs_handle {
 } xfs_handle_t;
 #define ha_fsid ha_u._ha_fsid
 
-#define XFS_HSIZE(handle)      (((char *) &(handle).ha_fid.xfs_fid_pad  \
+#define XFS_HSIZE(handle)      (((char *) &(handle).ha_fid.fid_pad      \
                                 - (char *) &(handle))                    \
-                                + (handle).ha_fid.xfs_fid_len)
+                                + (handle).ha_fid.fid_len)
 
-#define XFS_HANDLE_CMP(h1, h2) memcmp(h1, h2, sizeof(xfs_handle_t))
-
-#define FSHSIZE                sizeof(fsid_t)
-
-/* 
+/*
  * Flags for going down operation
  */
 #define XFS_FSOP_GOING_FLAGS_DEFAULT           0x0     /* going down */
@@ -439,9 +418,9 @@ typedef struct xfs_handle {
 /*
  * ioctl commands that are used by Linux filesystems
  */
-#define XFS_IOC_GETXFLAGS      _IOR('f', 1, long)
-#define XFS_IOC_SETXFLAGS      _IOW('f', 2, long)
-#define XFS_IOC_GETVERSION     _IOR('v', 1, long)
+#define XFS_IOC_GETXFLAGS      FS_IOC_GETFLAGS
+#define XFS_IOC_SETXFLAGS      FS_IOC_SETFLAGS
+#define XFS_IOC_GETVERSION     FS_IOC_GETVERSION
 
 /*
  * ioctl commands that replace IRIX fcntl()'s
@@ -489,8 +468,8 @@ typedef struct xfs_handle {
 #define XFS_IOC_ERROR_INJECTION             _IOW ('X', 116, struct xfs_error_injection)
 #define XFS_IOC_ERROR_CLEARALL      _IOW ('X', 117, struct xfs_error_injection)
 /*     XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118      */
-#define XFS_IOC_FREEZE              _IOWR('X', 119, int)
-#define XFS_IOC_THAW                _IOWR('X', 120, int)
+/*     XFS_IOC_FREEZE            -- FIFREEZE   119      */
+/*     XFS_IOC_THAW              -- FITHAW     120      */
 #define XFS_IOC_FSSETDM_BY_HANDLE    _IOW ('X', 121, struct xfs_fsop_setdm_handlereq)
 #define XFS_IOC_ATTRLIST_BY_HANDLE   _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
 #define XFS_IOC_ATTRMULTI_BY_HANDLE  _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)