Skip to content

Commit b55ce73

Browse files
isilenceaxboe
authored andcommitted
io_uring: kill already cached timeout.seq_offset
req->timeout.count and req->io->timeout.seq_offset store the same value, which is sqe->off. Kill the second one Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 22cad15 commit b55ce73

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

fs/io_uring.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ struct io_timeout_data {
357357
struct hrtimer timer;
358358
struct timespec64 ts;
359359
enum hrtimer_mode mode;
360-
u32 seq_offset;
361360
};
362361

363362
struct io_accept {
@@ -385,7 +384,7 @@ struct io_timeout {
385384
struct file *file;
386385
u64 addr;
387386
int flags;
388-
unsigned count;
387+
u32 count;
389388
};
390389

391390
struct io_rw {
@@ -4709,11 +4708,11 @@ static int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe,
47094708

47104709
static int io_timeout(struct io_kiocb *req)
47114710
{
4712-
unsigned count;
47134711
struct io_ring_ctx *ctx = req->ctx;
47144712
struct io_timeout_data *data;
47154713
struct list_head *entry;
47164714
unsigned span = 0;
4715+
u32 count = req->timeout.count;
47174716
u32 seq = req->sequence;
47184717

47194718
data = &req->io->timeout;
@@ -4723,7 +4722,6 @@ static int io_timeout(struct io_kiocb *req)
47234722
* timeout event to be satisfied. If it isn't set, then this is
47244723
* a pure timeout request, sequence isn't used.
47254724
*/
4726-
count = req->timeout.count;
47274725
if (!count) {
47284726
req->flags |= REQ_F_TIMEOUT_NOSEQ;
47294727
spin_lock_irq(&ctx->completion_lock);
@@ -4732,7 +4730,6 @@ static int io_timeout(struct io_kiocb *req)
47324730
}
47334731

47344732
req->sequence = seq + count;
4735-
data->seq_offset = count;
47364733

47374734
/*
47384735
* Insertion sort, ensuring the first entry in the list is always
@@ -4743,7 +4740,7 @@ static int io_timeout(struct io_kiocb *req)
47434740
struct io_kiocb *nxt = list_entry(entry, struct io_kiocb, list);
47444741
unsigned nxt_seq;
47454742
long long tmp, tmp_nxt;
4746-
u32 nxt_offset = nxt->io->timeout.seq_offset;
4743+
u32 nxt_offset = nxt->timeout.count;
47474744

47484745
if (nxt->flags & REQ_F_TIMEOUT_NOSEQ)
47494746
continue;

0 commit comments

Comments
 (0)