public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space
@ 2013-02-19  5:31 Jeff Liu
  2013-02-19 14:59 ` Mark Tinguely
  2013-02-20 20:12 ` Mark Tinguely
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Liu @ 2013-02-19  5:31 UTC (permalink / raw)
  To: xfs@oss.sgi.com; +Cc: Mark Tinguely

Sync the new helper xfs_calc_buf_res() to user space.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>

---
 libxfs/xfs_trans.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/libxfs/xfs_trans.c b/libxfs/xfs_trans.c
index 635de8f..d7ff1a9 100644
--- a/libxfs/xfs_trans.c
+++ b/libxfs/xfs_trans.c
@@ -23,6 +23,35 @@ kmem_zone_t	*xfs_trans_zone;
 kmem_zone_t	*xfs_log_item_desc_zone;
 
 /*
+ * A buffer has a format structure overhead in the log in addition
+ * to the data, so we need to take this into account when reserving
+ * space in a transaction for a buffer.  Round the space required up
+ * to a multiple of 128 bytes so that we don't change the historical
+ * reservation that has been used for this overhead.
+ */
+STATIC uint
+xfs_buf_log_overhead(void)
+{
+	return round_up(sizeof(struct xlog_op_header) +
+			sizeof(struct xfs_buf_log_format), 128);
+}
+
+/*
+ * Calculate out transaction log reservation per item in bytes.
+ *
+ * The nbufs argument is used to indicate the number of items that
+ * will be changed in a transaction.  size is used to tell how many
+ * bytes should be reserved per item.
+ */
+STATIC uint
+xfs_calc_buf_res(
+	uint		nbufs,
+	uint		size)
+{
+	return nbufs * (size + xfs_buf_log_overhead());
+}
+
+/*
  * Various log reservation values.
  *
  * These are based on the size of the file system block because that is what
-- 
1.7.9.5

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space
  2013-02-19  5:31 [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space Jeff Liu
@ 2013-02-19 14:59 ` Mark Tinguely
  2013-02-20 20:12 ` Mark Tinguely
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Tinguely @ 2013-02-19 14:59 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs@oss.sgi.com

On 02/18/13 23:31, Jeff Liu wrote:
> Sync the new helper xfs_calc_buf_res() to user space.
>
> Signed-off-by: Jie Liu<jeff.liu@oracle.com>
>
> ---

Looks good. No change since v2.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space
  2013-02-19  5:31 [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space Jeff Liu
  2013-02-19 14:59 ` Mark Tinguely
@ 2013-02-20 20:12 ` Mark Tinguely
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Tinguely @ 2013-02-20 20:12 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs@oss.sgi.com

On 02/18/13 23:31, Jeff Liu wrote:
> Sync the new helper xfs_calc_buf_res() to user space.
>
> Signed-off-by: Jie Liu<jeff.liu@oracle.com>
>
> ---


This series has been committed to OSS since they do no overlap the UBER 
patch:

commit 21f4e23356f1723ab67d8cf06f399410cb207af0
Author: Jeff Liu <jeff.liu@oracle.com>
Date:   Tue Feb 19 05:31:29 2013 +0000

     xfsprogs: rename max_attrset_trans_res_adjust to 
max_attrsetm_trans_res_adjust


commit 67910e8b71e773e0a7b9ca3523732aaf29e89f70
Author: Jeff Liu <jeff.liu@oracle.com>
Date:   Tue Feb 19 05:31:25 2013 +0000

     xfsprogs: sync the changes in transaction log space reservations to 
user space


commit 9aa758dee22eb386838ea87ef4c52a36803d4fd9
Author: Jeff Liu <jeff.liu@oracle.com>
Date:   Tue Feb 19 05:31:20 2013 +0000

     xfsprogs: sync xfs_calc_buf_res() to user space

Thanks Jeff,

--Mark.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2013-02-20 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19  5:31 [PATCH v3 1/3] xfsprogs: sync xfs_calc_buf_res() to user space Jeff Liu
2013-02-19 14:59 ` Mark Tinguely
2013-02-20 20:12 ` Mark Tinguely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox