]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - include/xfs_inode.h
Undoes mod: xfs-cmds:slinx:120772a
[thirdparty/xfsprogs-dev.git] / include / xfs_inode.h
index 7950594d7f7a26cc497eed2613a952ba2280c721..ce88ef35b72be22e279ea745a583fa2ee3c5bd9e 100644 (file)
@@ -93,7 +93,6 @@ struct xfs_buf;
 struct xfs_bmap_free;
 struct xfs_bmbt_irec;
 struct xfs_bmbt_block;
-struct xfs_ext_attr;
 struct xfs_inode;
 struct xfs_inode_log_item;
 struct xfs_mount;
@@ -137,32 +136,35 @@ typedef   struct xfs_dio {
        size_t          xd_length;
 } xfs_dio_t;
 
+typedef struct dm_attrs_s {
+       __uint32_t      da_dmevmask;    /* DMIG event mask */
+       __uint16_t      da_dmstate;     /* DMIG state info */
+       __uint16_t      da_pad;         /* DMIG extra padding */
+} dm_attrs_t;
 
 typedef struct xfs_iocore {
        void                    *io_obj;        /* pointer to container
                                                 * inode or dcxvn structure */
        struct xfs_mount        *io_mount;      /* fs mount struct ptr */
-       mrlock_t                *io_lock;       /* inode lock */
+#ifdef DEBUG
+       mrlock_t                *io_lock;       /* inode IO lock */
        mrlock_t                *io_iolock;     /* inode IO lock */
-       sema_t                  *io_flock;      /* inode flush lock */
+#endif
 
        /* I/O state */
        xfs_fsize_t             io_new_size;    /* sz when write completes */
-       unsigned int            io_readio_blocks;       /* read buffer size */
-       unsigned int            io_writeio_blocks;      /* write buffer size */
-       uchar_t                 io_readio_log;  /* log2 of read buffer size */
-       uchar_t                 io_writeio_log; /* log2 of write buffer size */
-       uchar_t                 io_max_io_log;  /* max r/w io value */
-       int                     io_queued_bufs; /* count of xfsd queued bufs*/
 
        /* Miscellaneous state. */
        unsigned int            io_flags;       /* IO related flags */
 
        /* DMAPI state */
-       __uint32_t      io_dmevmask;    /* DMIG event mask */
-       __uint16_t      io_dmstate;     /* DMIG state info */
+       dm_attrs_t              io_dmattrs;
+
 } xfs_iocore_t;
 
+#define        io_dmevmask     io_dmattrs.da_dmevmask
+#define        io_dmstate      io_dmattrs.da_dmstate
+
 #define XFS_IO_INODE(io)       ((xfs_inode_t *) ((io)->io_obj))
 #define XFS_IO_DCXVN(io)       ((dcxvn_t *) ((io)->io_obj))
 
