Skip to content

Commit 636119a

Browse files
committed
io_uring: rename "copy buffers" to "clone buffers"
A recent commit added support for copying registered buffers from one ring to another. But that term is a bit confusing, as no copying of buffer data is done here. What is being done is simply cloning the buffer registrations from one ring to another. Rename it while we still can, so that it's more descriptive. No functional changes in this patch. Fixes: 7cc2a6e ("io_uring: add IORING_REGISTER_COPY_BUFFERS method") Signed-off-by: Jens Axboe <[email protected]>
1 parent 7cc2a6e commit 636119a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

include/uapi/linux/io_uring.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ enum io_uring_register_op {
609609

610610
IORING_REGISTER_CLOCK = 29,
611611

612-
/* copy registered buffers from source ring to current ring */
613-
IORING_REGISTER_COPY_BUFFERS = 30,
612+
/* clone registered buffers from source ring to current ring */
613+
IORING_REGISTER_CLONE_BUFFERS = 30,
614614

615615
/* this goes last */
616616
IORING_REGISTER_LAST,
@@ -701,7 +701,7 @@ enum {
701701
IORING_REGISTER_SRC_REGISTERED = 1,
702702
};
703703

704-
struct io_uring_copy_buffers {
704+
struct io_uring_clone_buffers {
705705
__u32 src_fd;
706706
__u32 flags;
707707
__u32 pad[6];

io_uring/register.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,11 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
542542
break;
543543
ret = io_register_clock(ctx, arg);
544544
break;
545-
case IORING_REGISTER_COPY_BUFFERS:
545+
case IORING_REGISTER_CLONE_BUFFERS:
546546
ret = -EINVAL;
547547
if (!arg || nr_args != 1)
548548
break;
549-
ret = io_register_copy_buffers(ctx, arg);
549+
ret = io_register_clone_buffers(ctx, arg);
550550
break;
551551
default:
552552
ret = -EINVAL;

io_uring/rsrc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
11391139
return 0;
11401140
}
11411141

1142-
static int io_copy_buffers(struct io_ring_ctx *ctx, struct io_ring_ctx *src_ctx)
1142+
static int io_clone_buffers(struct io_ring_ctx *ctx, struct io_ring_ctx *src_ctx)
11431143
{
11441144
struct io_mapped_ubuf **user_bufs;
11451145
struct io_rsrc_data *data;
@@ -1203,9 +1203,9 @@ static int io_copy_buffers(struct io_ring_ctx *ctx, struct io_ring_ctx *src_ctx)
12031203
*
12041204
* Since the memory is already accounted once, don't account it again.
12051205
*/
1206-
int io_register_copy_buffers(struct io_ring_ctx *ctx, void __user *arg)
1206+
int io_register_clone_buffers(struct io_ring_ctx *ctx, void __user *arg)
12071207
{
1208-
struct io_uring_copy_buffers buf;
1208+
struct io_uring_clone_buffers buf;
12091209
bool registered_src;
12101210
struct file *file;
12111211
int ret;
@@ -1223,7 +1223,7 @@ int io_register_copy_buffers(struct io_ring_ctx *ctx, void __user *arg)
12231223
file = io_uring_register_get_file(buf.src_fd, registered_src);
12241224
if (IS_ERR(file))
12251225
return PTR_ERR(file);
1226-
ret = io_copy_buffers(ctx, file->private_data);
1226+
ret = io_clone_buffers(ctx, file->private_data);
12271227
if (!registered_src)
12281228
fput(file);
12291229
return ret;

io_uring/rsrc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
6868
struct io_mapped_ubuf *imu,
6969
u64 buf_addr, size_t len);
7070

71-
int io_register_copy_buffers(struct io_ring_ctx *ctx, void __user *arg);
71+
int io_register_clone_buffers(struct io_ring_ctx *ctx, void __user *arg);
7272
void __io_sqe_buffers_unregister(struct io_ring_ctx *ctx);
7373
int io_sqe_buffers_unregister(struct io_ring_ctx *ctx);
7474
int io_sqe_buffers_register(struct io_ring_ctx *ctx, void __user *arg,

0 commit comments

Comments
 (0)