mbox series

[v4,0/6] io_uring: add mkdirat support

Message ID 20210513110612.688851-1-dkadashev@gmail.com (mailing list archive)
Headers show
Series io_uring: add mkdirat support | expand

Message

Dmitry Kadashev May 13, 2021, 11:06 a.m. UTC
This adds mkdirat support to io_uring and is heavily based on recently
added renameat() / unlinkat() support.

The first patch is preparation with no functional changes, makes
do_mkdirat accept struct filename pointer rather than the user string.

The second one leverages that to implement mkdirat in io_uring.

The rest of the patches just convert other similar do_* functions in
namei.c to accept struct filename, for uniformity with do_mkdirat,
do_renameat and do_unlinkat. No functional changes there.

Based on io_uring-5.13.

v4:
- update do_mknodat, do_symlinkat and do_linkat to accept struct
  filename for uniformity with do_mkdirat, do_renameat and do_unlinkat;

v3:
- rebase;

v2:
- do not mess with struct filename's refcount in do_mkdirat, instead add
  and use __filename_create() that does not drop the name on success;

Dmitry Kadashev (6):
  fs: make do_mkdirat() take struct filename
  io_uring: add support for IORING_OP_MKDIRAT
  fs: make do_mknodat() take struct filename
  fs: make do_symlinkat() take struct filename
  namei: add getname_uflags()
  fs: make do_linkat() take struct filename

 fs/exec.c                     |   8 +-
 fs/internal.h                 |   1 +
 fs/io_uring.c                 |  55 ++++++++++++++
 fs/namei.c                    | 135 +++++++++++++++++++++++-----------
 include/linux/fs.h            |   1 +
 include/uapi/linux/io_uring.h |   1 +
 6 files changed, 152 insertions(+), 49 deletions(-)

Comments

Christian Brauner May 14, 2021, 2:52 p.m. UTC | #1
On Thu, May 13, 2021 at 06:06:06PM +0700, Dmitry Kadashev wrote:
> This adds mkdirat support to io_uring and is heavily based on recently
> added renameat() / unlinkat() support.
> 
> The first patch is preparation with no functional changes, makes
> do_mkdirat accept struct filename pointer rather than the user string.
> 
> The second one leverages that to implement mkdirat in io_uring.
> 
> The rest of the patches just convert other similar do_* functions in
> namei.c to accept struct filename, for uniformity with do_mkdirat,
> do_renameat and do_unlinkat. No functional changes there.
> 
> Based on io_uring-5.13.
> 
> v4:
> - update do_mknodat, do_symlinkat and do_linkat to accept struct
>   filename for uniformity with do_mkdirat, do_renameat and do_unlinkat;

Dmitry,

If Jens prefers to just run with the conversion of do_mkdirat() and
ignore the rest that's quite alright of course. But I really appreciate
the time spent on the additional conversions.
One question I have is whether we shouldn't just be honest and add
support for linkat, symlinkat, and mknodat in one go instead of being
shy about it. uring does already have mkdirat, renamat2(), and we
already have open(). It seems kinda silly to delay the others... Unless
there's genuinely no interest or need of course.

Christian