Merge tag 'kvm-ppc-fixes-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / fs / f2fs / xattr.h
index de0c600b9cab0973cf2b8c5ba2b4c9e45da1214c..938fcd20565dccfdaa3a37a3cdd64abe4e1ab831 100644 (file)
@@ -49,7 +49,7 @@ struct f2fs_xattr_entry {
        __u8    e_name_index;
        __u8    e_name_len;
        __le16  e_value_size;   /* size of attribute value */
-       char    e_name[0];      /* attribute name */
+       char    e_name[];      /* attribute name */
 };
 
 #define XATTR_HDR(ptr)         ((struct f2fs_xattr_header *)(ptr))
@@ -73,7 +73,8 @@ struct f2fs_xattr_entry {
                                entry = XATTR_NEXT_ENTRY(entry))
 #define VALID_XATTR_BLOCK_SIZE (PAGE_SIZE - sizeof(struct node_footer))
 #define XATTR_PADDING_SIZE     (sizeof(__u32))
-#define XATTR_SIZE(x,i)                (((x) ? VALID_XATTR_BLOCK_SIZE : 0) +   \
+#define XATTR_SIZE(i)          ((F2FS_I(i)->i_xattr_nid ?              \
+                                       VALID_XATTR_BLOCK_SIZE : 0) +   \
                                                (inline_xattr_size(i)))
 #define MIN_OFFSET(i)          XATTR_ALIGN(inline_xattr_size(i) +      \
                                                VALID_XATTR_BLOCK_SIZE)
@@ -130,6 +131,8 @@ extern int f2fs_setxattr(struct inode *, int, const char *,
 extern int f2fs_getxattr(struct inode *, int, const char *, void *,
                                                size_t, struct page *);
 extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t);
+extern int f2fs_init_xattr_caches(struct f2fs_sb_info *);
+extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
 #else
 
 #define f2fs_xattr_handlers    NULL
@@ -150,6 +153,8 @@ static inline ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer,
 {
        return -EOPNOTSUPP;
 }
+static inline int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi) { return 0; }
+static inline void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { }
 #endif
 
 #ifdef CONFIG_F2FS_FS_SECURITY