@@ -173,26 +175,15 @@ typedef struct xfs_iocore {
 #define XFS_IOCORE_ISXFS       0x01
 #define XFS_IOCORE_ISCXFS      0x02
 #define XFS_IOCORE_RT          0x04
-#define XFS_IOCORE_UIOSZ       0x08
 
 #define IO_IS_XFS(io)  ((io)->io_flags & XFS_IOCORE_ISXFS)
 
-/*
- * Clear out the read-ahead state in the in-core inode.
- * We actually only need to clear i_next_offset and
- * i_last_req_sz to get the effect of making all the
- * read ahead state unusable.
- */
-#define XFS_INODE_CLEAR_READ_AHEAD(io) 
-
-
 /*
  * xfs_iocore prototypes
  */
 
 extern void xfs_iocore_inode_init(struct xfs_inode *);
 extern void xfs_iocore_inode_reinit(struct xfs_inode *);
-extern void xfs_iocore_reset(xfs_iocore_t *);
 
 
 /*
@@ -284,7 +275,6 @@ typedef struct xfs_inode {
        /* Inode location stuff */
        xfs_ino_t               i_ino;          /* inode number (agno/agino)*/
        xfs_daddr_t             i_blkno;        /* blkno of inode buffer */
-       dev_t                   i_dev;          /* dev for this inode */
        ushort                  i_len;          /* len of inode buffer */
        ushort                  i_boffset;      /* off of inode in buffer */
 
@@ -298,9 +288,8 @@ typedef struct xfs_inode {
        mrlock_t                i_lock;         /* inode lock */
        mrlock_t                i_iolock;       /* inode IO lock */
        sema_t                  i_flock;        /* inode flush lock */
-       unsigned int            i_pincount;     /* inode pin count */
-       sv_t                    i_pinsema;      /* inode pin sema */
-       lock_t                  i_ipinlock;     /* inode pinning mutex */
+       atomic_t                i_pincount;     /* inode pin count */
+       wait_queue_head_t       i_ipin_wait;    /* inode pinning wait queue */
        struct xfs_inode        **i_refcache;   /* ptr to entry in ref cache */
        struct xfs_inode        *i_release;     /* inode to unref */
 
@@ -309,12 +298,10 @@ typedef struct xfs_inode {
 
        /* Miscellaneous state. */
        unsigned short          i_flags;        /* see defined flags below */
-       unsigned short          i_update_core;  /* timestamps/size is dirty */
-       unsigned short          i_update_size;  /* di_size field is dirty */
+       unsigned char           i_update_core;  /* timestamps/size is dirty */
+       unsigned char           i_update_size;  /* di_size field is dirty */
        unsigned int            i_gen;          /* generation count */
        unsigned int            i_delayed_blks; /* count of delay alloc blks */
-       struct xfs_ext_attr     *i_ext_attr;    /* Critical ext attributes */
-       void                    *i_ilock_ra;    /* current ilock ret addr */
 
        xfs_dinode_core_t       i_d;            /* most of ondisk inode */
        xfs_chashlist_t         *i_chash;       /* cluster hash list header */
@@ -412,7 +399,6 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 #define        XFS_ILOCK_EXCL          0x004
 #define        XFS_ILOCK_SHARED        0x008
 #define        XFS_IUNLOCK_NONOTIFY    0x010
-#define XFS_IOLOCK_NESTED      0x020
 #define XFS_EXTENT_TOKEN_RD    0x040
 #define XFS_SIZE_TOKEN_RD      0x080
 #define XFS_EXTSIZE_RD         (XFS_EXTENT_TOKEN_RD|XFS_SIZE_TOKEN_RD)
@@ -424,7 +410,6 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 
 #define XFS_LOCK_MASK  \
        (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED | XFS_ILOCK_EXCL | \
-        XFS_IOLOCK_NESTED | \
         XFS_ILOCK_SHARED | XFS_EXTENT_TOKEN_RD | XFS_SIZE_TOKEN_RD | \
         XFS_WILLLEND)
 
@@ -449,15 +434,18 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 #define        XFS_ITRUNC_MAYBE        0x2
 
 /*
- * Maximum file size.
- * if XFS_BIG_FILES 2^63 - 1 (largest positive value of xfs_fsize_t)
+ * if XFS_BIG_FILES, 2^(31+PAGE_SHIFT) - 1 (due to linux page cache),
  * else 2^40 - 1 (40=31+9) (might be an int holding a block #)
- * Note, we allow seeks to this offset, although you can't read or write.
  * For the not XFS_BIG_FILES case, the value could be 1 higher but we don't
  * do that, for symmetry.
+ *
+ * NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t)
+ * but Linux can't go above 2^(31+PAGE_SHIFT)-1: the Linux VM uses a 32 bit
+ * signed variable to index cache data, so 2^31 * PAGE_SIZE is as big as 
+ * you can go.
  */
 #if XFS_BIG_FILES
-#define XFS_MAX_FILE_OFFSET    ((long long)((1ULL<<63)-1ULL))
+#define XFS_MAX_FILE_OFFSET    ((long long)((1ULL<<(31+PAGE_SHIFT))-1ULL))
 #else
 #define        XFS_MAX_FILE_OFFSET     ((1LL<<40)-1LL)
 #endif
@@ -514,6 +502,7 @@ int         xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
                         uint, xfs_inode_t **, xfs_daddr_t);
 int            xfs_vn_iget(vfs_t *, struct vnode *, xfs_ino_t);
 void           xfs_iput(xfs_inode_t *, uint);
+void           xfs_iput_new(xfs_inode_t *, uint);
 void           xfs_ilock(xfs_inode_t *, uint);
 int            xfs_ilock_nowait(xfs_inode_t *, uint);
 void           xfs_iunlock(xfs_inode_t *, uint);
@@ -560,7 +549,6 @@ void                xfs_iext_realloc(xfs_inode_t *, int, int);
 void           xfs_iroot_realloc(xfs_inode_t *, int, int);
 void           xfs_ipin(xfs_inode_t *);
 void           xfs_iunpin(xfs_inode_t *);
-unsigned int   xfs_ipincount(xfs_inode_t *);
 int            xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_32_t *, int);
 int            xfs_iflush(xfs_inode_t *, uint);
 int            xfs_iflush_all(struct xfs_mount *, int);
@@ -572,6 +560,9 @@ xfs_fsize_t xfs_file_last_byte(xfs_inode_t *);
 xfs_inode_t    *xfs_get_inode(dev_t, xfs_ino_t);
 void           xfs_lock_inodes(xfs_inode_t **, int, int, uint);
 
+#define xfs_ipincount(ip)      ((unsigned int) atomic_read(&ip->i_pincount))
+
+
 
 #ifdef DEBUG
 void           xfs_isize_check(struct xfs_mount *, xfs_inode_t *, xfs_fsize_t);