Re: [PATCH v3 1/2] fs: make do_mkdirat() take struct filename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 30, 2021 at 12:59:56PM +0700, Dmitry Kadashev wrote:
> Pass in the struct filename pointers instead of the user string, and
> update the three callers to do the same. This is heavily based on
> commit dbea8d345177 ("fs: make do_renameat2() take struct filename").
> 
> This behaves like do_unlinkat() and do_renameat2().
> 
> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Dmitry Kadashev <dkadashev@xxxxxxxxx>
> ---
>  fs/internal.h |  1 +
>  fs/namei.c    | 25 +++++++++++++++++++------
>  2 files changed, 20 insertions(+), 6 deletions(-)

The only thing that is a bit unpleasant here is that this change
breaks the consistency between the creation helpers:

do_mkdirat()
do_symlinkat()
do_linkat()
do_mknodat()

All but of them currently take
const char __user *pathname
and call
user_path_create()
with that do_mkdirat() change that's no longer true. One of the major
benefits over the recent years in this code is naming and type consistency.
And since it's just matter of time until io_uring will also gain support
for do_{symlinkat,linkat,mknodat} I would think switching all of them to
take a struct filename
and then have all do_* helpers call getname() might just be nicer in the
long run.

Christian



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux