From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@infradead.org>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
linux-aio@kvack.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] fs: replace the ki_complete two integer arguments with a single argument
Date: Thu, 21 Oct 2021 08:34:38 -0600 [thread overview]
Message-ID: <4d3c5a73-889c-2e2c-9bb2-9572acdd11b7@kernel.dk> (raw)
In-Reply-To: <YXFHgy85MpdHpHBE@infradead.org>
On 10/21/21 4:57 AM, Christoph Hellwig wrote:
> On Thu, Oct 21, 2021 at 01:32:19AM -0700, Christoph Hellwig wrote:
>>> @@ -1436,8 +1436,8 @@ static void aio_complete_rw(struct kiocb *kiocb, long res, long res2)
>>> file_end_write(kiocb->ki_filp);
>>> }
>>>
>>> - iocb->ki_res.res = res;
>>> - iocb->ki_res.res2 = res2;
>>> + iocb->ki_res.res = res & 0xffffffff;
>>> + iocb->ki_res.res2 = res >> 32;
>>
>> This needs a big fat comments explaining the historic context.
>
> Oh, and please use the upper_32_bits / lower_32_bits helpers.
Incremental, are you happy with that comment?
diff --git a/fs/aio.c b/fs/aio.c
index e39c61dccf37..3674abc43788 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1436,8 +1436,14 @@ static void aio_complete_rw(struct kiocb *kiocb, u64 res)
file_end_write(kiocb->ki_filp);
}
- iocb->ki_res.res = res & 0xffffffff;
- iocb->ki_res.res2 = res >> 32;
+ /*
+ * Historically we've only had one real user of res2, the USB
+ * gadget code, everybody else just passes back zero. As we pass
+ * 32-bits of value at most for either value, bundle these up and
+ * pass them in one u64 value.
+ */
+ iocb->ki_res.res = lower_32_bits(res);
+ iocb->ki_res.res2 = upper_32_bits(res);
iocb_put(iocb);
}
--
Jens Axboe
next prev parent reply other threads:[~2021-10-21 14:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 19:08 [PATCH v2] fs: replace the ki_complete two integer arguments with a single argument Jens Axboe
2021-10-21 8:06 ` Greg KH
2021-10-21 8:32 ` Christoph Hellwig
2021-10-21 10:57 ` Christoph Hellwig
2021-10-21 14:34 ` Jens Axboe [this message]
2021-10-21 14:42 ` Christoph Hellwig
2021-10-21 14:44 ` Jens Axboe
2021-10-21 14:47 ` Christoph Hellwig
2021-10-21 15:18 ` Jeff Moyer
2021-10-21 15:19 ` Jens Axboe
2021-10-21 18:05 ` Jeff Moyer
2021-10-21 20:41 ` Jens Axboe
2021-10-21 20:58 ` Jeff Moyer
2021-10-21 21:03 ` Jeff Moyer
2021-10-22 14:19 ` Jens Axboe
2021-10-22 15:29 ` Jens Axboe
2021-10-22 15:47 ` Jens Axboe
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=4d3c5a73-889c-2e2c-9bb2-9572acdd11b7@kernel.dk \
--to=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-aio@kvack.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-usb@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 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.