vfs: change openat propotype to match linux openat2
authorVolker Lendecke <vl@samba.org>
Fri, 3 Jun 2022 13:53:29 +0000 (15:53 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 6 Aug 2022 01:43:50 +0000 (01:43 +0000)
commit5fc016f26852a1cc1d7809919ff00cc0404e23e3
treedb391ac330045c54731107c5452be14dd1e38fb0
parent5aaf38949aba3176f43719c4c0ec29ae1398f962
vfs: change openat propotype to match linux openat2

The Linux prototype for openat2 looks like this:

       long openat2(int dirfd, const char *pathname,
                   struct open_how *how, size_t size);

where "struct open_how" is defined in "linux/openat2.h". It is
designed to be extensible with further flags.

The "size" parameter is required because there is no type checking
between userland and kernelspace, so the way for Linux to find which
version of open_how is being passed in is looking at the size:
"open_how" is expected to only every grow with additional fields,
should a change be necessary in the future.

Samba does not have this problem, we can typecheck the struct and
pointers, we expect all VFS modules to be compiled against the current
vfs.h.

For now this adds no functionality, but it will make further patches
much smaller.

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
37 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_aio_pthread.c
source3/modules/vfs_audit.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_ceph.c
source3/modules/vfs_ceph_snapshots.c
source3/modules/vfs_commit.c
source3/modules/vfs_default.c
source3/modules/vfs_error_inject.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_fruit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_preopen.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_syncops.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_virusfilter.c
source3/modules/vfs_widelinks.c
source3/modules/vfs_xattr_tdb.c
source3/smbd/files.c
source3/smbd/open.c
source3/smbd/pysmbd.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c