public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Cc: Allison Henderson <allison.henderson@oracle.com>
Subject: [RFC PATCH 07/13] Add the extra space requirements for parent pointer attributes when calculating the minimum log size during mkfs
Date: Wed,  9 Aug 2017 18:41:27 -0700	[thread overview]
Message-ID: <1502329293-4091-8-git-send-email-allison.henderson@oracle.com> (raw)
In-Reply-To: <1502329293-4091-1-git-send-email-allison.henderson@oracle.com>

Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
---
:100644 100644 c105979... beec9bf... M	fs/xfs/libxfs/xfs_log_rlimit.c
 fs/xfs/libxfs/xfs_log_rlimit.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/fs/xfs/libxfs/xfs_log_rlimit.c b/fs/xfs/libxfs/xfs_log_rlimit.c
index c105979..beec9bf 100644
--- a/fs/xfs/libxfs/xfs_log_rlimit.c
+++ b/fs/xfs/libxfs/xfs_log_rlimit.c
@@ -39,6 +39,40 @@ xfs_log_calc_max_attrsetm_res(
 {
 	int			size;
 	int			nblks;
+	struct xfs_trans_resv   *resp = M_RES(mp);
+
+	/* Calculate extra space needed for parent pointer attributes */
+	if (!xfs_sb_version_hasparent(&mp->m_sb)) {
+
+		/* rename can add/remove/modify 2 parent attributes */
+		resp->tr_rename.tr_logres +=
+			2 * max(resp->tr_attrsetm.tr_logres,
+				resp->tr_attrrm.tr_logres);
+		resp->tr_rename.tr_logcount +=
+			2 * max(resp->tr_attrsetm.tr_logcount,
+				resp->tr_attrrm.tr_logcount);
+
+		/* create will add 1 parent attribute */
+		resp->tr_create.tr_logres += resp->tr_attrsetm.tr_logres;
+		resp->tr_create.tr_logcount += resp->tr_attrsetm.tr_logcount;
+
+		/* mkdir will add 1 parent attribute */
+		resp->tr_mkdir.tr_logres += resp->tr_attrsetm.tr_logres;
+		resp->tr_mkdir.tr_logcount += resp->tr_attrsetm.tr_logcount;
+
+		/* link will add 1 parent attribute */
+		resp->tr_link.tr_logres += resp->tr_attrsetm.tr_logres;
+		resp->tr_link.tr_logcount += resp->tr_attrsetm.tr_logcount;
+
+		/* symlink will add 1 parent attribute */
+		resp->tr_symlink.tr_logres += resp->tr_attrsetm.tr_logres;
+		resp->tr_symlink.tr_logcount += resp->tr_attrsetm.tr_logcount;
+
+		/* remove will remove 1 parent attribute */
+		resp->tr_remove.tr_logres += resp->tr_attrrm.tr_logres;
+		resp->tr_remove.tr_logcount = resp->tr_attrrm.tr_logcount;
+	}
+
 
 	size = xfs_attr_leaf_entsize_local_max(mp->m_attr_geo->blksize) -
 	       MAXNAMELEN - 1;
-- 
2.7.4


  parent reply	other threads:[~2017-08-10  1:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10  1:41 [RFC PATCH 00/13] Add parent pointer attributes Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 01/13] xfs: get directory offset when adding directory name Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 02/13] xfs: get directory offset when removing " Allison Henderson
2017-08-14 23:56   ` Darrick J. Wong
2017-08-15  3:23     ` Dave Chinner
2017-08-15  5:47       ` Dave Chinner
2017-08-15  3:54     ` Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 03/13] xfs: get directory offset when replacing a " Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 04/13] xfs: add parent pointer support to attribute code Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 05/13] xfs: define parent pointer xattr format Allison Henderson
2017-08-14 23:59   ` Darrick J. Wong
2017-08-15  4:05     ` Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 06/13] :xfs: extent transaction reservations for parent attributes Allison Henderson
2017-08-10  1:41 ` Allison Henderson [this message]
2017-08-10  1:41 ` [RFC PATCH 08/13] xfs: parent pointer attribute creation Allison Henderson
2017-08-15  0:06   ` Darrick J. Wong
2017-08-15  3:32     ` Dave Chinner
2017-08-15  4:09     ` Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 09/13] xfs: add parent attributes to link Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 10/13] xfs: remove parent pointers in unlink Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 11/13] xfs_bmap_add_attrfork(): re-add error handling from set_attrforkoff() call Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 12/13] Add parent pointers to rename Allison Henderson
2017-08-10  1:41 ` [RFC PATCH 13/13] Add the parent pointer support to the superblock version 5 Allison Henderson
2017-08-15  0:07   ` Darrick J. Wong
2017-08-15  4:11     ` Allison Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502329293-4091-8-git-send-email-allison.henderson@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox