From: Jeff Liu <jeff.liu@oracle.com>
To: xfs@oss.sgi.com
Subject: [PATCH 01/15] xfs: Add a new transaction for changing ag state
Date: Fri, 16 Nov 2012 14:44:55 +0800 [thread overview]
Message-ID: <50A5E0E7.7010002@oracle.com> (raw)
This a new tranaction which would be use for Changing AG state via ioctl(2)
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
fs/xfs/xfs_mount.h | 1 +
fs/xfs/xfs_trans.c | 12 ++++++++++++
fs/xfs/xfs_trans.h | 8 +++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index deee09e..4fe2232 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -40,6 +40,7 @@ typedef struct xfs_trans_reservations {
uint tr_growrtalloc; /* grow realtime allocations */
uint tr_growrtzero; /* grow realtime zeroing */
uint tr_growrtfree; /* grow realtime freeing */
+ uint tr_setagstate; /* set a.g. state trans */
} xfs_trans_reservations_t;
#ifndef __KERNEL__
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 06ed520..5a5c4d8 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -531,6 +531,17 @@ xfs_calc_clear_agi_bucket_reservation(
}
/*
+ * Setting the state of an allocation group.
+ * agf of the ag: sector size
+ */
+STATIC uint
+xfs_calc_set_agstate_reservation(
+ struct xfs_mount *mp)
+{
+ return mp->m_sb.sb_sectsize + 128;
+}
+
+/*
* Initialize the precomputed transaction reservation values
* in the mount structure.
*/
@@ -561,6 +572,7 @@ xfs_trans_init(
resp->tr_growrtalloc = xfs_calc_growrtalloc_reservation(mp);
resp->tr_growrtzero = xfs_calc_growrtzero_reservation(mp);
resp->tr_growrtfree = xfs_calc_growrtfree_reservation(mp);
+ resp->tr_setagstate = xfs_calc_set_agstate_reservation(mp);
}
/*
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index db05654..a4f4092 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -107,7 +107,8 @@ typedef struct xfs_trans_header {
#define XFS_TRANS_SWAPEXT 40
#define XFS_TRANS_SB_COUNT 41
#define XFS_TRANS_CHECKPOINT 42
-#define XFS_TRANS_TYPE_MAX 42
+#define XFS_TRANS_SET_AGSTATE 43
+#define XFS_TRANS_TYPE_MAX 43
/* new transaction types need to be reflected in xfs_logprint(8) */
#define XFS_TRANS_TYPES \
@@ -152,7 +153,8 @@ typedef struct xfs_trans_header {
{ XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \
{ XFS_TRANS_DUMMY1, "DUMMY1" }, \
{ XFS_TRANS_DUMMY2, "DUMMY2" }, \
- { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" }
+ { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" }, \
+ { XFS_TRANS_SET_AGSTATE, "SET_AGSTATE" }
/*
* This structure is used to track log items associated with
@@ -262,7 +264,7 @@ struct xfs_log_item_desc {
(128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)))))
#define XFS_ATTRRM_LOG_RES(mp) ((mp)->m_reservations.tr_attrrm)
#define XFS_CLEAR_AGI_BUCKET_LOG_RES(mp) ((mp)->m_reservations.tr_clearagi)
-
+#define XFS_SETAGSTATE_LOG_RES ((mp)->m_reservations.tr_setagstate)
/*
* Various log count values.
--
1.7.4.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2012-11-16 6:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 6:44 Jeff Liu [this message]
2012-12-03 1:24 ` [PATCH 01/15] xfs: Add a new transaction for changing ag state Dave Chinner
2012-12-03 2:54 ` Jeff Liu
2012-12-03 21:28 ` Dave Chinner
2012-12-04 11:56 ` Jeff Liu
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=50A5E0E7.7010002@oracle.com \
--to=jeff.liu@oracle.com \
--cc=xfs@oss.sgi.com \
/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 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.