Skip to contentSkip to conversation

ocfs2: Sync max_inline_data_with_xattr from tools.

PATCH New Tao Ma 2 participants 2 messages Jan 20, 2010 – Jan 26, 2010 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: Sync max_inline_data_with_xattr from tools.

In ocfs2-tools, we have added ocfs2_max_inline_data_with_xattr, so add it in the kernel's ocfs2_fs.h.

---
 fs/ocfs2/ocfs2_fs.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
fs/ocfs2/ocfs2_fs.h +9 -2
index 1a1a679..7638a38 100644
@@ -1417,9 +1417,16 @@ static inline int ocfs2_fast_symlink_chars(int blocksize)
 	return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink);
 }
 
-static inline int ocfs2_max_inline_data(int blocksize)
+static inline int ocfs2_max_inline_data_with_xattr(int blocksize,
+						   struct ocfs2_dinode *di)
 {
-	return blocksize - offsetof(struct ocfs2_dinode, id2.i_data.id_data);
+	if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL))
+		return blocksize -
+			offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
+			di->i_xattr_inline_size;
+	else
+		return blocksize -
+			offsetof(struct ocfs2_dinode, id2.i_data.id_data);
 }
 
 static inline int ocfs2_extent_recs_per_inode(int blocksize)
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 ocfs2: Sync max_inline_data_with_xattr from tools.

Quoted 4 lines · Tao Ma

In ocfs2-tools, we have added ocfs2_max_inline_data_with_xattr, so add it in the kernel's ocfs2_fs.h.

This patch is now part of the 'fixes' branch of ocfs2.git

Joel

Quoted 30 lines
---
 fs/ocfs2/ocfs2_fs.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
fs/ocfs2/ocfs2_fs.h +9 -2
index 1a1a679..7638a38 100644
@@ -1417,9 +1417,16 @@ static inline int ocfs2_fast_symlink_chars(int blocksize)
 	return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink);
 }
 
-static inline int ocfs2_max_inline_data(int blocksize)
+static inline int ocfs2_max_inline_data_with_xattr(int blocksize,
+						   struct ocfs2_dinode *di)
 {
-	return blocksize - offsetof(struct ocfs2_dinode, id2.i_data.id_data);
+	if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL))
+		return blocksize -
+			offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
+			di->i_xattr_inline_size;
+	else
+		return blocksize -
+			offsetof(struct ocfs2_dinode, id2.i_data.id_data);
 }
 
 static inline int ocfs2_extent_recs_per_inode(int blocksize)
Signature · 1 line
1.6.3.3
Signature · 10 lines
"What does it say about a society's priorities when the time you
 spend in meetings on Monday is greater than the total number of
 hours you spent sleeping over the weekend?"
	- Nat Friedman

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127