#include <reiserfs/io.h>
#include <reiserfs/reiserfs_lib.h>
#include <reiserfs/reiserfs_fs.h>
-#include <linux/kdev_t.h>
#include "convert/source-fs.h"
#define REISERFS_ACL_VERSION 0x0001
-/* 23.2.5 acl_tag_t values */
-
-#define ACL_UNDEFINED_TAG (0x00)
-#define ACL_USER_OBJ (0x01)
-#define ACL_USER (0x02)
-#define ACL_GROUP_OBJ (0x04)
-#define ACL_GROUP (0x08)
-#define ACL_MASK (0x10)
-#define ACL_OTHER (0x20)
-
-/* 23.2.7 ACL qualifier constants */
-
-#define ACL_UNDEFINED_ID ((id_t)-1)
-
-typedef struct {
- __le16 e_tag;
- __le16 e_perm;
- __le32 e_id;
-} ext2_acl_entry;
-
-typedef struct {
- __le16 e_tag;
- __le16 e_perm;
-} ext2_acl_entry_short;
-
-typedef struct {
- __le32 a_version;
-} ext2_acl_header;
-
-#define ACL_EA_VERSION 0x0002
-
-typedef struct {
- __le16 e_tag;
- __le16 e_perm;
- __le32 e_id;
-} acl_ea_entry;
-
-typedef struct {
- __le32 a_version;
- acl_ea_entry a_entries[0];
-} acl_ea_header;
-
-static inline int ext2_acl_count(size_t size)
-{
- ssize_t s;
- size -= sizeof(ext2_acl_header);
- s = size - 4 * sizeof(ext2_acl_entry_short);
- if (s < 0) {
- if (size % sizeof(ext2_acl_entry_short))
- return -1;
- return size / sizeof(ext2_acl_entry_short);
- } else {
- if (s % sizeof(ext2_acl_entry))
- return -1;
- return s / sizeof(ext2_acl_entry) + 4;
- }
-}
-
-
-static inline size_t acl_ea_size(int count)
-{
- return sizeof(acl_ea_header) + count * sizeof(acl_ea_entry);
-}
-
-static inline dev_t new_decode_dev(u32 dev)
-{
- unsigned major = (dev & 0xfff00) >> 8;
- unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
-
- return MKDEV(major, minor);
-}
+#define OID_OFFSET (BTRFS_FIRST_FREE_OBJECTID - REISERFS_ROOT_OBJECTID)
+
+struct reiserfs_convert_info {
+ bool copy_attrs;
+ struct reiserfs_key privroot_key;
+ struct reiserfs_key xattr_key;
+
+ /* only set during copy_inodes */
+ struct task_ctx *progress;
+
+ /* used to track hardlinks */
+ unsigned used_slots;
+ unsigned alloced_slots;
+ u64 *objectids;
+};
+
+struct reiserfs_blk_iterate_data {
+ struct blk_iterate_data blk_data;
+ char *inline_data;
+ u64 inline_offset;
+ u32 inline_length;
+};
+
+struct reiserfs_dirent_data {
+ u64 index;
+ u32 convert_flags;
+ struct btrfs_inode_item *inode;
+ struct btrfs_root *root;
+};
+
+struct reiserfs_xattr_data {
+ struct btrfs_root *root;
+ struct btrfs_trans_handle *trans;
+ u64 target_oid;
+ const char *name;
+ size_t namelen;
+ void *body;
+ size_t len;
+};
#endif /* BTRFSCONVERT_REISERFS */