diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-12 06:49:22 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-12 17:03:51 -0400 |
commit | fc06c6d064dd50f7aa157065ef79216190d75c91 (patch) | |
tree | 014e558cfc5a9c55a795e0988b4e320a0a8f60df /fs/xfs/xfs_log.h | |
parent | 7a378c9aeab3782a5f998c17313bc7027cee3454 (diff) |
xfs: separate out log format definitions
The on-disk format definitions for the log are spread randoms
through a couple of header files. Consolidate it all in a single
file that can be shared easily with userspace. This means that
xfs_log.h and xfs_log_priv.h no longer need to be shared with
userspace.
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_log.h')
-rw-r--r-- | fs/xfs/xfs_log.h | 89 |
1 files changed, 21 insertions, 68 deletions
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index fb630e496c12..e63d9e10bd69 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h | |||
@@ -18,14 +18,29 @@ | |||
18 | #ifndef __XFS_LOG_H__ | 18 | #ifndef __XFS_LOG_H__ |
19 | #define __XFS_LOG_H__ | 19 | #define __XFS_LOG_H__ |
20 | 20 | ||
21 | /* get lsn fields */ | 21 | #include "xfs_log_format.h" |
22 | #define CYCLE_LSN(lsn) ((uint)((lsn)>>32)) | ||
23 | #define BLOCK_LSN(lsn) ((uint)(lsn)) | ||
24 | 22 | ||
25 | /* this is used in a spot where we might otherwise double-endian-flip */ | 23 | struct xfs_log_vec { |
26 | #define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0]) | 24 | struct xfs_log_vec *lv_next; /* next lv in build list */ |
25 | int lv_niovecs; /* number of iovecs in lv */ | ||
26 | struct xfs_log_iovec *lv_iovecp; /* iovec array */ | ||
27 | struct xfs_log_item *lv_item; /* owner */ | ||
28 | char *lv_buf; /* formatted buffer */ | ||
29 | int lv_buf_len; /* size of formatted buffer */ | ||
30 | }; | ||
31 | |||
32 | #define XFS_LOG_VEC_ORDERED (-1) | ||
33 | |||
34 | /* | ||
35 | * Structure used to pass callback function and the function's argument | ||
36 | * to the log manager. | ||
37 | */ | ||
38 | typedef struct xfs_log_callback { | ||
39 | struct xfs_log_callback *cb_next; | ||
40 | void (*cb_func)(void *, int); | ||
41 | void *cb_arg; | ||
42 | } xfs_log_callback_t; | ||
27 | 43 | ||
28 | #ifdef __KERNEL__ | ||
29 | /* | 44 | /* |
30 | * By comparing each component, we don't have to worry about extra | 45 | * By comparing each component, we don't have to worry about extra |
31 | * endian issues in treating two 32 bit numbers as one 64 bit number | 46 | * endian issues in treating two 32 bit numbers as one 64 bit number |
@@ -59,67 +74,6 @@ static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) | |||
59 | */ | 74 | */ |
60 | #define XFS_LOG_SYNC 0x1 | 75 | #define XFS_LOG_SYNC 0x1 |
61 | 76 | ||
62 | #endif /* __KERNEL__ */ | ||
63 | |||
64 | |||
65 | /* Log Clients */ | ||
66 | #define XFS_TRANSACTION 0x69 | ||
67 | #define XFS_VOLUME 0x2 | ||
68 | #define XFS_LOG 0xaa | ||
69 | |||
70 | |||
71 | /* Region types for iovec's i_type */ | ||
72 | #define XLOG_REG_TYPE_BFORMAT 1 | ||
73 | #define XLOG_REG_TYPE_BCHUNK 2 | ||
74 | #define XLOG_REG_TYPE_EFI_FORMAT 3 | ||
75 | #define XLOG_REG_TYPE_EFD_FORMAT 4 | ||
76 | #define XLOG_REG_TYPE_IFORMAT 5 | ||
77 | #define XLOG_REG_TYPE_ICORE 6 | ||
78 | #define XLOG_REG_TYPE_IEXT 7 | ||
79 | #define XLOG_REG_TYPE_IBROOT 8 | ||
80 | #define XLOG_REG_TYPE_ILOCAL 9 | ||
81 | #define XLOG_REG_TYPE_IATTR_EXT 10 | ||
82 | #define XLOG_REG_TYPE_IATTR_BROOT 11 | ||
83 | #define XLOG_REG_TYPE_IATTR_LOCAL 12 | ||
84 | #define XLOG_REG_TYPE_QFORMAT 13 | ||
85 | #define XLOG_REG_TYPE_DQUOT 14 | ||
86 | #define XLOG_REG_TYPE_QUOTAOFF 15 | ||
87 | #define XLOG_REG_TYPE_LRHEADER 16 | ||
88 | #define XLOG_REG_TYPE_UNMOUNT 17 | ||
89 | #define XLOG_REG_TYPE_COMMIT 18 | ||
90 | #define XLOG_REG_TYPE_TRANSHDR 19 | ||
91 | #define XLOG_REG_TYPE_ICREATE 20 | ||
92 | #define XLOG_REG_TYPE_MAX 20 | ||
93 | |||
94 | typedef struct xfs_log_iovec { | ||
95 | void *i_addr; /* beginning address of region */ | ||
96 | int i_len; /* length in bytes of region */ | ||
97 | uint i_type; /* type of region */ | ||
98 | } xfs_log_iovec_t; | ||
99 | |||
100 | struct xfs_log_vec { | ||
101 | struct xfs_log_vec *lv_next; /* next lv in build list */ | ||
102 | int lv_niovecs; /* number of iovecs in lv */ | ||
103 | struct xfs_log_iovec *lv_iovecp; /* iovec array */ | ||
104 | struct xfs_log_item *lv_item; /* owner */ | ||
105 | char *lv_buf; /* formatted buffer */ | ||
106 | int lv_buf_len; /* size of formatted buffer */ | ||
107 | }; | ||
108 | |||
109 | #define XFS_LOG_VEC_ORDERED (-1) | ||
110 | |||
111 | /* | ||
112 | * Structure used to pass callback function and the function's argument | ||
113 | * to the log manager. | ||
114 | */ | ||
115 | typedef struct xfs_log_callback { | ||
116 | struct xfs_log_callback *cb_next; | ||
117 | void (*cb_func)(void *, int); | ||
118 | void *cb_arg; | ||
119 | } xfs_log_callback_t; | ||
120 | |||
121 | |||
122 | #ifdef __KERNEL__ | ||
123 | /* Log manager interfaces */ | 77 | /* Log manager interfaces */ |
124 | struct xfs_mount; | 78 | struct xfs_mount; |
125 | struct xlog_in_core; | 79 | struct xlog_in_core; |
@@ -188,5 +142,4 @@ void xfs_log_work_queue(struct xfs_mount *mp); | |||
188 | void xfs_log_worker(struct work_struct *work); | 142 | void xfs_log_worker(struct work_struct *work); |
189 | void xfs_log_quiesce(struct xfs_mount *mp); | 143 | void xfs_log_quiesce(struct xfs_mount *mp); |
190 | 144 | ||
191 | #endif | ||
192 | #endif /* __XFS_LOG_H__ */ | 145 | #endif /* __XFS_LOG_H__ */ |