f2fs: fix to do sanity check with inode.i_inline_xattr_size
[linux-2.6-block.git] / fs / f2fs / xattr.h
index 67db134da0f5f6da01ff505d956e60069114767d..9172ee082ca830f9159f5a7ac73b3fca52cfa4e4 100644 (file)
@@ -78,6 +78,12 @@ struct f2fs_xattr_entry {
                                sizeof(struct f2fs_xattr_header) -      \
                                sizeof(struct f2fs_xattr_entry))
 
+#define MAX_INLINE_XATTR_SIZE                                          \
+                       (DEF_ADDRS_PER_INODE -                          \
+                       F2FS_TOTAL_EXTRA_ATTR_SIZE / sizeof(__le32) -   \
+                       DEF_INLINE_RESERVED_SIZE -                      \
+                       MIN_INLINE_DENTRY_SIZE / sizeof(__le32))
+
 /*
  * On-disk structure of f2fs_xattr
  * We use inline xattrs space + 1 block for xattr.