free(ext2_inode);
return ret;
}
-#define MINORBITS 20
-#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi))
static inline dev_t old_decode_dev(u16 val)
{
return MKDEV((val >> 8) & 255, val & 255);
}
-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);
-}
-
static void ext2_copy_inode_item(struct btrfs_inode_item *dst,
struct ext2_inode *src, u32 blocksize)
{
old_decode_dev(src->i_block[0]));
} else {
btrfs_set_stack_inode_rdev(dst,
- new_decode_dev(src->i_block[1]));
+ decode_dev(src->i_block[1]));
}
}
memset(&dst->reserved, 0, sizeof(dst->reserved));
{ BTRFS_SB_MIRROR_OFFSET(2), SZ_64K }
};
+dev_t decode_dev(u32 dev)
+{
+ unsigned major = (dev & 0xfff00) >> 8;
+ unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
+
+ return MKDEV(major, minor);
+}
+
int ext2_acl_count(size_t size)
{
ssize_t s;
#define __BTRFS_CONVERT_SOURCE_FS_H__
#include "kerncompat.h"
+#include <linux/kdev_t.h>
#include <pthread.h>
-
#define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID
/*
int ext2_acl_count(size_t size);
+#ifndef MKDEV
+#define MINORBITS 20
+#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi))
+#endif
+
+dev_t decode_dev(u32 dev);
+
struct btrfs_convert_operations {
const char name[SOURCE_FS_NAME_LEN];
int (*open_fs)(struct btrfs_convert_context *cctx, const char *devname);
btrfs_set_stack_timespec_sec(&inode->mtime, sd_v1_mtime(sd));
if (!S_ISREG(mode) && !S_ISDIR(mode) && !S_ISLNK(mode))
- rdev = new_decode_dev(sd_v1_rdev(sd));
+ rdev = decode_dev(sd_v1_rdev(sd));
} else {
struct stat_data *sd = stat_data;
btrfs_set_stack_timespec_sec(&inode->mtime, sd_v2_mtime(sd));
if (!S_ISREG(mode) && !S_ISDIR(mode) && !S_ISLNK(mode))
- rdev = new_decode_dev(sd_v2_rdev(sd));
+ rdev = decode_dev(sd_v2_rdev(sd));
if (copy_inode_flags)
reiserfs_convert_inode_flags(inode, sd);
#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
-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);
-}
-
#endif /* BTRFSCONVERT_REISERFS */
#endif