diff options
author | Tao Ma <boyu.mt@taobao.com> | 2012-12-05 10:28:46 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-12-05 10:28:46 -0500 |
commit | 879b38257bf2b6fa8406693a3b5b5a0649e7c594 (patch) | |
tree | 5677d607180d2136b785e6ed4195555f5d76ff8c /fs/ext4/xattr.c | |
parent | 152a7b0a808a00601328feba2001cbb2b530f771 (diff) |
ext4: export inline xattr functions
The inline data feature will need some inline xattr functions, so
export them from fs/ext4/xattr.c so that inline.c can use them.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index b1adda1b750d..a47dc3883a23 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -61,11 +61,6 @@ | |||
61 | #include "xattr.h" | 61 | #include "xattr.h" |
62 | #include "acl.h" | 62 | #include "acl.h" |
63 | 63 | ||
64 | #define BHDR(bh) ((struct ext4_xattr_header *)((bh)->b_data)) | ||
65 | #define ENTRY(ptr) ((struct ext4_xattr_entry *)(ptr)) | ||
66 | #define BFIRST(bh) ENTRY(BHDR(bh)+1) | ||
67 | #define IS_LAST_ENTRY(entry) (*(__u32 *)(entry) == 0) | ||
68 | |||
69 | #ifdef EXT4_XATTR_DEBUG | 64 | #ifdef EXT4_XATTR_DEBUG |
70 | # define ea_idebug(inode, f...) do { \ | 65 | # define ea_idebug(inode, f...) do { \ |
71 | printk(KERN_DEBUG "inode %s:%lu: ", \ | 66 | printk(KERN_DEBUG "inode %s:%lu: ", \ |
@@ -312,7 +307,7 @@ cleanup: | |||
312 | return error; | 307 | return error; |
313 | } | 308 | } |
314 | 309 | ||
315 | static int | 310 | int |
316 | ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name, | 311 | ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name, |
317 | void *buffer, size_t buffer_size) | 312 | void *buffer, size_t buffer_size) |
318 | { | 313 | { |
@@ -581,21 +576,6 @@ static size_t ext4_xattr_free_space(struct ext4_xattr_entry *last, | |||
581 | return (*min_offs - ((void *)last - base) - sizeof(__u32)); | 576 | return (*min_offs - ((void *)last - base) - sizeof(__u32)); |
582 | } | 577 | } |
583 | 578 | ||
584 | struct ext4_xattr_info { | ||
585 | int name_index; | ||
586 | const char *name; | ||
587 | const void *value; | ||
588 | size_t value_len; | ||
589 | }; | ||
590 | |||
591 | struct ext4_xattr_search { | ||
592 | struct ext4_xattr_entry *first; | ||
593 | void *base; | ||
594 | void *end; | ||
595 | struct ext4_xattr_entry *here; | ||
596 | int not_found; | ||
597 | }; | ||
598 | |||
599 | static int | 579 | static int |
600 | ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s) | 580 | ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s) |
601 | { | 581 | { |
@@ -949,14 +929,8 @@ bad_block: | |||
949 | #undef header | 929 | #undef header |
950 | } | 930 | } |
951 | 931 | ||
952 | struct ext4_xattr_ibody_find { | 932 | int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, |
953 | struct ext4_xattr_search s; | 933 | struct ext4_xattr_ibody_find *is) |
954 | struct ext4_iloc iloc; | ||
955 | }; | ||
956 | |||
957 | static int | ||
958 | ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, | ||
959 | struct ext4_xattr_ibody_find *is) | ||
960 | { | 934 | { |
961 | struct ext4_xattr_ibody_header *header; | 935 | struct ext4_xattr_ibody_header *header; |
962 | struct ext4_inode *raw_inode; | 936 | struct ext4_inode *raw_inode; |
@@ -984,10 +958,9 @@ ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, | |||
984 | return 0; | 958 | return 0; |
985 | } | 959 | } |
986 | 960 | ||
987 | static int | 961 | int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, |
988 | ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | 962 | struct ext4_xattr_info *i, |
989 | struct ext4_xattr_info *i, | 963 | struct ext4_xattr_ibody_find *is) |
990 | struct ext4_xattr_ibody_find *is) | ||
991 | { | 964 | { |
992 | struct ext4_xattr_ibody_header *header; | 965 | struct ext4_xattr_ibody_header *header; |
993 | struct ext4_xattr_search *s = &is->s; | 966 | struct ext4_xattr_search *s = &is->s; |