Skip to content

Commit be8ddda

Browse files
dgchinnerdchinner
authored andcommitted
xfs: xlog_write() no longer needs contwr state
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> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 1236bbe commit be8ddda

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

fs/xfs/xfs_log.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ xlog_state_get_iclog_space(
4949
int len,
5050
struct xlog_in_core **iclog,
5151
struct xlog_ticket *ticket,
52-
int *continued_write,
5352
int *logoffsetp);
5453
STATIC void
5554
xlog_grant_push_ail(
@@ -2263,8 +2262,7 @@ xlog_write_get_more_iclog_space(
22632262
uint32_t *log_offset,
22642263
uint32_t len,
22652264
uint32_t *record_cnt,
2266-
uint32_t *data_cnt,
2267-
int *contwr)
2265+
uint32_t *data_cnt)
22682266
{
22692267
struct xlog_in_core *iclog = *iclogp;
22702268
struct xlog *log = iclog->ic_log;
@@ -2278,8 +2276,8 @@ xlog_write_get_more_iclog_space(
22782276
if (error)
22792277
return error;
22802278

2281-
error = xlog_state_get_iclog_space(log, len, &iclog,
2282-
ticket, contwr, log_offset);
2279+
error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
2280+
log_offset);
22832281
if (error)
22842282
return error;
22852283
*record_cnt = 0;
@@ -2302,8 +2300,7 @@ xlog_write_partial(
23022300
uint32_t *log_offset,
23032301
uint32_t *len,
23042302
uint32_t *record_cnt,
2305-
uint32_t *data_cnt,
2306-
int *contwr)
2303+
uint32_t *data_cnt)
23072304
{
23082305
struct xlog_in_core *iclog = *iclogp;
23092306
struct xlog_op_header *ophdr;
@@ -2331,7 +2328,7 @@ xlog_write_partial(
23312328
sizeof(struct xlog_op_header)) {
23322329
error = xlog_write_get_more_iclog_space(ticket,
23332330
&iclog, log_offset, *len, record_cnt,
2334-
data_cnt, contwr);
2331+
data_cnt);
23352332
if (error)
23362333
return error;
23372334
}
@@ -2383,7 +2380,7 @@ xlog_write_partial(
23832380
error = xlog_write_get_more_iclog_space(ticket,
23842381
&iclog, log_offset,
23852382
*len + sizeof(struct xlog_op_header),
2386-
record_cnt, data_cnt, contwr);
2383+
record_cnt, data_cnt);
23872384
if (error)
23882385
return error;
23892386

@@ -2478,7 +2475,6 @@ xlog_write(
24782475
{
24792476
struct xlog_in_core *iclog = NULL;
24802477
struct xfs_log_vec *lv = log_vector;
2481-
int contwr = 0;
24822478
uint32_t record_cnt = 0;
24832479
uint32_t data_cnt = 0;
24842480
int error = 0;
@@ -2492,7 +2488,7 @@ xlog_write(
24922488
}
24932489

24942490
error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
2495-
&contwr, &log_offset);
2491+
&log_offset);
24962492
if (error)
24972493
return error;
24982494

@@ -2515,7 +2511,7 @@ xlog_write(
25152511
lv->lv_bytes > iclog->ic_size - log_offset) {
25162512
error = xlog_write_partial(lv, ticket, &iclog,
25172513
&log_offset, &len, &record_cnt,
2518-
&data_cnt, &contwr);
2514+
&data_cnt);
25192515
if (error) {
25202516
/*
25212517
* We have no iclog to release, so just return
@@ -2895,7 +2891,6 @@ xlog_state_get_iclog_space(
28952891
int len,
28962892
struct xlog_in_core **iclogp,
28972893
struct xlog_ticket *ticket,
2898-
int *continued_write,
28992894
int *logoffsetp)
29002895
{
29012896
int log_offset;
@@ -2973,13 +2968,10 @@ xlog_state_get_iclog_space(
29732968
* iclogs (to mark it taken), this particular iclog will release/sync
29742969
* to disk in xlog_write().
29752970
*/
2976-
if (len <= iclog->ic_size - iclog->ic_offset) {
2977-
*continued_write = 0;
2971+
if (len <= iclog->ic_size - iclog->ic_offset)
29782972
iclog->ic_offset += len;
2979-
} else {
2980-
*continued_write = 1;
2973+
else
29812974
xlog_state_switch_iclogs(log, iclog, iclog->ic_size);
2982-
}
29832975
*iclogp = iclog;
29842976

29852977
ASSERT(iclog->ic_offset <= iclog->ic_size);

0 commit comments

Comments
 (0)