@@ -14,4 +14,33 @@ uint64_t xfs_flags2diflags2(struct xfs_inode *ip, unsigned int xflags);
uint32_t xfs_dic2xflags(uint16_t di_flags, uint64_t di_flags2,
bool has_attr);
+/*
+ * Project quota id helpers (previously projid was 16bit only and using two
+ * 16bit values to hold new 32bit projid was chosen to retain compatibility
+ * with "old" filesystems).
+ */
+static inline prid_t
+xfs_get_projid(struct xfs_icdinode *id)
+{
+ return (prid_t)id->di_projid_hi << 16 | id->di_projid_lo;
+}
+
+static inline void
+xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
+{
+ id->di_projid_hi = (uint16_t) (projid >> 16);
+ id->di_projid_lo = (uint16_t) (projid & 0xffff);
+}
+
+#define XFS_PROJID_DEFAULT 0
+
+static inline prid_t
+xfs_get_initial_prid(struct xfs_icdinode *id)
+{
+ if (id->di_flags & XFS_DIFLAG_PROJINHERIT)
+ return xfs_get_projid(id);
+
+ return XFS_PROJID_DEFAULT;
+}
+
#endif /* __XFS_INODE_UTIL_H__ */
@@ -165,33 +165,6 @@ xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags)
return ret;
}
-/*
- * Project quota id helpers (previously projid was 16bit only
- * and using two 16bit values to hold new 32bit projid was chosen
- * to retain compatibility with "old" filesystems).
- */
-static inline prid_t
-xfs_get_projid(struct xfs_icdinode *id)
-{
- return (prid_t)id->di_projid_hi << 16 | id->di_projid_lo;
-}
-
-static inline void
-xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
-{
- id->di_projid_hi = (uint16_t) (projid >> 16);
- id->di_projid_lo = (uint16_t) (projid & 0xffff);
-}
-
-static inline prid_t
-xfs_get_initial_prid(struct xfs_icdinode *id)
-{
- if (id->di_flags & XFS_DIFLAG_PROJINHERIT)
- return xfs_get_projid(id);
-
- return XFS_PROJID_DEFAULT;
-}
-
static inline bool xfs_is_reflink_inode(struct xfs_inode *ip)
{
return ip->i_d.di_flags2 & XFS_DIFLAG2_REFLINK;
@@ -138,8 +138,6 @@ typedef __u32 xfs_nlink_t;
*/
#define __this_address ({ __label__ __here; __here: barrier(); &&__here; })
-#define XFS_PROJID_DEFAULT 0
-
#define howmany(x, y) (((x)+((y)-1))/(y))
static inline void delay(long ticks)