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.

Change-Id: Ia71811513ab6655f60d8b63fc18b26be663ab4dc
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>
This commit is contained in:
Marcio Barbosa 2022-03-23 16:04:46 -03:00 committed by Benjamin Kaduk
parent a7d04f0770
commit 51c0387aaa
3 changed files with 9 additions and 22 deletions

View File

@ -181,17 +181,6 @@ afs_suser(afs_ucred_t *credp)
* These are no-ops in user space * 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 * ioctl should never fall through, the only files we know
* about are AFS files * about are AFS files

View File

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

View File

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