remove the support of variable-sized filehandle from compat version of

syscalls.  (strictly speaking, it breaks abi.  i don't think it's a problem
because this feature is short-lived and there are no affected in-tree
filesystems.)
This commit is contained in:
yamt 2006-08-04 16:30:22 +00:00
parent 4977b4bbc0
commit 6e8d813f5e
7 changed files with 31 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fstypes.h,v 1.1 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: fstypes.h,v 1.2 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -52,7 +52,6 @@ struct compat_30_fhandle {
struct compat_30_fid fh_fid;
};
#define FHANDLE30_SIZE(fh) (offsetof(struct compat_30_fhandle, fh_fid) \
+ (fh)->fh_fid.fid30_len)
#define FHANDLE30_SIZE sizeof(struct compat_30_fhandle) /* 28 */
#endif /* _COMPAT_FSTYPES_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat___fhstat30.c,v 1.1 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat___fhstat30.c,v 1.2 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat___fhstat30.c,v 1.1 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat___fhstat30.c,v 1.2 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -60,5 +60,5 @@ int __fhstat40(const void *fhp, size_t fh_size, struct stat *sb);
int
__fhstat30(const struct compat_30_fhandle *fhp, struct stat *sb)
{
return __fhstat40(fhp, FHANDLE30_SIZE(fhp), sb);
return __fhstat40(fhp, FHANDLE30_SIZE, sb);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_fhopen.c,v 1.1 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat_fhopen.c,v 1.2 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_fhopen.c,v 1.1 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat_fhopen.c,v 1.2 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -61,5 +61,5 @@ int fhopen(struct compat_30_fhandle *, int);
int
fhopen(struct compat_30_fhandle *fhp, int flags)
{
return __fhopen40(fhp, FHANDLE30_SIZE(fhp), flags);
return __fhopen40(fhp, FHANDLE30_SIZE, flags);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_fhstatvfs.c,v 1.1 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat_fhstatvfs.c,v 1.2 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_fhstatvfs.c,v 1.1 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat_fhstatvfs.c,v 1.2 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -65,5 +65,5 @@ int __fhstatvfs140(const void *fhp, size_t fh_size, struct statvfs *buf,
int
_fhstatvfs(const struct compat_30_fhandle *fhp, struct statvfs *buf)
{
return __fhstatvfs140(fhp, FHANDLE30_SIZE(fhp), buf, ST_WAIT);
return __fhstatvfs140(fhp, FHANDLE30_SIZE, buf, ST_WAIT);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_fhstatvfs1.c,v 1.1 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat_fhstatvfs1.c,v 1.2 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_fhstatvfs1.c,v 1.1 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat_fhstatvfs1.c,v 1.2 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -62,5 +62,5 @@ int __fhstatvfs140(const void *fhp, size_t fh_size, struct statvfs *buf,
int
fhstatvfs1(const struct compat_30_fhandle *fhp, struct statvfs *buf, int flags)
{
return __fhstatvfs140(fhp, FHANDLE30_SIZE(fhp), buf, flags);
return __fhstatvfs140(fhp, FHANDLE30_SIZE, buf, flags);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_getfh.c,v 1.4 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat_getfh.c,v 1.5 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_getfh.c,v 1.4 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat_getfh.c,v 1.5 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -48,6 +48,8 @@ __RCSID("$NetBSD: compat_getfh.c,v 1.4 2006/07/31 16:34:42 martin Exp $");
#include <sys/mount.h>
#include <compat/include/fstypes.h>
#include <errno.h>
__warn_references(getfh,
"warning: reference to compatibility getfh(); include <sys/mount.h> to generate correct reference")
@ -62,6 +64,15 @@ int
getfh(const char *path, struct compat_30_fhandle *fhp)
{
size_t fh_size = sizeof(*fhp);
int ret;
return __getfh30(path, (void*)fhp, &fh_size);
ret = __getfh30(path, (void*)fhp, &fh_size);
if (ret != 0) {
return ret;
}
if (fh_size != FHANDLE30_SIZE) {
errno = EINVAL;
return -1;
}
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_statfs.c,v 1.2 2006/07/31 16:34:42 martin Exp $ */
/* $NetBSD: compat_statfs.c,v 1.3 2006/08/04 16:30:22 yamt Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_statfs.c,v 1.2 2006/07/31 16:34:42 martin Exp $");
__RCSID("$NetBSD: compat_statfs.c,v 1.3 2006/08/04 16:30:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@ -164,7 +164,7 @@ fhstatfs(const struct compat_30_fhandle *fh, struct statfs12 *ost)
struct statvfs nst;
int ret;
if ((ret = __fhstatvfs140(fh, FHANDLE30_SIZE(fh), &nst, ST_WAIT)) == -1)
if ((ret = __fhstatvfs140(fh, FHANDLE30_SIZE, &nst, ST_WAIT)) == -1)
return ret;
vfs2fs(ost, &nst);
return ret;