hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/fs/xfs/libxfs/xfs_inode_buf.h
....@@ -16,20 +16,12 @@
1616 * format specific structures at the appropriate time.
1717 */
1818 struct xfs_icdinode {
19
- int8_t di_version; /* inode version */
20
- int8_t di_format; /* format of di_c data */
2119 uint16_t di_flushiter; /* incremented on flush */
22
- uint32_t di_uid; /* owner's user id */
23
- uint32_t di_gid; /* owner's group id */
24
- uint16_t di_projid_lo; /* lower part of owner's project id */
25
- uint16_t di_projid_hi; /* higher part of owner's project id */
20
+ prid_t di_projid; /* owner's project id */
2621 xfs_fsize_t di_size; /* number of bytes in file */
2722 xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */
2823 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
29
- xfs_extnum_t di_nextents; /* number of extents in data fork */
30
- xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
3124 uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
32
- int8_t di_aformat; /* format of attr fork's data */
3325 uint32_t di_dmevmask; /* DMIG event mask */
3426 uint16_t di_dmstate; /* DMIG state info */
3527 uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
....@@ -37,8 +29,13 @@
3729 uint64_t di_flags2; /* more random flags */
3830 uint32_t di_cowextsize; /* basic cow extent size for file */
3931
40
- xfs_ictimestamp_t di_crtime; /* time created */
32
+ struct timespec64 di_crtime; /* time created */
4133 };
34
+
35
+static inline bool xfs_icdinode_has_bigtime(const struct xfs_icdinode *icd)
36
+{
37
+ return icd->di_flags2 & XFS_DIFLAG2_BIGTIME;
38
+}
4239
4340 /*
4441 * Inode location information. Stored in the inode and passed to
....@@ -52,23 +49,11 @@
5249
5350 int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
5451 struct xfs_imap *, struct xfs_dinode **,
55
- struct xfs_buf **, uint, uint);
56
-int xfs_iread(struct xfs_mount *, struct xfs_trans *,
57
- struct xfs_inode *, uint);
52
+ struct xfs_buf **, uint);
5853 void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
5954 void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
6055 xfs_lsn_t lsn);
61
-void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
62
-void xfs_log_dinode_to_disk(struct xfs_log_dinode *from,
63
- struct xfs_dinode *to);
64
-
65
-bool xfs_dinode_good_version(struct xfs_mount *mp, __u8 version);
66
-
67
-#if defined(DEBUG)
68
-void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
69
-#else
70
-#define xfs_inobp_check(mp, bp)
71
-#endif /* DEBUG */
56
+int xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
7257
7358 xfs_failaddr_t xfs_dinode_verify(struct xfs_mount *mp, xfs_ino_t ino,
7459 struct xfs_dinode *dip);
....@@ -78,4 +63,12 @@
7863 uint32_t cowextsize, uint16_t mode, uint16_t flags,
7964 uint64_t flags2);
8065
66
+static inline uint64_t xfs_inode_encode_bigtime(struct timespec64 tv)
67
+{
68
+ return xfs_unix_to_bigtime(tv.tv_sec) * NSEC_PER_SEC + tv.tv_nsec;
69
+}
70
+
71
+struct timespec64 xfs_inode_from_disk_ts(struct xfs_dinode *dip,
72
+ const xfs_timestamp_t ts);
73
+
8174 #endif /* __XFS_INODE_BUF_H__ */