Commit be8ddda5 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner

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: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChandan Babu R <chandan.babu@oracle.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 1236bbe8
...@@ -49,7 +49,6 @@ xlog_state_get_iclog_space( ...@@ -49,7 +49,6 @@ xlog_state_get_iclog_space(
int len, int len,
struct xlog_in_core **iclog, struct xlog_in_core **iclog,
struct xlog_ticket *ticket, struct xlog_ticket *ticket,
int *continued_write,
int *logoffsetp); int *logoffsetp);
STATIC void STATIC void
xlog_grant_push_ail( xlog_grant_push_ail(
...@@ -2263,8 +2262,7 @@ xlog_write_get_more_iclog_space( ...@@ -2263,8 +2262,7 @@ xlog_write_get_more_iclog_space(
uint32_t *log_offset, uint32_t *log_offset,
uint32_t len, uint32_t len,
uint32_t *record_cnt, uint32_t *record_cnt,
uint32_t *data_cnt, uint32_t *data_cnt)
int *contwr)
{ {
struct xlog_in_core *iclog = *iclogp; struct xlog_in_core *iclog = *iclogp;
struct xlog *log = iclog->ic_log; struct xlog *log = iclog->ic_log;
...@@ -2278,8 +2276,8 @@ xlog_write_get_more_iclog_space( ...@@ -2278,8 +2276,8 @@ xlog_write_get_more_iclog_space(
if (error) if (error)
return error; return error;
error = xlog_state_get_iclog_space(log, len, &iclog, error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
ticket, contwr, log_offset); log_offset);
if (error) if (error)
return error; return error;
*record_cnt = 0; *record_cnt = 0;
...@@ -2302,8 +2300,7 @@ xlog_write_partial( ...@@ -2302,8 +2300,7 @@ xlog_write_partial(
uint32_t *log_offset, uint32_t *log_offset,
uint32_t *len, uint32_t *len,
uint32_t *record_cnt, uint32_t *record_cnt,
uint32_t *data_cnt, uint32_t *data_cnt)
int *contwr)
{ {
struct xlog_in_core *iclog = *iclogp; struct xlog_in_core *iclog = *iclogp;
struct xlog_op_header *ophdr; struct xlog_op_header *ophdr;
...@@ -2331,7 +2328,7 @@ xlog_write_partial( ...@@ -2331,7 +2328,7 @@ xlog_write_partial(
sizeof(struct xlog_op_header)) { sizeof(struct xlog_op_header)) {
error = xlog_write_get_more_iclog_space(ticket, error = xlog_write_get_more_iclog_space(ticket,
&iclog, log_offset, *len, record_cnt, &iclog, log_offset, *len, record_cnt,
data_cnt, contwr); data_cnt);
if (error) if (error)
return error; return error;
} }
...@@ -2383,7 +2380,7 @@ xlog_write_partial( ...@@ -2383,7 +2380,7 @@ xlog_write_partial(
error = xlog_write_get_more_iclog_space(ticket, error = xlog_write_get_more_iclog_space(ticket,
&iclog, log_offset, &iclog, log_offset,
*len + sizeof(struct xlog_op_header), *len + sizeof(struct xlog_op_header),
record_cnt, data_cnt, contwr); record_cnt, data_cnt);
if (error) if (error)
return error; return error;
...@@ -2478,7 +2475,6 @@ xlog_write( ...@@ -2478,7 +2475,6 @@ xlog_write(
{ {
struct xlog_in_core *iclog = NULL; struct xlog_in_core *iclog = NULL;
struct xfs_log_vec *lv = log_vector; struct xfs_log_vec *lv = log_vector;
int contwr = 0;
uint32_t record_cnt = 0; uint32_t record_cnt = 0;
uint32_t data_cnt = 0; uint32_t data_cnt = 0;
int error = 0; int error = 0;
...@@ -2492,7 +2488,7 @@ xlog_write( ...@@ -2492,7 +2488,7 @@ xlog_write(
} }
error = xlog_state_get_iclog_space(log, len, &iclog, ticket, error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
&contwr, &log_offset); &log_offset);
if (error) if (error)
return error; return error;
...@@ -2515,7 +2511,7 @@ xlog_write( ...@@ -2515,7 +2511,7 @@ xlog_write(
lv->lv_bytes > iclog->ic_size - log_offset) { lv->lv_bytes > iclog->ic_size - log_offset) {
error = xlog_write_partial(lv, ticket, &iclog, error = xlog_write_partial(lv, ticket, &iclog,
&log_offset, &len, &record_cnt, &log_offset, &len, &record_cnt,
&data_cnt, &contwr); &data_cnt);
if (error) { if (error) {
/* /*
* We have no iclog to release, so just return * We have no iclog to release, so just return
...@@ -2895,7 +2891,6 @@ xlog_state_get_iclog_space( ...@@ -2895,7 +2891,6 @@ xlog_state_get_iclog_space(
int len, int len,
struct xlog_in_core **iclogp, struct xlog_in_core **iclogp,
struct xlog_ticket *ticket, struct xlog_ticket *ticket,
int *continued_write,
int *logoffsetp) int *logoffsetp)
{ {
int log_offset; int log_offset;
...@@ -2973,13 +2968,10 @@ xlog_state_get_iclog_space( ...@@ -2973,13 +2968,10 @@ xlog_state_get_iclog_space(
* iclogs (to mark it taken), this particular iclog will release/sync * iclogs (to mark it taken), this particular iclog will release/sync
* to disk in xlog_write(). * to disk in xlog_write().
*/ */
if (len <= iclog->ic_size - iclog->ic_offset) { if (len <= iclog->ic_size - iclog->ic_offset)
*continued_write = 0;
iclog->ic_offset += len; iclog->ic_offset += len;
} else { else
*continued_write = 1;
xlog_state_switch_iclogs(log, iclog, iclog->ic_size); xlog_state_switch_iclogs(log, iclog, iclog->ic_size);
}
*iclogp = iclog; *iclogp = iclog;
ASSERT(iclog->ic_offset <= iclog->ic_size); ASSERT(iclog->ic_offset <= iclog->ic_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment