aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_extfree_item.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:25 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 17:07:13 -0400
commit9fbe24d95ea36205a71195b378a163aa829dfe40 (patch)
tree052bc331490d82e6874fe7c812608cd123c37c38 /fs/xfs/xfs_extfree_item.h
parenta8da0da25c9fda7cbfd824979e824ac54d8eef07 (diff)
xfs: split out EFI/EFD log item format definition
The EFI/EFD item format definitions are shared with userspace. Split the 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_extfree_item.h')
-rw-r--r--fs/xfs/xfs_extfree_item.h88
1 files changed, 2 insertions, 86 deletions
diff --git a/fs/xfs/xfs_extfree_item.h b/fs/xfs/xfs_extfree_item.h
index 432222418c56..0ffbce32d569 100644
--- a/fs/xfs/xfs_extfree_item.h
+++ b/fs/xfs/xfs_extfree_item.h
@@ -18,93 +18,11 @@
18#ifndef __XFS_EXTFREE_ITEM_H__ 18#ifndef __XFS_EXTFREE_ITEM_H__
19#define __XFS_EXTFREE_ITEM_H__ 19#define __XFS_EXTFREE_ITEM_H__
20 20
21/* kernel only EFI/EFD definitions */
22
21struct xfs_mount; 23struct xfs_mount;
22struct kmem_zone; 24struct kmem_zone;
23 25
24typedef struct xfs_extent {
25 xfs_dfsbno_t ext_start;
26 xfs_extlen_t ext_len;
27} xfs_extent_t;
28
29/*
30 * Since an xfs_extent_t has types (start:64, len: 32)
31 * there are different alignments on 32 bit and 64 bit kernels.
32 * So we provide the different variants for use by a
33 * conversion routine.
34 */
35
36typedef struct xfs_extent_32 {
37 __uint64_t ext_start;
38 __uint32_t ext_len;
39} __attribute__((packed)) xfs_extent_32_t;
40
41typedef struct xfs_extent_64 {
42 __uint64_t ext_start;
43 __uint32_t ext_len;
44 __uint32_t ext_pad;
45} xfs_extent_64_t;
46
47/*
48 * This is the structure used to lay out an efi log item in the
49 * log. The efi_extents field is a variable size array whose
50 * size is given by efi_nextents.
51 */
52typedef struct xfs_efi_log_format {
53 __uint16_t efi_type; /* efi log item type */
54 __uint16_t efi_size; /* size of this item */
55 __uint32_t efi_nextents; /* # extents to free */
56 __uint64_t efi_id; /* efi identifier */
57 xfs_extent_t efi_extents[1]; /* array of extents to free */
58} xfs_efi_log_format_t;
59
60typedef struct xfs_efi_log_format_32 {
61 __uint16_t efi_type; /* efi log item type */
62 __uint16_t efi_size; /* size of this item */
63 __uint32_t efi_nextents; /* # extents to free */
64 __uint64_t efi_id; /* efi identifier */
65 xfs_extent_32_t efi_extents[1]; /* array of extents to free */
66} __attribute__((packed)) xfs_efi_log_format_32_t;
67
68typedef struct xfs_efi_log_format_64 {
69 __uint16_t efi_type; /* efi log item type */
70 __uint16_t efi_size; /* size of this item */
71 __uint32_t efi_nextents; /* # extents to free */
72 __uint64_t efi_id; /* efi identifier */
73 xfs_extent_64_t efi_extents[1]; /* array of extents to free */
74} xfs_efi_log_format_64_t;
75
76/*
77 * This is the structure used to lay out an efd log item in the
78 * log. The efd_extents array is a variable size array whose
79 * size is given by efd_nextents;
80 */
81typedef struct xfs_efd_log_format {
82 __uint16_t efd_type; /* efd log item type */
83 __uint16_t efd_size; /* size of this item */
84 __uint32_t efd_nextents; /* # of extents freed */
85 __uint64_t efd_efi_id; /* id of corresponding efi */
86 xfs_extent_t efd_extents[1]; /* array of extents freed */
87} xfs_efd_log_format_t;
88
89typedef struct xfs_efd_log_format_32 {
90 __uint16_t efd_type; /* efd log item type */
91 __uint16_t efd_size; /* size of this item */
92 __uint32_t efd_nextents; /* # of extents freed */
93 __uint64_t efd_efi_id; /* id of corresponding efi */
94 xfs_extent_32_t efd_extents[1]; /* array of extents freed */
95} __attribute__((packed)) xfs_efd_log_format_32_t;
96
97typedef struct xfs_efd_log_format_64 {
98 __uint16_t efd_type; /* efd log item type */
99 __uint16_t efd_size; /* size of this item */
100 __uint32_t efd_nextents; /* # of extents freed */
101 __uint64_t efd_efi_id; /* id of corresponding efi */
102 xfs_extent_64_t efd_extents[1]; /* array of extents freed */
103} xfs_efd_log_format_64_t;
104
105
106#ifdef __KERNEL__
107
108/* 26/*
109 * Max number of extents in fast allocation path. 27 * Max number of extents in fast allocation path.
110 */ 28 */
@@ -160,6 +78,4 @@ int xfs_efi_copy_format(xfs_log_iovec_t *buf,
160 xfs_efi_log_format_t *dst_efi_fmt); 78 xfs_efi_log_format_t *dst_efi_fmt);
161void xfs_efi_item_free(xfs_efi_log_item_t *); 79void xfs_efi_item_free(xfs_efi_log_item_t *);
162 80
163#endif /* __KERNEL__ */
164
165#endif /* __XFS_EXTFREE_ITEM_H__ */ 81#endif /* __XFS_EXTFREE_ITEM_H__ */