]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - include/xfs_inode.h
xfs: fix off-by-one error in xfs_rtalloc_query_range
[thirdparty/xfsprogs-dev.git] / include / xfs_inode.h
index 8766024e3befc16ead19e27aa75b711c54a317c9..f29f0f0d388cfdad1aa768f13d86b4eef705ef0c 100644 (file)
@@ -36,6 +36,7 @@ struct xfs_dir_ops;
 struct inode {
        mode_t          i_mode;
        uint32_t        i_nlink;
+       xfs_dev_t       i_rdev;         /* This actually holds xfs_dev_t */
        uint32_t        i_generation;
        uint64_t        i_version;
        struct timespec i_atime;
@@ -65,11 +66,24 @@ typedef struct xfs_inode {
        struct inode            i_vnode;
 } xfs_inode_t;
 
+/* Convert from vfs inode to xfs inode */
+static inline struct xfs_inode *XFS_I(struct inode *inode)
+{
+       return container_of(inode, struct xfs_inode, i_vnode);
+}
+
+/* convert from xfs inode to vfs inode */
 static inline struct inode *VFS_I(struct xfs_inode *ip)
 {
        return &ip->i_vnode;
 }
 
+/* We only have i_size in the xfs inode in userspace */
+static inline loff_t i_size_read(struct inode *inode)
+{
+       return XFS_I(inode)->i_size;
+}
+
 /*
  * wrappers around the mode checks to simplify code
  */
@@ -148,8 +162,11 @@ extern void        libxfs_trans_ichgtime(struct xfs_trans *,
 extern int     libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *);
 
 /* Inode Cache Interfaces */
+extern bool    libxfs_inode_verify_forks(struct xfs_inode *ip,
+                               struct xfs_ifork_ops *);
 extern int     libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
-                               uint, struct xfs_inode **);
+                               uint, struct xfs_inode **,
+                               struct xfs_ifork_ops *);
 extern void    libxfs_iput(struct xfs_inode *);
 
 #define IRELE(ip) libxfs_iput(ip)