UKERNEL: Remove flock -> usr_flock redirection

In order to replace 'struck flock' with 'struct usr_flock' and 'flock()'
with 'usr_flock()', the current version of src/afs/UKERNEL/sysincludes.h
defines flock to usr_flock. This can cause problems when trying to use
libroken in UKERNEL code, because roken.h redefines flock.

To avoid conflicts with libroken (included in a future commit), add a
new UKERNEL specific AFS_FLOCK -> usr_flock redirection. Doing so, the
flock -> usr_flock redirection can be removed. While here, also remove
'usr_flock()' as it shouldn't be called and is not defined in any header
file.

Reviewed-on: https://gerrit.openafs.org/14913
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 51c0387aaa5ec507c6e29063ef56d98e2931402d)

Change-Id: I3c2d9de056bae3f2fed68f1ec183540b63584a43
Reviewed-on: https://gerrit.openafs.org/15238
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Harish Sharma <Harish.Sharma1@ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
Marcio Barbosa 2022-03-23 16:04:46 -03:00 committed by Stephan Wiesand
parent 276632ea73
commit fc5be911a0
3 changed files with 9 additions and 22 deletions

View File

@ -181,17 +181,6 @@ afs_suser(void *credp)
* These are no-ops in user space
*/
/*
* xflock should never fall through, the only files we know
* about are AFS files
*/
int
usr_flock(void)
{
usr_assert(0);
return 0;
}
/*
* ioctl should never fall through, the only files we know
* about are AFS files

View File

@ -201,7 +201,6 @@ typedef unsigned int fsblkcnt_t;
#define statfs usr_statfs
#define file usr_file
#define dirent usr_dirent
#define flock usr_flock
#define fid usr_fid
#define sysent usr_sysent
#define ifaddr usr_ifaddr
@ -1101,7 +1100,6 @@ struct usr_buf {
struct vcache;
#define afs_ucred_t struct usr_ucred
#define AFS_FLOCK flock
struct usr_vnodeops {
@ -1136,7 +1134,7 @@ struct usr_vnodeops {
int (*vn_strategy) (void);
int (*vn_bread) (void);
int (*vn_brelse) (void);
int (*vn_lockctl) (struct vcache *, struct AFS_FLOCK *, int,
int (*vn_lockctl) (struct vcache *, struct usr_flock *, int,
afs_ucred_t *);
int (*vn_fid) (struct vcache *avc, struct fid **);
};

View File

@ -68,15 +68,15 @@ extern enum afs_shutdown_state afs_shuttingdown;
#define AFS_VFS_FAKEFREE (2147483647)
/* Moved from VNOPS/afs_vnop_flocks so can be used in prototypes */
#if defined(AFS_HPUX102_ENV)
#define AFS_FLOCK k_flock
#if defined(UKERNEL)
# define AFS_FLOCK usr_flock
#elif defined(AFS_HPUX102_ENV)
# define AFS_FLOCK k_flock
#elif defined(AFS_SUN5_ENV) || (defined(AFS_LINUX_ENV) && !defined(AFS_LINUX_64BIT_KERNEL))
# define AFS_FLOCK flock64
#else
#if defined(AFS_SUN5_ENV) || (defined(AFS_LINUX_ENV) && !defined(AFS_LINUX_64BIT_KERNEL))
#define AFS_FLOCK flock64
#else
#define AFS_FLOCK flock
#endif /* AFS_SUN65_ENV */
#endif /* AFS_HPUX102_ENV */
# define AFS_FLOCK flock
#endif /* UKERNEL */
/* The following are various levels of afs debugging */
#define AFSDEB_GENERAL 1 /* Standard debugging */