From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 14/16] xfs: xlog_write() no longer needs contwr state
Date: Wed, 9 Mar 2022 16:29:35 +1100 [thread overview]
Message-ID: <20220309052937.2696447-15-david@fromorbit.com> (raw)
In-Reply-To: <20220309052937.2696447-1-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
The rework of xlog_write() no longer requires xlog_get_iclog_state()
to tell it about internal iclog space reservation state to direct it
on what to do. Remove this parameter.
$ size fs/xfs/xfs_log.o.*
text data bss dec hex filename
26520 560 8 27088 69d0 fs/xfs/xfs_log.o.orig
26384 560 8 26952 6948 fs/xfs/xfs_log.o.patched
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
---
fs/xfs/xfs_log.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index ca8a9313d9c5..da660e09aa5c 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -49,7 +49,6 @@ xlog_state_get_iclog_space(
int len,
struct xlog_in_core **iclog,
struct xlog_ticket *ticket,
- int *continued_write,
int *logoffsetp);
STATIC void
xlog_grant_push_ail(
@@ -2277,8 +2276,7 @@ xlog_write_get_more_iclog_space(
uint32_t *log_offset,
uint32_t len,
uint32_t *record_cnt,
- uint32_t *data_cnt,
- int *contwr)
+ uint32_t *data_cnt)
{
struct xlog_in_core *iclog = *iclogp;
struct xlog *log = iclog->ic_log;
@@ -2292,8 +2290,8 @@ xlog_write_get_more_iclog_space(
if (error)
return error;
- error = xlog_state_get_iclog_space(log, len, &iclog,
- ticket, contwr, log_offset);
+ error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
+ log_offset);
if (error)
return error;
*record_cnt = 0;
@@ -2316,8 +2314,7 @@ xlog_write_partial(
uint32_t *log_offset,
uint32_t *len,
uint32_t *record_cnt,
- uint32_t *data_cnt,
- int *contwr)
+ uint32_t *data_cnt)
{
struct xlog_in_core *iclog = *iclogp;
struct xlog_op_header *ophdr;
@@ -2345,7 +2342,7 @@ xlog_write_partial(
sizeof(struct xlog_op_header)) {
error = xlog_write_get_more_iclog_space(ticket,
&iclog, log_offset, *len, record_cnt,
- data_cnt, contwr);
+ data_cnt);
if (error)
return error;
}
@@ -2397,7 +2394,7 @@ xlog_write_partial(
error = xlog_write_get_more_iclog_space(ticket,
&iclog, log_offset,
*len + sizeof(struct xlog_op_header),
- record_cnt, data_cnt, contwr);
+ record_cnt, data_cnt);
if (error)
return error;
@@ -2492,7 +2489,6 @@ xlog_write(
{
struct xlog_in_core *iclog = NULL;
struct xfs_log_vec *lv = log_vector;
- int contwr = 0;
uint32_t record_cnt = 0;
uint32_t data_cnt = 0;
int error = 0;
@@ -2506,7 +2502,7 @@ xlog_write(
}
error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
- &contwr, &log_offset);
+ &log_offset);
if (error)
return error;
@@ -2529,7 +2525,7 @@ xlog_write(
lv->lv_bytes > iclog->ic_size - log_offset) {
error = xlog_write_partial(lv, ticket, &iclog,
&log_offset, &len, &record_cnt,
- &data_cnt, &contwr);
+ &data_cnt);
if (error) {
/*
* We have no iclog to release, so just return
@@ -2909,7 +2905,6 @@ xlog_state_get_iclog_space(
int len,
struct xlog_in_core **iclogp,
struct xlog_ticket *ticket,
- int *continued_write,
int *logoffsetp)
{
int log_offset;
@@ -2987,13 +2982,10 @@ xlog_state_get_iclog_space(
* iclogs (to mark it taken), this particular iclog will release/sync
* to disk in xlog_write().
*/
- if (len <= iclog->ic_size - iclog->ic_offset) {
- *continued_write = 0;
+ if (len <= iclog->ic_size - iclog->ic_offset)
iclog->ic_offset += len;
- } else {
- *continued_write = 1;
+ else
xlog_state_switch_iclogs(log, iclog, iclog->ic_size);
- }
*iclogp = iclog;
ASSERT(iclog->ic_offset <= iclog->ic_size);
--
2.33.0
next prev parent reply other threads:[~2022-03-09 5:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 5:29 [PATCH 00/16 v8] xfs: rework xlog_write() Dave Chinner
2022-03-09 5:29 ` [PATCH 01/16] xfs: factor out the CIL transaction header building Dave Chinner
2022-03-09 5:29 ` [PATCH 02/16] xfs: only CIL pushes require a start record Dave Chinner
2022-03-09 5:29 ` [PATCH 03/16] xfs: embed the xlog_op_header in the unmount record Dave Chinner
2022-03-09 5:29 ` [PATCH 04/16] xfs: embed the xlog_op_header in the commit record Dave Chinner
2022-03-09 5:29 ` [PATCH 05/16] xfs: log tickets don't need log client id Dave Chinner
2022-03-09 5:29 ` [PATCH 06/16] xfs: move log iovec alignment to preparation function Dave Chinner
2022-03-09 5:29 ` [PATCH 07/16] xfs: reserve space and initialise xlog_op_header in item formatting Dave Chinner
2022-03-09 5:29 ` [PATCH 08/16] xfs: log ticket region debug is largely useless Dave Chinner
2022-03-09 5:29 ` [PATCH 09/16] xfs: pass lv chain length into xlog_write() Dave Chinner
2022-03-09 5:29 ` [PATCH 10/16] xfs: change the type of ic_datap Dave Chinner
2022-03-09 5:29 ` [PATCH 11/16] xfs: introduce xlog_write_full() Dave Chinner
2022-03-09 5:29 ` [PATCH 12/16] xfs: introduce xlog_write_partial() Dave Chinner
2022-03-09 5:29 ` [PATCH 13/16] xfs: remove xlog_verify_dest_ptr Dave Chinner
2022-03-09 5:29 ` Dave Chinner [this message]
2022-03-09 5:29 ` [PATCH 15/16] xfs: xlog_write() doesn't need optype anymore Dave Chinner
2022-03-09 5:29 ` [PATCH 16/16] xfs: CIL context doesn't need to count iovecs Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2021-11-18 23:13 [PATCH 00/16 v7] xfs: rework xlog_write() Dave Chinner
2021-11-18 23:13 ` [PATCH 14/16] xfs: xlog_write() no longer needs contwr state Dave Chinner
2021-11-24 8:54 ` Chandan Babu R
2021-11-09 1:50 [PATCH 00/16 v6] xfs: rework xlog_write() Dave Chinner
2021-11-09 1:50 ` [PATCH 14/16] xfs: xlog_write() no longer needs contwr state Dave Chinner
2021-11-11 8:28 ` Christoph Hellwig
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=20220309052937.2696447-15-david@fromorbit.com \
--to=david@fromorbit.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;
as well as URLs for NNTP newsgroup(s).