X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=convert%2Fsource-fs.h;h=f5314aff20aea0de56d3e78fc8a34eab532e234c;hb=f5dd778f5299088f89d380ce922a84d77a98b9d6;hp=3a6fa46cd3d0949a354a0ad255ee2261cd187e17;hpb=1639cc2a511cb6f2a40b706b3c41e5cb4e01b809;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/convert/source-fs.h b/convert/source-fs.h index 3a6fa46..f5314af 100644 --- a/convert/source-fs.h +++ b/convert/source-fs.h @@ -18,8 +18,10 @@ #define __BTRFS_CONVERT_SOURCE_FS_H__ #include "kerncompat.h" +#include +#include #include - +#include #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID @@ -55,6 +57,62 @@ struct btrfs_convert_context; #define CONVERT_FLAG_COPY_LABEL (1U << 3) #define CONVERT_FLAG_SET_LABEL (1U << 4) +/* 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) + +#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; + +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; + +static inline size_t acl_ea_size(int count) +{ + return sizeof(acl_ea_header) + count * sizeof(acl_ea_entry); +} + +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);