aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_item.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:23 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 17:05:19 -0400
commit69432832fd7466c20c7c92cbd92c561ac78988c2 (patch)
treee88e0d4698eab40c93248c7be3b7d8d2ffd52c19 /fs/xfs/xfs_inode_item.h
parentfc06c6d064dd50f7aa157065ef79216190d75c91 (diff)
xfs: split out inode log item format definition
The log item format definitions are shared with userspace. Split them out of header files that contain kernel only defintions to make it simple to shared them. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode_item.h')
-rw-r--r--fs/xfs/xfs_inode_item.h115
1 files changed, 2 insertions, 113 deletions
diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h
index 779812fb3d80..dce4d656768c 100644
--- a/fs/xfs/xfs_inode_item.h
+++ b/fs/xfs/xfs_inode_item.h
@@ -18,123 +18,13 @@
18#ifndef __XFS_INODE_ITEM_H__ 18#ifndef __XFS_INODE_ITEM_H__
19#define __XFS_INODE_ITEM_H__ 19#define __XFS_INODE_ITEM_H__
20 20
21/* 21/* kernel only definitions */
22 * This is the structure used to lay out an inode log item in the
23 * log. The size of the inline data/extents/b-tree root to be logged
24 * (if any) is indicated in the ilf_dsize field. Changes to this structure
25 * must be added on to the end.
26 */
27typedef struct xfs_inode_log_format {
28 __uint16_t ilf_type; /* inode log item type */
29 __uint16_t ilf_size; /* size of this item */
30 __uint32_t ilf_fields; /* flags for fields logged */
31 __uint16_t ilf_asize; /* size of attr d/ext/root */
32 __uint16_t ilf_dsize; /* size of data/ext/root */
33 __uint64_t ilf_ino; /* inode number */
34 union {
35 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
36 uuid_t ilfu_uuid; /* mount point value */
37 } ilf_u;
38 __int64_t ilf_blkno; /* blkno of inode buffer */
39 __int32_t ilf_len; /* len of inode buffer */
40 __int32_t ilf_boffset; /* off of inode in buffer */
41} xfs_inode_log_format_t;
42
43typedef struct xfs_inode_log_format_32 {
44 __uint16_t ilf_type; /* inode log item type */
45 __uint16_t ilf_size; /* size of this item */
46 __uint32_t ilf_fields; /* flags for fields logged */
47 __uint16_t ilf_asize; /* size of attr d/ext/root */
48 __uint16_t ilf_dsize; /* size of data/ext/root */
49 __uint64_t ilf_ino; /* inode number */
50 union {
51 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
52 uuid_t ilfu_uuid; /* mount point value */
53 } ilf_u;
54 __int64_t ilf_blkno; /* blkno of inode buffer */
55 __int32_t ilf_len; /* len of inode buffer */
56 __int32_t ilf_boffset; /* off of inode in buffer */
57} __attribute__((packed)) xfs_inode_log_format_32_t;
58
59typedef struct xfs_inode_log_format_64 {
60 __uint16_t ilf_type; /* inode log item type */
61 __uint16_t ilf_size; /* size of this item */
62 __uint32_t ilf_fields; /* flags for fields logged */
63 __uint16_t ilf_asize; /* size of attr d/ext/root */
64 __uint16_t ilf_dsize; /* size of data/ext/root */
65 __uint32_t ilf_pad; /* pad for 64 bit boundary */
66 __uint64_t ilf_ino; /* inode number */
67 union {
68 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
69 uuid_t ilfu_uuid; /* mount point value */
70 } ilf_u;
71 __int64_t ilf_blkno; /* blkno of inode buffer */
72 __int32_t ilf_len; /* len of inode buffer */
73 __int32_t ilf_boffset; /* off of inode in buffer */
74} xfs_inode_log_format_64_t;
75
76/*
77 * Flags for xfs_trans_log_inode flags field.
78 */
79#define XFS_ILOG_CORE 0x001 /* log standard inode fields */
80#define XFS_ILOG_DDATA 0x002 /* log i_df.if_data */
81#define XFS_ILOG_DEXT 0x004 /* log i_df.if_extents */
82#define XFS_ILOG_DBROOT 0x008 /* log i_df.i_broot */
83#define XFS_ILOG_DEV 0x010 /* log the dev field */
84#define XFS_ILOG_UUID 0x020 /* log the uuid field */
85#define XFS_ILOG_ADATA 0x040 /* log i_af.if_data */
86#define XFS_ILOG_AEXT 0x080 /* log i_af.if_extents */
87#define XFS_ILOG_ABROOT 0x100 /* log i_af.i_broot */
88
89
90/*
91 * The timestamps are dirty, but not necessarily anything else in the inode
92 * core. Unlike the other fields above this one must never make it to disk
93 * in the ilf_fields of the inode_log_format, but is purely store in-memory in
94 * ili_fields in the inode_log_item.
95 */
96#define XFS_ILOG_TIMESTAMP 0x4000
97
98#define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
99 XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
100 XFS_ILOG_UUID | XFS_ILOG_ADATA | \
101 XFS_ILOG_AEXT | XFS_ILOG_ABROOT)
102
103#define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
104 XFS_ILOG_DBROOT)
105
106#define XFS_ILOG_AFORK (XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
107 XFS_ILOG_ABROOT)
108
109#define XFS_ILOG_ALL (XFS_ILOG_CORE | XFS_ILOG_DDATA | \
110 XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
111 XFS_ILOG_DEV | XFS_ILOG_UUID | \
112 XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
113 XFS_ILOG_ABROOT | XFS_ILOG_TIMESTAMP)
114
115static inline int xfs_ilog_fbroot(int w)
116{
117 return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
118}
119
120static inline int xfs_ilog_fext(int w)
121{
122 return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
123}
124
125static inline int xfs_ilog_fdata(int w)
126{
127 return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA);
128}
129
130#ifdef __KERNEL__
131 22
132struct xfs_buf; 23struct xfs_buf;
133struct xfs_bmbt_rec; 24struct xfs_bmbt_rec;
134struct xfs_inode; 25struct xfs_inode;
135struct xfs_mount; 26struct xfs_mount;
136 27
137
138typedef struct xfs_inode_log_item { 28typedef struct xfs_inode_log_item {
139 xfs_log_item_t ili_item; /* common portion */ 29 xfs_log_item_t ili_item; /* common portion */
140 struct xfs_inode *ili_inode; /* inode ptr */ 30 struct xfs_inode *ili_inode; /* inode ptr */
@@ -151,7 +41,6 @@ typedef struct xfs_inode_log_item {
151 xfs_inode_log_format_t ili_format; /* logged structure */ 41 xfs_inode_log_format_t ili_format; /* logged structure */
152} xfs_inode_log_item_t; 42} xfs_inode_log_item_t;
153 43
154
155static inline int xfs_inode_clean(xfs_inode_t *ip) 44static inline int xfs_inode_clean(xfs_inode_t *ip)
156{ 45{
157 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); 46 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
@@ -165,6 +54,6 @@ extern void xfs_iflush_abort(struct xfs_inode *, bool);
165extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, 54extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
166 xfs_inode_log_format_t *); 55 xfs_inode_log_format_t *);
167 56
168#endif /* __KERNEL__ */ 57extern struct kmem_zone *xfs_ili_zone;
169 58
170#endif /* __XFS_INODE_ITEM_H__ */ 59#endif /* __XFS_INODE_ITEM_H__ */