All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: Sync max_inline_data_with_xattr from tools.
@ 2010-01-20  3:31 Tao Ma
  2010-01-26  3:51 ` Joel Becker
  0 siblings, 1 reply; 2+ messages in thread
From: Tao Ma @ 2010-01-20  3:31 UTC (permalink / raw)
  To: ocfs2-devel

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

Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
 fs/ocfs2/ocfs2_fs.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 1a1a679..7638a38 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -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)
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2: Sync max_inline_data_with_xattr from tools.
  2010-01-20  3:31 [Ocfs2-devel] [PATCH] ocfs2: Sync max_inline_data_with_xattr from tools Tao Ma
@ 2010-01-26  3:51 ` Joel Becker
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Becker @ 2010-01-26  3:51 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Jan 20, 2010 at 11:31:11AM +0800, Tao Ma wrote:
> In ocfs2-tools, we have added ocfs2_max_inline_data_with_xattr,
> so add it in the kernel's ocfs2_fs.h.
> 
> Signed-off-by: Tao Ma <tao.ma@oracle.com>

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

Joel

> ---
>  fs/ocfs2/ocfs2_fs.h |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
> index 1a1a679..7638a38 100644
> --- a/fs/ocfs2/ocfs2_fs.h
> +++ b/fs/ocfs2/ocfs2_fs.h
> @@ -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)
> -- 
> 1.6.3.3
> 

-- 

"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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-26  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20  3:31 [Ocfs2-devel] [PATCH] ocfs2: Sync max_inline_data_with_xattr from tools Tao Ma
2010-01-26  3:51 ` Joel Becker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.