diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-12 06:49:25 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-12 17:07:13 -0400 |
commit | 9fbe24d95ea36205a71195b378a163aa829dfe40 (patch) | |
tree | 052bc331490d82e6874fe7c812608cd123c37c38 | |
parent | a8da0da25c9fda7cbfd824979e824ac54d8eef07 (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>
-rw-r--r-- | fs/xfs/xfs_extfree_item.h | 88 | ||||
-rw-r--r-- | fs/xfs/xfs_log_format.h | 83 |
2 files changed, 85 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 | |||
21 | struct xfs_mount; | 23 | struct xfs_mount; |
22 | struct kmem_zone; | 24 | struct kmem_zone; |
23 | 25 | ||
24 | typedef 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 | |||
36 | typedef struct xfs_extent_32 { | ||
37 | __uint64_t ext_start; | ||
38 | __uint32_t ext_len; | ||
39 | } __attribute__((packed)) xfs_extent_32_t; | ||
40 | |||
41 | typedef 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 | */ | ||
52 | typedef 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 | |||
60 | typedef 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 | |||
68 | typedef 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 | */ | ||
81 | typedef 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 | |||
89 | typedef 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 | |||
97 | typedef 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); |
161 | void xfs_efi_item_free(xfs_efi_log_item_t *); | 79 | void 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__ */ |
diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h index 77a6024d1180..d1e93d38bd39 100644 --- a/fs/xfs/xfs_log_format.h +++ b/fs/xfs/xfs_log_format.h | |||
@@ -461,4 +461,87 @@ xfs_blft_from_flags(struct xfs_buf_log_format *blf) | |||
461 | return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT; | 461 | return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT; |
462 | } | 462 | } |
463 | 463 | ||
464 | /* | ||
465 | * EFI/EFD log format definitions | ||
466 | */ | ||
467 | typedef struct xfs_extent { | ||
468 | xfs_dfsbno_t ext_start; | ||
469 | xfs_extlen_t ext_len; | ||
470 | } xfs_extent_t; | ||
471 | |||
472 | /* | ||
473 | * Since an xfs_extent_t has types (start:64, len: 32) | ||
474 | * there are different alignments on 32 bit and 64 bit kernels. | ||
475 | * So we provide the different variants for use by a | ||
476 | * conversion routine. | ||
477 | */ | ||
478 | typedef struct xfs_extent_32 { | ||
479 | __uint64_t ext_start; | ||
480 | __uint32_t ext_len; | ||
481 | } __attribute__((packed)) xfs_extent_32_t; | ||
482 | |||
483 | typedef struct xfs_extent_64 { | ||
484 | __uint64_t ext_start; | ||
485 | __uint32_t ext_len; | ||
486 | __uint32_t ext_pad; | ||
487 | } xfs_extent_64_t; | ||
488 | |||
489 | /* | ||
490 | * This is the structure used to lay out an efi log item in the | ||
491 | * log. The efi_extents field is a variable size array whose | ||
492 | * size is given by efi_nextents. | ||
493 | */ | ||
494 | typedef struct xfs_efi_log_format { | ||
495 | __uint16_t efi_type; /* efi log item type */ | ||
496 | __uint16_t efi_size; /* size of this item */ | ||
497 | __uint32_t efi_nextents; /* # extents to free */ | ||
498 | __uint64_t efi_id; /* efi identifier */ | ||
499 | xfs_extent_t efi_extents[1]; /* array of extents to free */ | ||
500 | } xfs_efi_log_format_t; | ||
501 | |||
502 | typedef struct xfs_efi_log_format_32 { | ||
503 | __uint16_t efi_type; /* efi log item type */ | ||
504 | __uint16_t efi_size; /* size of this item */ | ||
505 | __uint32_t efi_nextents; /* # extents to free */ | ||
506 | __uint64_t efi_id; /* efi identifier */ | ||
507 | xfs_extent_32_t efi_extents[1]; /* array of extents to free */ | ||
508 | } __attribute__((packed)) xfs_efi_log_format_32_t; | ||
509 | |||
510 | typedef struct xfs_efi_log_format_64 { | ||
511 | __uint16_t efi_type; /* efi log item type */ | ||
512 | __uint16_t efi_size; /* size of this item */ | ||
513 | __uint32_t efi_nextents; /* # extents to free */ | ||
514 | __uint64_t efi_id; /* efi identifier */ | ||
515 | xfs_extent_64_t efi_extents[1]; /* array of extents to free */ | ||
516 | } xfs_efi_log_format_64_t; | ||
517 | |||
518 | /* | ||
519 | * This is the structure used to lay out an efd log item in the | ||
520 | * log. The efd_extents array is a variable size array whose | ||
521 | * size is given by efd_nextents; | ||
522 | */ | ||
523 | typedef struct xfs_efd_log_format { | ||
524 | __uint16_t efd_type; /* efd log item type */ | ||
525 | __uint16_t efd_size; /* size of this item */ | ||
526 | __uint32_t efd_nextents; /* # of extents freed */ | ||
527 | __uint64_t efd_efi_id; /* id of corresponding efi */ | ||
528 | xfs_extent_t efd_extents[1]; /* array of extents freed */ | ||
529 | } xfs_efd_log_format_t; | ||
530 | |||
531 | typedef struct xfs_efd_log_format_32 { | ||
532 | __uint16_t efd_type; /* efd log item type */ | ||
533 | __uint16_t efd_size; /* size of this item */ | ||
534 | __uint32_t efd_nextents; /* # of extents freed */ | ||
535 | __uint64_t efd_efi_id; /* id of corresponding efi */ | ||
536 | xfs_extent_32_t efd_extents[1]; /* array of extents freed */ | ||
537 | } __attribute__((packed)) xfs_efd_log_format_32_t; | ||
538 | |||
539 | typedef struct xfs_efd_log_format_64 { | ||
540 | __uint16_t efd_type; /* efd log item type */ | ||
541 | __uint16_t efd_size; /* size of this item */ | ||
542 | __uint32_t efd_nextents; /* # of extents freed */ | ||
543 | __uint64_t efd_efi_id; /* id of corresponding efi */ | ||
544 | xfs_extent_64_t efd_extents[1]; /* array of extents freed */ | ||
545 | } xfs_efd_log_format_64_t; | ||
546 | |||
464 | #endif /* __XFS_LOG_FORMAT_H__ */ | 547 | #endif /* __XFS_LOG_FORMAT_H__ */ |