lkml.org 
[lkml]   [2020]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/4] io_uring: add support for zone-append
On Wed, Jul 08, 2020 at 06:28:05PM +0530, Kanchan Joshi wrote:
> The last thing is about the flag used to trigger this processing. Will it be
> fine to intoduce new flag (RWF_APPEND2 or RWF_APPEND_OFFSET)
> instead of using RWF_APPEND?
>
> New flag will do what RWF_APPEND does and will also return the
> written-location (and therefore expects pointer setup in application).

I think it's simpler to understand if it's called RWF_INDIRECT_OFFSET
Then it'd look like:

+ rwf_t rwf = READ_ONCE(sqe->rw_flags);
...
- iocb->ki_pos = READ_ONCE(sqe->off);
+ if (rwf & RWF_INDIRECT_OFFSET) {
+ loff_t __user *loffp = u64_to_user_ptr(sqe->addr2);
+
+ if (get_user(iocb->ki_pos, loffp)
+ return -EFAULT;
+ iocb->ki_loffp = loffp;
+ } else {
+ iocb->ki_pos = READ_ONCE(sqe->off);
+ }
...
- ret = kiocb_set_rw_flags(kiocb, READ_ONCE(sqe->rw_flags));
+ ret = kiocb_set_rw_flags(kiocb, rwf);

\
 
 \ /
  Last update: 2020-07-08 16:25    [W:0.087 / U:1.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site