Btrfs progs v4.16.1
[platform/upstream/btrfs-progs.git] / convert / source-reiserfs.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public
4  * License v2 as published by the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9  * General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the
13  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14  * Boston, MA 021110-1307, USA.
15  */
16
17 #ifndef __BTRFS_CONVERT_SOURCE_REISERFS_H__
18 #define __BTRFS_CONVERT_SOURCE_REISERFS_H__
19
20 #if BTRFSCONVERT_REISERFS
21
22 #include "kerncompat.h"
23 #include <reiserfs/misc.h>
24 #include <reiserfs/io.h>
25 #include <reiserfs/reiserfs_lib.h>
26 #include <reiserfs/reiserfs_fs.h>
27 #include "convert/source-fs.h"
28
29 #define REISERFS_ACL_VERSION    0x0001
30
31 #define OID_OFFSET (BTRFS_FIRST_FREE_OBJECTID - REISERFS_ROOT_OBJECTID)
32
33 struct reiserfs_convert_info {
34         bool copy_attrs;
35         struct reiserfs_key privroot_key;
36         struct reiserfs_key xattr_key;
37
38         /* only set during copy_inodes */
39         struct task_ctx *progress;
40
41         /* used to track hardlinks */
42         unsigned used_slots;
43         unsigned alloced_slots;
44         u64 *objectids;
45 };
46
47 struct reiserfs_blk_iterate_data {
48         struct blk_iterate_data blk_data;
49         char *inline_data;
50         u64 inline_offset;
51         u32 inline_length;
52 };
53
54 struct reiserfs_dirent_data {
55         u64 index;
56         u32 convert_flags;
57         struct btrfs_inode_item *inode;
58         struct btrfs_root *root;
59 };
60
61 struct reiserfs_xattr_data {
62         struct btrfs_root *root;
63         struct btrfs_trans_handle *trans;
64         u64 target_oid;
65         const char *name;
66         size_t namelen;
67         void *body;
68         size_t len;
69 };
70
71 #endif  /* BTRFSCONVERT_REISERFS */
72
73 #endif