diff options
author | Hans Insulander <hin@cvs.openbsd.org> | 2003-08-12 07:53:48 +0000 |
---|---|---|
committer | Hans Insulander <hin@cvs.openbsd.org> | 2003-08-12 07:53:48 +0000 |
commit | f4a45a0f56d048184dff28b9f610c22a6be384c5 (patch) | |
tree | 181a6d2a2a124312e7363fe1b68b568eb9459b94 /sys | |
parent | 22d81b976dd3157dbf385cc7bf5b1fc2f9d1c52d (diff) |
Merge
Diffstat (limited to 'sys')
29 files changed, 3145 insertions, 2044 deletions
diff --git a/sys/xfs/xfs_attr.h b/sys/xfs/xfs_attr.h index f3f70efc377..9b7e81a61fa 100644 --- a/sys/xfs/xfs_attr.h +++ b/sys/xfs/xfs_attr.h @@ -31,10 +31,10 @@ * SUCH DAMAGE. */ -/* $Id: xfs_attr.h,v 1.5 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_attr.h,v 1.12 2002/09/07 10:46:15 lha Exp $ */ -#ifndef _XFS_ATTR_H -#define _XFS_ATTR_H +#ifndef _NNPFS_ATTR_H +#define _NNPFS_ATTR_H #define XA_V_NONE 0 #define XA_V_MODE (1 << 0) @@ -48,15 +48,15 @@ #define XA_V_FILEID (1 << 8) #define XA_V_TYPE (1 << 9) -#define XFS_FILE_NON 1 -#define XFS_FILE_REG 2 -#define XFS_FILE_DIR 3 -#define XFS_FILE_BLK 4 -#define XFS_FILE_CHR 5 -#define XFS_FILE_LNK 6 -#define XFS_FILE_SOCK 7 -#define XFS_FILE_FIFO 8 -#define XFS_FILE_BAD 9 +#define NNPFS_FILE_NON 1 +#define NNPFS_FILE_REG 2 +#define NNPFS_FILE_DIR 3 +#define NNPFS_FILE_BLK 4 +#define NNPFS_FILE_CHR 5 +#define NNPFS_FILE_LNK 6 +#define NNPFS_FILE_SOCK 7 +#define NNPFS_FILE_FIFO 8 +#define NNPFS_FILE_BAD 9 #define XA_CLEAR(xa_p) \ ((xa_p)->valid = XA_V_NONE) @@ -104,23 +104,23 @@ (((xa_p)->valid) & XA_V_TYPE) struct xfs_attr { - u_int32_t valid; - u_int32_t xa_mode; + uint32_t valid; + uint32_t xa_mode; - u_int32_t xa_nlink; - u_int32_t xa_size; + uint32_t xa_nlink; + uint32_t xa_size; - u_int32_t xa_uid; - u_int32_t xa_gid; + uint32_t xa_uid; + uint32_t xa_gid; - u_int32_t xa_atime; - u_int32_t xa_mtime; + uint32_t xa_atime; + uint32_t xa_mtime; - u_int32_t xa_ctime; - u_int32_t xa_fileid; + uint32_t xa_ctime; + uint32_t xa_fileid; - u_int32_t xa_type; - u_int32_t pad1; + uint32_t xa_type; + uint32_t pad1; }; -#endif /* _XFS_ATTR_H */ +#endif /* _NNPFS_ATTR_H */ diff --git a/sys/xfs/xfs_common-bsd.c b/sys/xfs/xfs_common-bsd.c index 486127625cc..eac6fca8dd1 100644 --- a/sys/xfs/xfs_common-bsd.c +++ b/sys/xfs/xfs_common-bsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -35,42 +35,45 @@ #include <xfs/xfs_common.h> #include <xfs/xfs_deb.h> -RCSID("$Id: xfs_common-bsd.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_common-bsd.c,v 1.25 2002/12/18 16:32:03 lha Exp $"); #ifdef MALLOC_DEFINE -MALLOC_DEFINE(M_XFS, "xfs", "xfs buffer"); +MALLOC_DEFINE(M_NNPFS, "xfs-misc", "xfs misc"); +MALLOC_DEFINE(M_NNPFS_NODE, "xfs-node", "xfs node"); +MALLOC_DEFINE(M_NNPFS_LINK, "xfs-link", "xfs link"); +MALLOC_DEFINE(M_NNPFS_MSG, "xfs-msg", "xfs msg"); #endif -#ifdef XFS_DEBUG +#ifdef NNPFS_DEBUG static u_int xfs_allocs; static u_int xfs_frees; void * -xfs_alloc(u_int size) +xfs_alloc(u_int size, xfs_malloc_type type) { void *ret; xfs_allocs++; - XFSDEB(XDEBMEM, ("xfs_alloc: xfs_allocs - xfs_frees %d\n", + NNPFSDEB(XDEBMEM, ("xfs_alloc: xfs_allocs - xfs_frees %d\n", xfs_allocs - xfs_frees)); - MALLOC(ret, void *, size, M_XFS, M_WAITOK); + MALLOC(ret, void *, size, type, M_WAITOK); return ret; } void -xfs_free(void *ptr, u_int size) +xfs_free(void *ptr, u_int size, xfs_malloc_type type) { xfs_frees++; - FREE(ptr, M_XFS); + FREE(ptr, type); } -#endif /* XFS_DEBUG */ +#endif /* NNPFS_DEBUG */ int -xfs_suser(struct proc *p) +xfs_suser(d_thread_t *p) { -#ifdef HAVE_TWO_ARGUMENT_SUSER +#if defined(HAVE_TWO_ARGUMENT_SUSER) return suser (xfs_proc_to_cred(p), NULL); #else return suser (p); diff --git a/sys/xfs/xfs_common.h b/sys/xfs/xfs_common.h index 738ebe42b3f..b5710c466fa 100644 --- a/sys/xfs/xfs_common.h +++ b/sys/xfs/xfs_common.h @@ -31,30 +31,37 @@ * SUCH DAMAGE. */ -/* $Id: xfs_common.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_common.h,v 1.19 2002/12/18 12:32:10 lha Exp $ */ #ifndef _xfs_common_h #define _xfs_common_h #if defined(MALLOC_DECLARE) -MALLOC_DECLARE(M_XFS); -#elif !defined(M_XFS) -#define M_XFS M_TEMP +MALLOC_DECLARE(M_NNPFS); +MALLOC_DECLARE(M_NNPFS_NODE); +MALLOC_DECLARE(M_NNPFS_LINK); +MALLOC_DECLARE(M_NNPFS_MSG); +#elif !defined(M_NNPFS) +#define M_NNPFS M_TEMP +#define M_NNPFS_NODE M_TEMP +#define M_NNPFS_LINK M_TEMP +#define M_NNPFS_MSG M_TEMP #endif -#ifdef XFS_DEBUG -void *xfs_alloc(u_int size); -void xfs_free(void *, u_int size); + +#ifdef NNPFS_DEBUG +void *xfs_alloc(u_int size, xfs_malloc_type type); +void xfs_free(void *, u_int size, xfs_malloc_type type); #else #ifdef __osf__ -#define xfs_alloc(a) malloc((a), BUCKETINDEX(a), M_XFS, M_WAITOK) +#define xfs_alloc(a,t) malloc((a), BUCKETINDEX(a), t, M_WAITOK) #else -#define xfs_alloc(a) malloc((a), M_XFS, M_WAITOK) +#define xfs_alloc(a,t) malloc((a), t, M_WAITOK) #endif -#define xfs_free(a, size) free(a, M_XFS) -#endif /* XFS_DEBUG */ +#define xfs_free(a, size,t) free(a, t) +#endif /* NNPFS_DEBUG */ -int xfs_suser(struct proc *p); +int xfs_suser(d_thread_t *p); #ifndef HAVE_KERNEL_MEMCPY void * diff --git a/sys/xfs/xfs_config.h b/sys/xfs/xfs_config.h index f96423b5831..034e409a61d 100644 --- a/sys/xfs/xfs_config.h +++ b/sys/xfs/xfs_config.h @@ -1,1259 +1,1663 @@ -/* include/config.h. Generated automatically by configure. */ -/* include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h. Generated by configure. */ +/* include/config.h.in. Generated from configure.in by autoheader. */ -/* Define to empty if the keyword does not work. */ -/* #undef const */ +#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY +#define OPENSSL_DES_LIBDES_COMPATIBILITY 1 +#endif -/* Define if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 +#ifndef RCSID +#define RCSID(msg) \ +static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } +#endif -/* Define as __inline if that's what the C compiler calls it. */ -/* #undef inline */ +/* Maximum values on all known systems */ +#define MaxHostNameLen (64+4) +#define MaxPathLen (1024+4) -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 -/* Define if you can safely include both <sys/time.h> and <time.h>. */ -#define TIME_WITH_SYS_TIME 1 +/* Define if realloc(NULL) doesn't work. */ +/* #undef BROKEN_REALLOC */ -/* Define if the X Window System is missing or not being used. */ -/* #undef X_DISPLAY_MISSING */ +/* define if you can include both dirent.h and sys/dir.h */ +#define DIRENT_AND_SYS_DIR_H 1 + +/* define if DIRSIZ is defined in dirent.h */ +/* #undef DIRSIZ_IN_DIRENT_H */ + +/* define if DIRSIZ is defined in sys/dir.h */ +#define DIRSIZ_IN_SYS_DIR_H 1 + +/* how should ntohl be done? */ +#define EFF_NTOHL ntohl + +/* define if sys/param.h defines the endiness */ +#define ENDIANESS_IN_SYS_PARAM_H 1 -/* Define if you have the asnprintf function. */ +/* define if DIRSIZ is defined in sys/dirent.h */ +/* #undef GENERIC_DIRSIZ_IN_SYS_DIRENT_H */ + +/* define if prototype of gethostbyaddr is compatible with struct hostent + *gethostbyaddr(const void *, size_t, int) */ +/* #undef GETHOSTBYADDR_PROTO_COMPATIBLE */ + +/* define if prototype of gethostbyname is compatible with struct hostent + *gethostbyname(const char *) */ +#define GETHOSTBYNAME_PROTO_COMPATIBLE 1 + +/* define if prototype of getservbyname is compatible with struct servent + *getservbyname(const char *, const char *) */ +#define GETSERVBYNAME_PROTO_COMPATIBLE 1 + +/* define if prototype of getsockname is compatible with int getsockname(int, + struct sockaddr*, socklen_t*) */ +#define GETSOCKNAME_PROTO_COMPATIBLE 1 + +/* Define if you have the `altzone' variable. */ +/* #undef HAVE_ALTZONE */ + +/* define if your system declares altzone */ +/* #undef HAVE_ALTZONE_DECLARATION */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <arpa/nameser.h> header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the `asnprintf' function. */ /* #undef HAVE_ASNPRINTF */ -/* Define if you have the asprintf function. */ +/* Define to 1 if you have the `asprintf' function. */ #define HAVE_ASPRINTF 1 -/* Define if you have the bool function. */ +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `bool' function. */ /* #undef HAVE_BOOL */ -/* Define if you have the chown function. */ +/* Define to 1 if you have the `bswap16' function. */ +/* #undef HAVE_BSWAP16 */ + +/* Define to 1 if you have the `bswap32' function. */ +/* #undef HAVE_BSWAP32 */ + +/* Define to 1 if you have the `cgetent' function. */ +#define HAVE_CGETENT 1 + +/* Define if you have the function `chown'. */ #define HAVE_CHOWN 1 -/* Define if you have the copyhostent function. */ +/* Define to 1 if you have the <com_err.h> header file. */ +#define HAVE_COM_ERR_H 1 + +/* Define to 1 if you have the <config.h> header file. */ +/* #undef HAVE_CONFIG_H */ + +/* Define if you have the function `copyhostent'. */ /* #undef HAVE_COPYHOSTENT */ -/* Define if you have the daemon function. */ +/* Define to 1 if you have the `crypt' function. */ +#define HAVE_CRYPT 1 + +/* Define to 1 if you have the <crypt.h> header file. */ +/* #undef HAVE_CRYPT_H */ + +/* Define if you have the function `daemon'. */ #define HAVE_DAEMON 1 -/* Define if you have the dn_expand function. */ +/* define if you have a berkeley db1/2 library */ +#define HAVE_DB1 1 + +/* define if you have a berkeley db3/4 library */ +/* #undef HAVE_DB3 */ + +/* Define to 1 if you have the <db3/db.h> header file. */ +/* #undef HAVE_DB3_DB_H */ + +/* Define to 1 if you have the <db4/db.h> header file. */ +/* #undef HAVE_DB4_DB_H */ + +/* Define to 1 if you have the `dbm_firstkey' function. */ +#define HAVE_DBM_FIRSTKEY 1 + +/* Define to 1 if you have the <dbm.h> header file. */ +#define HAVE_DBM_H 1 + +/* Define to 1 if you have the `dbopen' function. */ +#define HAVE_DBOPEN 1 + +/* Define to 1 if you have the <db_185.h> header file. */ +/* #undef HAVE_DB_185_H */ + +/* Define to 1 if you have the `db_create' function. */ +/* #undef HAVE_DB_CREATE */ + +/* Define to 1 if you have the <db.h> header file. */ +#define HAVE_DB_H 1 + +/* define if you have ndbm compat in db */ +/* #undef HAVE_DB_NDBM */ + +/* Define if you have struct setgroups_args */ +/* #undef HAVE_DEF_STRUCT_SETGROUPS_ARGS */ + +/* Define if you have struct sys_setgroups_args */ +#define HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS 1 + +/* define if devfs_register takes eleven arguments */ +/* #undef HAVE_DEVFS_REGISTER_ELEVEN_ARGS */ + +/* define if you have a function dget_locked */ +/* #undef HAVE_DGET_LOCKED */ + +/* Define to 1 if you have the <dirent.h> header file. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `dn_expand' function. */ #define HAVE_DN_EXPAND 1 -/* Define if you have the el_init function. */ +/* define if d_alloc_root takes two arguments */ +/* #undef HAVE_D_ALLOC_ROOT_TWO_ARGS */ + +/* define if d_delete in struct dentry_operations returns void */ +/* #undef HAVE_D_DELETE_VOID */ + +/* Define if you have the function `ecalloc'. */ +/* #undef HAVE_ECALLOC */ + +/* Define to 1 if you have the <elflib/nlist.h> header file. */ +/* #undef HAVE_ELFLIB_NLIST_H */ + +/* Define to 1 if you have the `el_init' function. */ /* #undef HAVE_EL_INIT */ -/* Define if you have the err function. */ +/* Define if you have the function `emalloc'. */ +/* #undef HAVE_EMALLOC */ + +/* define if your system declares environ */ +/* #undef HAVE_ENVIRON_DECLARATION */ + +/* Define if you have the function `erealloc'. */ +/* #undef HAVE_EREALLOC */ + +/* Define if you have the function `err'. */ #define HAVE_ERR 1 -/* Define if you have the errx function. */ +/* Define to 1 if you have the <errno.h> header file. */ +#define HAVE_ERRNO_H 1 + +/* Define if you have the function `errx'. */ #define HAVE_ERRX 1 -/* Define if you have the fchown function. */ +/* Define to 1 if you have the <err.h> header file. */ +#define HAVE_ERR_H 1 + +/* Define if you have the function `estrdup'. */ +/* #undef HAVE_ESTRDUP */ + +/* Define to 1 if you have the <et/com_err.h> header file. */ +/* #undef HAVE_ET_COM_ERR_H */ + +/* Define if you have the function `fchown'. */ #define HAVE_FCHOWN 1 -/* Define if you have the fcntl function. */ -#define HAVE_FCNTL 1 +/* Define to 1 if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 -/* Define if you have the fhopen function. */ +/* Define to 1 if you have the `fhopen' function. */ #define HAVE_FHOPEN 1 -/* Define if you have the flock function. */ +/* define if filldir_t takes a dt_type argument */ +/* #undef HAVE_FILLDIR_T_DT_TYPE */ + +/* Define if you have the function `flock'. */ #define HAVE_FLOCK 1 -/* Define if you have the freeaddrinfo function. */ +/* Define if you have the function `fnmatch'. */ +#define HAVE_FNMATCH 1 + +/* Define to 1 if you have the <fnmatch.h> header file. */ +#define HAVE_FNMATCH_H 1 + +/* define if lockmgr takes four arguments */ +#define HAVE_FOUR_ARGUMENT_LOCKMGR 1 + +/* define if vfs_busy takes four arguments */ +#define HAVE_FOUR_ARGUMENT_VFS_BUSY 1 + +/* define if vfs_name_hash takes four arguments */ +/* #undef HAVE_FOUR_ARGUMENT_VFS_NAME_HASH */ + +/* if vfs_object_create takes four arguments */ +/* #undef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE */ + +/* Define to 1 if you have the `freeaddrinfo' function. */ #define HAVE_FREEADDRINFO 1 -/* Define if you have the freehostent function. */ +/* Define if you have the function `freehostent'. */ /* #undef HAVE_FREEHOSTENT */ -/* Define if you have the gai_strerror function. */ +/* Define to 1 if you have the `gai_strerror' function. */ #define HAVE_GAI_STRERROR 1 -/* Define if you have the get_progname function. */ -/* #undef HAVE_GET_PROGNAME */ +/* Define to 1 if you have the <gdbm/ndbm.h> header file. */ +/* #undef HAVE_GDBM_NDBM_H */ -/* Define if you have the getaddrinfo function. */ +/* Define to 1 if you have the `getaddrinfo' function. */ #define HAVE_GETADDRINFO 1 -/* Define if you have the getcwd function. */ +/* Define to 1 if you have the `getattrlist' function. */ +/* #undef HAVE_GETATTRLIST */ + +/* Define to 1 if you have the `getconfattr' function. */ +/* #undef HAVE_GETCONFATTR */ + +/* Define if you have the function `getcwd'. */ #define HAVE_GETCWD 1 -/* Define if you have the getdtablesize function. */ +/* Define if you have the function `getdtablesize'. */ #define HAVE_GETDTABLESIZE 1 -/* Define if you have the getfh function. */ +/* Define if you have the function `getegid'. */ +#define HAVE_GETEGID 1 + +/* Define if you have the function `geteuid'. */ +#define HAVE_GETEUID 1 + +/* Define to 1 if you have the `getfh' function. */ #define HAVE_GETFH 1 -/* Define if you have the gethostbyname function. */ +/* Define if you have the function `getgid'. */ +#define HAVE_GETGID 1 + +/* Define to 1 if you have the `gethostbyname' function. */ #define HAVE_GETHOSTBYNAME 1 -/* Define if you have the gethostbyname2 function. */ +/* Define to 1 if you have the `gethostbyname2' function. */ #define HAVE_GETHOSTBYNAME2 1 -/* Define if you have the getipnodebyaddr function. */ +/* Define if you have the function `gethostname'. */ +#define HAVE_GETHOSTNAME 1 + +/* Define if you have the function `getifaddrs'. */ +#define HAVE_GETIFADDRS 1 + +/* Define if you have the function `getipnodebyaddr'. */ /* #undef HAVE_GETIPNODEBYADDR */ -/* Define if you have the getipnodebyname function. */ +/* Define if you have the function `getipnodebyname'. */ /* #undef HAVE_GETIPNODEBYNAME */ -/* Define if you have the getitimer function. */ -#define HAVE_GETITIMER 1 - -/* Define if you have the getlogin function. */ +/* Define to 1 if you have the `getlogin' function. */ #define HAVE_GETLOGIN 1 -/* Define if you have the getnameinfo function. */ +/* Define to 1 if you have the `getnameinfo' function. */ #define HAVE_GETNAMEINFO 1 -/* Define if you have the getopt function. */ +/* Define if you have the function `getopt'. */ #define HAVE_GETOPT 1 -/* Define if you have the getpagesize function. */ +/* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 -/* Define if you have the getrlimit function. */ +/* Define to 1 if you have the `getprogname' function. */ +/* #undef HAVE_GETPROGNAME */ + +/* Define to 1 if you have the `getrlimit' function. */ #define HAVE_GETRLIMIT 1 -/* Define if you have the getrusage function. */ +/* Define to 1 if you have the `getrusage' function. */ #define HAVE_GETRUSAGE 1 -/* Define if you have the getspnam function. */ +/* Define to 1 if you have the `getsockopt' function. */ +#define HAVE_GETSOCKOPT 1 + +/* Define to 1 if you have the `getspnam' function. */ /* #undef HAVE_GETSPNAM */ -/* Define if you have the getspuid function. */ -/* #undef HAVE_GETSPUID */ +/* Define if you have the function `gettimeofday'. */ +#define HAVE_GETTIMEOFDAY 1 -/* Define if you have the getusershell function. */ +/* Define if you have the function `getuid'. */ +#define HAVE_GETUID 1 + +/* Define if you have the function `getusershell'. */ #define HAVE_GETUSERSHELL 1 -/* Define if you have the hstrerror function. */ +/* define if you have a glibc-based system */ +/* #undef HAVE_GLIBC */ + +/* define if you have a glob() that groks GLOB_BRACE, GLOB_NOCHECK, + GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT */ +#define HAVE_GLOB 1 + +/* Define to 1 if you have the <glob.h> header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the <grp.h> header file. */ +#define HAVE_GRP_H 1 + +/* Define to 1 if you have the `hstrerror' function. */ #define HAVE_HSTRERROR 1 -/* Define if you have the inet_aton function. */ +/* Define if you have the `h_errlist' variable. */ +#define HAVE_H_ERRLIST 1 + +/* define if your system declares h_errlist */ +/* #undef HAVE_H_ERRLIST_DECLARATION */ + +/* Define if you have the `h_errno' variable. */ +#define HAVE_H_ERRNO 1 + +/* define if your system declares h_errno */ +#define HAVE_H_ERRNO_DECLARATION 1 + +/* Define if you have the `h_nerr' variable. */ +#define HAVE_H_NERR 1 + +/* define if your system declares h_nerr */ +/* #undef HAVE_H_NERR_DECLARATION */ + +/* Define to 1 if you have the <ifaddrs.h> header file. */ +#define HAVE_IFADDRS_H 1 + +/* Define if you have the in6addr_loopback variable */ +#define HAVE_IN6ADDR_LOOPBACK 1 + +/* define */ #define HAVE_INET_ATON 1 -/* Define if you have the inet_ntop function. */ +/* define */ #define HAVE_INET_NTOP 1 -/* Define if you have the inet_pton function. */ +/* define */ #define HAVE_INET_PTON 1 -/* Define if you have the initgroups function. */ +/* Define if you have the function `initgroups'. */ #define HAVE_INITGROUPS 1 -/* Define if you have the int16 function. */ +/* Define to 1 if you have the `initstate' function. */ +#define HAVE_INITSTATE 1 + +/* define if you have a function init_MUTEX */ +/* #undef HAVE_INIT_MUTEX */ + +/* define if you have a init_waitqueue_head */ +/* #undef HAVE_INIT_WAITQUEUE_HEAD */ + +/* Define if you have the function `innetgr'. */ +#define HAVE_INNETGR 1 + +/* Define to 1 if you have the `int16' function. */ /* #undef HAVE_INT16 */ -/* Define if you have the int16_t function. */ +/* Define to 1 if you have the `int16_t' function. */ #define HAVE_INT16_T 1 -/* Define if you have the int32 function. */ +/* Define to 1 if you have the `int32' function. */ /* #undef HAVE_INT32 */ -/* Define if you have the int32_t function. */ +/* Define to 1 if you have the `int32_t' function. */ #define HAVE_INT32_T 1 -/* Define if you have the int64_t function. */ +/* Define to 1 if you have the `int64_t' function. */ #define HAVE_INT64_T 1 -/* Define if you have the int8_t function. */ +/* Define to 1 if you have the `int8_t' function. */ #define HAVE_INT8_T 1 -/* Define if you have the intptr_t function. */ +/* Define to 1 if you have the `intptr_t' function. */ /* #undef HAVE_INTPTR_T */ -/* Define if you have the kernel_aout_sysent function. */ +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have IPv6. */ +#define HAVE_IPV6 1 + +/* Define if you have the function `iruserok'. */ +#define HAVE_IRUSEROK 1 + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* Define to 1 if you have the `kernel_aout_sysent' function. */ /* #undef HAVE_KERNEL_AOUT_SYSENT */ -/* Define if you have the kernel_cache_purgevfs function. */ +/* Define to 1 if you have the `kernel_cache_purgevfs' function. */ #define HAVE_KERNEL_CACHE_PURGEVFS 1 -/* Define if you have the kernel_cdevsw_add function. */ +/* Define to 1 if you have the `kernel_cdevsw_add' function. */ /* #undef HAVE_KERNEL_CDEVSW_ADD */ -/* Define if you have the kernel_debuglockmgr function. */ +/* Define to 1 if you have the `kernel_debuglockmgr' function. */ /* #undef HAVE_KERNEL_DEBUGLOCKMGR */ -/* Define if you have the kernel_devtoname function. */ +/* Define to 1 if you have the `kernel_devtoname' function. */ /* #undef HAVE_KERNEL_DEVTONAME */ -/* Define if you have the kernel_doforce function. */ +/* Define to 1 if you have the `kernel_doforce' function. */ #define HAVE_KERNEL_DOFORCE 1 -/* Define if you have the kernel_genfs_revoke function. */ +/* Define to 1 if you have the `kernel_genfs_mmap' function. */ +/* #undef HAVE_KERNEL_GENFS_MMAP */ + +/* Define to 1 if you have the `kernel_genfs_revoke' function. */ /* #undef HAVE_KERNEL_GENFS_REVOKE */ -/* Define if you have the kernel_lockmgr function. */ +/* Define to 1 if you have the `kernel_lf_advlock' function. */ +#define HAVE_KERNEL_LF_ADVLOCK 1 + +/* Define to 1 if you have the `kernel_lockmgr' function. */ #define HAVE_KERNEL_LOCKMGR 1 -/* Define if you have the kernel_lockstatus function. */ +/* Define to 1 if you have the `kernel_lockstatus' function. */ #define HAVE_KERNEL_LOCKSTATUS 1 -/* Define if you have the kernel_make_dev function. */ -/* #undef HAVE_KERNEL_MAKE_DEV */ - -/* Define if you have the kernel_memcpy function. */ +/* Define to 1 if you have the `kernel_memcpy' function. */ #define HAVE_KERNEL_MEMCPY 1 -/* Define if you have the kernel_nosys function. */ +/* Define to 1 if you have the `kernel_namei_hash' function. */ +/* #undef HAVE_KERNEL_NAMEI_HASH */ + +/* Define to 1 if you have the `kernel_nosys' function. */ /* #undef HAVE_KERNEL_NOSYS */ -/* Define if you have the kernel_snprintf function. */ +/* Define to 1 if you have the `kernel_snprintf' function. */ #define HAVE_KERNEL_SNPRINTF 1 -/* Define if you have the kernel_strlcpy function. */ +/* Define to 1 if you have the `kernel_strlcpy' function. */ #define HAVE_KERNEL_STRLCPY 1 -/* Define if you have the kernel_sys_lkmnosys function. */ +/* Define to 1 if you have the `kernel_sys_lkmnosys' function. */ #define HAVE_KERNEL_SYS_LKMNOSYS 1 -/* Define if you have the kernel_sys_nosys function. */ +/* Define to 1 if you have the `kernel_sys_nosys' function. */ #define HAVE_KERNEL_SYS_NOSYS 1 -/* Define if you have the kernel_udev2dev function. */ +/* Define to 1 if you have the `kernel_udev2dev' function. */ /* #undef HAVE_KERNEL_UDEV2DEV */ -/* Define if you have the kernel_vfs_add_vnodeops function. */ +/* Define to 1 if you have the `kernel_uma_zfree_arg' function. */ +/* #undef HAVE_KERNEL_UMA_ZFREE_ARG */ + +/* define if we only can include uvm headers */ +/* #undef HAVE_KERNEL_UVM_ONLY */ + +/* Define to 1 if you have the `kernel_vfs_add_vnodeops' function. */ /* #undef HAVE_KERNEL_VFS_ADD_VNODEOPS */ -/* Define if you have the kernel_vfs_attach function. */ +/* Define to 1 if you have the `kernel_vfs_attach' function. */ /* #undef HAVE_KERNEL_VFS_ATTACH */ -/* Define if you have the kernel_vfs_cache_lookup function. */ +/* Define to 1 if you have the `kernel_vfs_cache_lookup' function. */ /* #undef HAVE_KERNEL_VFS_CACHE_LOOKUP */ -/* Define if you have the kernel_vfs_deallocate_syncvnode function. */ +/* Define to 1 if you have the `kernel_vfs_deallocate_syncvnode' function. */ /* #undef HAVE_KERNEL_VFS_DEALLOCATE_SYNCVNODE */ -/* Define if you have the kernel_vfs_getnewfsid function. */ +/* Define to 1 if you have the `kernel_vfs_getnewfsid' function. */ #define HAVE_KERNEL_VFS_GETNEWFSID 1 -/* Define if you have the kernel_vfs_getvfs function. */ +/* Define to 1 if you have the `kernel_vfs_getvfs' function. */ #define HAVE_KERNEL_VFS_GETVFS 1 -/* Define if you have the kernel_vfs_name_hash function. */ -/* #undef HAVE_KERNEL_VFS_NAME_HASH */ - -/* Define if you have the kernel_vfs_object_create function. */ +/* Define to 1 if you have the `kernel_vfs_object_create' function. */ /* #undef HAVE_KERNEL_VFS_OBJECT_CREATE */ -/* Define if you have the kernel_vfs_opv_init function. */ +/* Define to 1 if you have the `kernel_vfs_opv_init' function. */ #define HAVE_KERNEL_VFS_OPV_INIT 1 -/* Define if you have the kernel_vfs_opv_init_default function. */ +/* Define to 1 if you have the `kernel_vfs_opv_init_default' function. */ #define HAVE_KERNEL_VFS_OPV_INIT_DEFAULT 1 -/* Define if you have the kernel_vfs_opv_init_explicit function. */ +/* Define to 1 if you have the `kernel_vfs_opv_init_explicit' function. */ #define HAVE_KERNEL_VFS_OPV_INIT_EXPLICIT 1 -/* Define if you have the kernel_vfs_register function. */ +/* Define to 1 if you have the `kernel_vfs_register' function. */ #define HAVE_KERNEL_VFS_REGISTER 1 -/* Define if you have the kernel_vgonel function. */ +/* Define to 1 if you have the `kernel_vgonel' function. */ #define HAVE_KERNEL_VGONEL 1 -/* Define if you have the kernel_vnode_pager_generic_getpages function. */ +/* Define to 1 if you have the `kernel_vnode_pager_generic_getpages' function. + */ /* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES */ -/* Define if you have the kernel_vnode_pager_generic_putpages function. */ +/* Define to 1 if you have the `kernel_vnode_pager_generic_putpages' function. + */ /* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_PUTPAGES */ -/* Define if you have the kernel_vnode_pager_setsize function. */ +/* Define to 1 if you have the `kernel_vnode_pager_setsize' function. */ /* #undef HAVE_KERNEL_VNODE_PAGER_SETSIZE */ -/* Define if you have the kernel_vop_revoke function. */ +/* Define to 1 if you have the `kernel_vop_revoke' function. */ /* #undef HAVE_KERNEL_VOP_REVOKE */ -/* Define if you have the kernel_zfreei function. */ +/* Define to 1 if you have the `kernel_vop_stdpathconf' function. */ +/* #undef HAVE_KERNEL_VOP_STDPATHCONF */ + +/* Define to 1 if you have the `kernel_zfree' function. */ +/* #undef HAVE_KERNEL_ZFREE */ + +/* Define to 1 if you have the `kernel_zfreei' function. */ /* #undef HAVE_KERNEL_ZFREEI */ -/* Define if you have the krb_afslog_uid function. */ -#define HAVE_KRB_AFSLOG_UID 1 +/* define if you have kerberos 4 */ +/* #undef HAVE_KRB4 */ -/* Define if you have the kvm_nlist function. */ -#define HAVE_KVM_NLIST 1 +/* define if you have kerberos 5 */ +#define HAVE_KRB5 1 -/* Define if you have the kvm_open function. */ -#define HAVE_KVM_OPEN 1 +/* define if you have kerberos 4 compat */ +/* #undef HAVE_KRB5_COMPAT_KRB4 */ + +/* Define to 1 if you have the `krb_afslog_uid' function. */ +/* #undef HAVE_KRB_AFSLOG_UID */ + +/* define if you have krb_get_default_principal */ +/* #undef HAVE_KRB_GET_DEFAULT_PRINCIPAL */ + +/* define if you have krb_get_default_tkt_root */ +/* #undef HAVE_KRB_GET_DEFAULT_TKT_ROOT */ + +/* define if you have krb_get_err_text */ +/* #undef HAVE_KRB_GET_ERR_TEXT */ + +/* define if you have krb_kdctimeofday */ +/* #undef HAVE_KRB_KDCTIMEOFDAY */ + +/* define if you have a struct krb_principal */ +/* #undef HAVE_KRB_PRINCIPAL */ -/* Define if you have the linux_kernel_int16_t function. */ +/* Define to 1 if you have the <ktypes.h> header file. */ +/* #undef HAVE_KTYPES_H */ + +/* Define to 1 if you have the <kvm.h> header file. */ +#define HAVE_KVM_H 1 + +/* Define to 1 if you have the <libelf/nlist.h> header file. */ +/* #undef HAVE_LIBELF_NLIST_H */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/devfs_fs.h> header file. */ +/* #undef HAVE_LINUX_DEVFS_FS_H */ + +/* Define to 1 if you have the <linux/devfs_fs_kernel.h> header file. */ +/* #undef HAVE_LINUX_DEVFS_FS_KERNEL_H */ + +/* Define to 1 if you have the `linux_kernel_int16_t' function. */ /* #undef HAVE_LINUX_KERNEL_INT16_T */ -/* Define if you have the linux_kernel_int32_t function. */ +/* Define to 1 if you have the `linux_kernel_int32_t' function. */ /* #undef HAVE_LINUX_KERNEL_INT32_T */ -/* Define if you have the linux_kernel_int64_t function. */ +/* Define to 1 if you have the `linux_kernel_int64_t' function. */ /* #undef HAVE_LINUX_KERNEL_INT64_T */ -/* Define if you have the linux_kernel_int8_t function. */ +/* Define to 1 if you have the `linux_kernel_int8_t' function. */ /* #undef HAVE_LINUX_KERNEL_INT8_T */ -/* Define if you have the linux_kernel_u_int16_t function. */ -/* #undef HAVE_LINUX_KERNEL_U_INT16_T */ +/* Define to 1 if you have the `linux_kernel_uint16_t' function. */ +/* #undef HAVE_LINUX_KERNEL_UINT16_T */ + +/* Define to 1 if you have the `linux_kernel_uint32_t' function. */ +/* #undef HAVE_LINUX_KERNEL_UINT32_T */ + +/* Define to 1 if you have the `linux_kernel_uint64_t' function. */ +/* #undef HAVE_LINUX_KERNEL_UINT64_T */ -/* Define if you have the linux_kernel_u_int32_t function. */ -/* #undef HAVE_LINUX_KERNEL_U_INT32_T */ +/* Define to 1 if you have the `linux_kernel_uint8_t' function. */ +/* #undef HAVE_LINUX_KERNEL_UINT8_T */ -/* Define if you have the linux_kernel_u_int64_t function. */ -/* #undef HAVE_LINUX_KERNEL_U_INT64_T */ +/* Define to 1 if you have the <linux/stddef.h> header file. */ +/* #undef HAVE_LINUX_STDDEF_H */ -/* Define if you have the linux_kernel_u_int8_t function. */ -/* #undef HAVE_LINUX_KERNEL_U_INT8_T */ +/* define if you have a function list_del_init */ +/* #undef HAVE_LIST_DEL_INIT */ -/* Define if you have the localtime_r function. */ +/* define if there exists a localtime_r */ #define HAVE_LOCALTIME_R 1 -/* Define if you have the lstat function. */ +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define if you have the function `lstat'. */ #define HAVE_LSTAT 1 -/* Define if you have the memmove function. */ +/* Define to 1 if you have the <machine/asm.h> header file. */ +#define HAVE_MACHINE_ASM_H 1 + +/* Define to 1 if you have the <machine/regdef.h> header file. */ +/* #undef HAVE_MACHINE_REGDEF_H */ + +/* Define to 1 if you have the <mach/alpha/asm.h> header file. */ +/* #undef HAVE_MACH_ALPHA_ASM_H */ + +/* Define if you have the function `memmove'. */ #define HAVE_MEMMOVE 1 -/* Define if you have the mkstemp function. */ +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the <miscfs/genfs/genfs.h> header file. */ +/* #undef HAVE_MISCFS_GENFS_GENFS_H */ + +/* Define to 1 if you have the <miscfs/syncfs/syncfs.h> header file. */ +/* #undef HAVE_MISCFS_SYNCFS_SYNCFS_H */ + +/* Define if you have the function `mkstemp'. */ #define HAVE_MKSTEMP 1 -/* Define if you have the mktime function. */ -#define HAVE_MKTIME 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* define if you have a ndbm library */ +#define HAVE_NDBM 1 + +/* Define to 1 if you have the <ndbm.h> header file. */ +#define HAVE_NDBM_H 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet6/in6.h> header file. */ +/* #undef HAVE_NETINET6_IN6_H */ + +/* Define to 1 if you have the <netinet6/in6_var.h> header file. */ +#define HAVE_NETINET6_IN6_VAR_H 1 + +/* Define to 1 if you have the <netinet/in6.h> header file. */ +/* #undef HAVE_NETINET_IN6_H */ -/* Define if you have the off64_t function. */ +/* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */ +/* #undef HAVE_NETINET_IN6_MACHTYPES_H */ + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/in_systm.h> header file. */ +#define HAVE_NETINET_IN_SYSTM_H 1 + +/* Define to 1 if you have the <netinet/ip.h> header file. */ +#define HAVE_NETINET_IP_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +#define HAVE_NETINET_TCP_H 1 + +/* Define to 1 if you have the <net/if_dl.h> header file. */ +#define HAVE_NET_IF_DL_H 1 + +/* Define to 1 if you have the <net/if.h> header file. */ +#define HAVE_NET_IF_H 1 + +/* Define to 1 if you have the <net/if_types.h> header file. */ +#define HAVE_NET_IF_TYPES_H 1 + +/* Define if NDBM really is DB (creates files *.db) */ +#define HAVE_NEW_DB 1 + +/* Define to 1 if you have the <nlist.h> header file. */ +#define HAVE_NLIST_H 1 + +/* Define to 1 if you have the `off64_t' function. */ /* #undef HAVE_OFF64_T */ -/* Define if you have the pthread_create function. */ +/* define if lockstatus takes one argument */ +#define HAVE_ONE_ARGUMENT_LOCKSTATUS 1 + +/* define if vget takes one argument */ +/* #undef HAVE_ONE_ARGUMENT_VGET */ + +/* define if VOP_LOCK takes one argument */ +/* #undef HAVE_ONE_ARGUMENT_VOP_LOCK */ + +/* Define to 1 if you have the `on_exit' function. */ +/* #undef HAVE_ON_EXIT */ + +/* define if your system declares optarg */ +#define HAVE_OPTARG_DECLARATION 1 + +/* define if your system declares opterr */ +#define HAVE_OPTERR_DECLARATION 1 + +/* define if your system declares optind */ +#define HAVE_OPTIND_DECLARATION 1 + +/* define if your system declares optopt */ +#define HAVE_OPTOPT_DECLARATION 1 + +/* Define if you have the `optreset' variable. */ +#define HAVE_OPTRESET 1 + +/* define if your system declares optreset */ +#define HAVE_OPTRESET_DECLARATION 1 + +/* Define to 1 if you have the <paths.h> header file. */ +#define HAVE_PATHS_H 1 + +/* Define to 1 if you have the `pidfile' function. */ +#define HAVE_PIDFILE 1 + +/* define if you have sigaction */ +#define HAVE_POSIX_SIGNALS 1 + +/* Define to 1 if you have the `pthread_create' function. */ /* #undef HAVE_PTHREAD_CREATE */ -/* Define if you have the putenv function. */ +/* Define if you have the function `putenv'. */ #define HAVE_PUTENV 1 -/* Define if you have the rcmd function. */ +/* Define to 1 if you have the <pwd.h> header file. */ +#define HAVE_PWD_H 1 + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define if you have the function `rcmd'. */ #define HAVE_RCMD 1 -/* Define if you have the readline function. */ +/* define if you have a function readline */ #define HAVE_READLINE 1 -/* Define if you have the readv function. */ +/* Define if you have the function `readv'. */ #define HAVE_READV 1 -/* Define if you have the recvmsg function. */ +/* Define if you have the function `recvmsg'. */ #define HAVE_RECVMSG 1 -/* Define if you have the register_t function. */ +/* Define to 1 if you have the <regdef.h> header file. */ +/* #undef HAVE_REGDEF_H */ + +/* Define to 1 if you have the `register_t' function. */ #define HAVE_REGISTER_T 1 -/* Define if you have the res_init function. */ +/* define? */ +/* #undef HAVE_REPAIRABLE_HTONL */ + +/* Define to 1 if you have the <resolv.h> header file. */ +#define HAVE_RESOLV_H 1 + +/* Define to 1 if you have the `res_init' function. */ #define HAVE_RES_INIT 1 -/* Define if you have the res_search function. */ +/* Define to 1 if you have the `res_nsearch' function. */ +/* #undef HAVE_RES_NSEARCH */ + +/* Define to 1 if you have the `res_search' function. */ #define HAVE_RES_SEARCH 1 -/* Define if you have the sa_family_t function. */ +/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */ +/* #undef HAVE_RPCSVC_DBM_H */ + +/* Define to 1 if you have the <rpcsvc/ypclnt.h> header file. */ +#define HAVE_RPCSVC_YPCLNT_H 1 + +/* Define to 1 if the system has the type `sa_family_t'. */ #define HAVE_SA_FAMILY_T 1 -/* Define if you have the sendmsg function. */ +/* Define if you have the function `sendmsg'. */ #define HAVE_SENDMSG 1 -/* Define if you have the set_progname function. */ -/* #undef HAVE_SET_PROGNAME */ +/* Define to 1 if you have the `setattrlist' function. */ +/* #undef HAVE_SETATTRLIST */ -/* Define if you have the setegid function. */ +/* Define if you have the function `setegid'. */ #define HAVE_SETEGID 1 -/* Define if you have the setenv function. */ +/* Define if you have the function `setenv'. */ #define HAVE_SETENV 1 -/* Define if you have the seteuid function. */ +/* Define if you have the function `seteuid'. */ #define HAVE_SETEUID 1 -/* Define if you have the setlogin function. */ +/* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 -/* Define if you have the setregid function. */ -#define HAVE_SETREGID 1 +/* Define to 1 if you have the `setprogname' function. */ +/* #undef HAVE_SETPROGNAME */ -/* Define if you have the setresuid function. */ -/* #undef HAVE_SETRESUID */ +/* Define to 1 if you have the `setsockopt' function. */ +#define HAVE_SETSOCKOPT 1 -/* Define if you have the setreuid function. */ -#define HAVE_SETREUID 1 +/* Define to 1 if you have the `setstate' function. */ +#define HAVE_SETSTATE 1 -/* Define if you have the setsid function. */ -#define HAVE_SETSID 1 +/* Define to 1 if you have the <shadow.h> header file. */ +/* #undef HAVE_SHADOW_H */ -/* Define if you have the setsockopt function. */ -#define HAVE_SETSOCKOPT 1 +/* define if ubc_lookup takes six arguments */ +/* #undef HAVE_SIX_ARGUMENT_UBC_LOOKUP */ -/* Define if you have the socket function. */ +/* define if you have a working snprintf */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 -/* Define if you have the socklen_t function. */ +/* Define to 1 if the system has the type `socklen_t'. */ #define HAVE_SOCKLEN_T 1 -/* Define if you have the ssize_t function. */ +/* Define to 1 if you have the `ssize_t' function. */ #define HAVE_SSIZE_T 1 -/* Define if you have the strcasecmp function. */ +/* Define to 1 if you have the <standards.h> header file. */ +/* #undef HAVE_STANDARDS_H */ + +/* Define to 1 if you have the `statvfs' function. */ +/* #undef HAVE_STATVFS */ + +/* Define to 1 if you have the <stdint.h> header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* We always have <stds.h>, needed by rxkad */ +#define HAVE_STDS_H 1 + +/* Define if you have the function `strcasecmp'. */ #define HAVE_STRCASECMP 1 -/* Define if you have the strdup function. */ +/* Define if you have the function `strdup'. */ #define HAVE_STRDUP 1 -/* Define if you have the strerror function. */ +/* Define if you have the function `strerror'. */ #define HAVE_STRERROR 1 -/* Define if you have the strftime function. */ +/* Define if you have the function `strftime'. */ #define HAVE_STRFTIME 1 -/* Define if you have the strlcat function. */ +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the function `strlcat'. */ #define HAVE_STRLCAT 1 -/* Define if you have the strlcpy function. */ +/* Define if you have the function `strlcpy'. */ #define HAVE_STRLCPY 1 -/* Define if you have the strlwr function. */ +/* Define if you have the function `strlwr'. */ /* #undef HAVE_STRLWR */ -/* Define if you have the strnlen function. */ +/* Define if you have the function `strncasecmp'. */ +#define HAVE_STRNCASECMP 1 + +/* Define if you have the function `strndup'. */ +/* #undef HAVE_STRNDUP */ + +/* Define if you have the function `strnlen'. */ /* #undef HAVE_STRNLEN */ -/* Define if you have the strptime function. */ +/* Define if you have the function `strptime'. */ #define HAVE_STRPTIME 1 -/* Define if you have the strsep function. */ +/* Define if you have the function `strsep'. */ #define HAVE_STRSEP 1 -/* Define if you have the strsep_copy function. */ +/* Define if you have the function `strsep_copy'. */ /* #undef HAVE_STRSEP_COPY */ -/* Define if you have the strtok_r function. */ +/* Define to 1 if you have the `strsvis' function. */ +/* #undef HAVE_STRSVIS */ + +/* Define if you have the function `strtok_r'. */ #define HAVE_STRTOK_R 1 -/* Define if you have the struct_addrinfo function. */ -#define HAVE_STRUCT_ADDRINFO 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 -/* Define if you have the struct_sockaddr function. */ -#define HAVE_STRUCT_SOCKADDR 1 +/* Define to 1 if you have the `strtoq' function. */ +#define HAVE_STRTOQ 1 -/* Define if you have the struct_sockaddr_storage function. */ -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +/* Define to 1 if the system has the type `struct addrinfo'. */ +#define HAVE_STRUCT_ADDRINFO 1 -/* Define if you have the strupr function. */ -/* #undef HAVE_STRUPR */ +/* Define if struct cdevsw has field d_bmaj */ +/* #undef HAVE_STRUCT_CDEVSW_D_BMAJ */ -/* Define if you have the sysconf function. */ -#define HAVE_SYSCONF 1 +/* Define if struct cdevsw has field d_bogoparms */ +/* #undef HAVE_STRUCT_CDEVSW_D_BOGOPARMS */ -/* Define if you have the sysctl function. */ -#define HAVE_SYSCTL 1 +/* Define if struct cdevsw has field d_bogoreset */ +/* #undef HAVE_STRUCT_CDEVSW_D_BOGORESET */ -/* Define if you have the syslog function. */ -#define HAVE_SYSLOG 1 +/* Define if struct cdevsw has field d_devtotty */ +/* #undef HAVE_STRUCT_CDEVSW_D_DEVTOTTY */ -/* Define if you have the tf_init function. */ -#define HAVE_TF_INIT 1 +/* Define if struct cdevsw has field d_kqfilter */ +/* #undef HAVE_STRUCT_CDEVSW_D_KQFILTER */ -/* Define if you have the tgetent function. */ -#define HAVE_TGETENT 1 +/* Define if struct cdevsw has field d_maxio */ +/* #undef HAVE_STRUCT_CDEVSW_D_MAXIO */ -/* Define if you have the thr_yield function. */ -/* #undef HAVE_THR_YIELD */ +/* Define if struct cdevsw has field d_psize */ +/* #undef HAVE_STRUCT_CDEVSW_D_PSIZE */ -/* Define if you have the u_int16 function. */ -/* #undef HAVE_U_INT16 */ +/* Define if struct cdevsw has field d_reset */ +/* #undef HAVE_STRUCT_CDEVSW_D_RESET */ -/* Define if you have the u_int16_t function. */ -#define HAVE_U_INT16_T 1 +/* Define if struct cdevsw has field d_spare */ +/* #undef HAVE_STRUCT_CDEVSW_D_SPARE */ -/* Define if you have the u_int32 function. */ -/* #undef HAVE_U_INT32 */ +/* Define if struct cdevsw has field d_stop */ +/* #undef HAVE_STRUCT_CDEVSW_D_STOP */ -/* Define if you have the u_int32_t function. */ -#define HAVE_U_INT32_T 1 +/* Define if struct componentname has field cn_hash */ +#define HAVE_STRUCT_COMPONENTNAME_CN_HASH 1 -/* Define if you have the u_int64_t function. */ -#define HAVE_U_INT64_T 1 +/* Define if struct dirent has field d_type. */ +#define HAVE_STRUCT_DIRENT_D_TYPE 1 -/* Define if you have the u_int8_t function. */ -#define HAVE_U_INT8_T 1 +/* Define to 1 if the system has the type `struct ifaddrs'. */ +#define HAVE_STRUCT_IFADDRS 1 -/* Define if you have the unsetenv function. */ -#define HAVE_UNSETENV 1 +/* Define if struct inode_operations has field default_file_ops */ +/* #undef HAVE_STRUCT_INODE_OPERATIONS_DEFAULT_FILE_OPS */ -/* Define if you have the vasnprintf function. */ -/* #undef HAVE_VASNPRINTF */ +/* Define to 1 if the system has the type `struct iovec'. */ +#define HAVE_STRUCT_IOVEC 1 -/* Define if you have the vasprintf function. */ -#define HAVE_VASPRINTF 1 +/* Define if struct mount has field mnt_syncer */ +#define HAVE_STRUCT_MOUNT_MNT_SYNCER 1 -/* Define if you have the verr function. */ -#define HAVE_VERR 1 +/* Define if struct mount has field m_info */ +/* #undef HAVE_STRUCT_MOUNT_M_INFO */ -/* Define if you have the verrx function. */ -#define HAVE_VERRX 1 +/* Define to 1 if the system has the type `struct msghdr'. */ +#define HAVE_STRUCT_MSGHDR 1 -/* Define if you have the vsnprintf function. */ -#define HAVE_VSNPRINTF 1 +/* Define if struct proc has field p_sigctx. */ +/* #undef HAVE_STRUCT_PROC_P_SIGCTX */ -/* Define if you have the vsyslog function. */ -#define HAVE_VSYSLOG 1 +/* Define if struct proc has field p_sigmask. */ +#define HAVE_STRUCT_PROC_P_SIGMASK 1 -/* Define if you have the vwarn function. */ -#define HAVE_VWARN 1 +/* Define to 1 if the system has the type `struct sockaddr'. */ +#define HAVE_STRUCT_SOCKADDR 1 -/* Define if you have the vwarnx function. */ -#define HAVE_VWARNX 1 +/* Define if struct sockaddr_in has field sin_len. */ +#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 -/* Define if you have the warn function. */ -#define HAVE_WARN 1 +/* Define if struct sockaddr has field sa_len. */ +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 -/* Define if you have the warnerr function. */ -/* #undef HAVE_WARNERR */ +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 -/* Define if you have the warnx function. */ -#define HAVE_WARNX 1 +/* define if you have struct spwd */ +/* #undef HAVE_STRUCT_SPWD */ -/* Define if you have the writev function. */ -#define HAVE_WRITEV 1 +/* Define if struct super_operations has field notify_change */ +/* #undef HAVE_STRUCT_SUPER_OPERATIONS_NOTIFY_CHANGE */ -/* Define if you have the <arpa/inet.h> header file. */ -#define HAVE_ARPA_INET_H 1 +/* Define if struct sysent has field sy_flags */ +/* #undef HAVE_STRUCT_SYSENT_SY_FLAGS */ -/* Define if you have the <arpa/nameser.h> header file. */ -#define HAVE_ARPA_NAMESER_H 1 +/* Define if struct sysent has field sy_info */ +/* #undef HAVE_STRUCT_SYSENT_SY_INFO */ -/* Define if you have the <com_err.h> header file. */ -#define HAVE_COM_ERR_H 1 +/* Define if struct task_struct has field pending */ +/* #undef HAVE_STRUCT_TASK_STRUCT_PENDING */ -/* Define if you have the <crypt.h> header file. */ -/* #undef HAVE_CRYPT_H */ +/* Define if struct tm has field tm_gmtoff. */ +#define HAVE_STRUCT_TM_TM_GMTOFF 1 -/* Define if you have the <dbm.h> header file. */ -#define HAVE_DBM_H 1 +/* Define if struct tm has field tm_zone. */ +#define HAVE_STRUCT_TM_TM_ZONE 1 -/* Define if you have the <dirent.h> header file. */ -#define HAVE_DIRENT_H 1 +/* Define if struct uio has field uio_procp */ +#define HAVE_STRUCT_UIO_UIO_PROCP 1 -/* Define if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 +/* Define if struct vfsconf has field vfc_mountroot */ +/* #undef HAVE_STRUCT_VFSCONF_VFC_MOUNTROOT */ -/* Define if you have the <et/com_err.h> header file. */ -/* #undef HAVE_ET_COM_ERR_H */ +/* Define if struct vfsconf has field vfc_refcount */ +#define HAVE_STRUCT_VFSCONF_VFC_REFCOUNT 1 -/* Define if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H 1 +/* Define if struct vfsops has field vfs_checkexp */ +#define HAVE_STRUCT_VFSOPS_VFS_CHECKEXP 1 -/* Define if you have the <grp.h> header file. */ -#define HAVE_GRP_H 1 +/* Define if struct vfsops has field vfs_done */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_DONE */ -/* Define if you have the <inttypes.h> header file. */ -#define HAVE_INTTYPES_H 1 +/* Define if struct vfsops has field vfs_freevfs */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_FREEVFS */ -/* Define if you have the <ktypes.h> header file. */ -/* #undef HAVE_KTYPES_H */ +/* Define if struct vfsops has field vfs_mount */ +#define HAVE_STRUCT_VFSOPS_VFS_MOUNT 1 -/* Define if you have the <kvm.h> header file. */ -#define HAVE_KVM_H 1 +/* Define if struct vfsops has field vfs_mountroot */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_MOUNTROOT */ -/* Define if you have the <libelf/nlist.h> header file. */ -/* #undef HAVE_LIBELF_NLIST_H */ +/* Define if struct vfsops has field vfs_name */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_NAME */ -/* Define if you have the <linux/devfs_fs.h> header file. */ -/* #undef HAVE_LINUX_DEVFS_FS_H */ +/* Define if struct vfsops has field vfs_oid */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_OID */ -/* Define if you have the <linux/devfs_fs_kernel.h> header file. */ -/* #undef HAVE_LINUX_DEVFS_FS_KERNEL_H */ +/* Define if struct vfsops has field vfs_opv_descs */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_OPV_DESCS */ -/* Define if you have the <linux/stddef.h> header file. */ -/* #undef HAVE_LINUX_STDDEF_H */ +/* Define if struct vfsops has field vfs_reinit */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_REINIT */ -/* Define if you have the <machine/alpha/asm.h> header file. */ -/* #undef HAVE_MACHINE_ALPHA_ASM_H */ +/* Define if struct vfsops has field vfs_smoothsync */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_SMOOTHSYNC */ -/* Define if you have the <machine/asm.h> header file. */ -#define HAVE_MACHINE_ASM_H 1 +/* Define if struct vfsops has field vfs_swapvp */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_SWAPVP */ -/* Define if you have the <machine/endian.h> header file. */ -#define HAVE_MACHINE_ENDIAN_H 1 +/* Define if struct vfsops has field vfs_uninit */ +/* #undef HAVE_STRUCT_VFSOPS_VFS_UNINIT */ -/* Define if you have the <machine/regdef.h> header file. */ -/* #undef HAVE_MACHINE_REGDEF_H */ +/* Define if struct ViceIoctl has field in */ +/* #undef HAVE_STRUCT_VICEIOCTL_IN */ -/* Define if you have the <miscfs/genfs/genfs.h> header file. */ -/* #undef HAVE_MISCFS_GENFS_GENFS_H */ +/* Define if struct vop_fsync_args has field a_flags */ +/* #undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS */ -/* Define if you have the <ndbm.h> header file. */ -#define HAVE_NDBM_H 1 +/* Define if struct vop_getpages_args has field a_offset */ +/* #undef HAVE_STRUCT_VOP_GETPAGES_ARGS_A_OFFSET */ -/* Define if you have the <netdb.h> header file. */ -#define HAVE_NETDB_H 1 +/* Define if struct vop_putpages_args has field a_sync */ +/* #undef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC */ -/* Define if you have the <netinet/in.h> header file. */ -#define HAVE_NETINET_IN_H 1 +/* define if struct winsize is declared in sys/termios.h */ +#define HAVE_STRUCT_WINSIZE 1 -/* Define if you have the <netinet/in6.h> header file. */ -/* #undef HAVE_NETINET_IN6_H */ +/* Define to 1 if you have the `strunvis' function. */ +#define HAVE_STRUNVIS 1 -/* Define if you have the <netinet/in6_machtypes.h> header file. */ -/* #undef HAVE_NETINET_IN6_MACHTYPES_H */ +/* Define if you have the function `strupr'. */ +/* #undef HAVE_STRUPR */ -/* Define if you have the <netinet6/in6.h> header file. */ -/* #undef HAVE_NETINET6_IN6_H */ +/* Define to 1 if you have the `strvis' function. */ +#define HAVE_STRVIS 1 -/* Define if you have the <nlist.h> header file. */ -#define HAVE_NLIST_H 1 +/* Define to 1 if you have the `strvisx' function. */ +#define HAVE_STRVISX 1 -/* Define if you have the <paths.h> header file. */ -#define HAVE_PATHS_H 1 +/* Define to 1 if you have the `svis' function. */ +/* #undef HAVE_SVIS */ -/* Define if you have the <pwd.h> header file. */ -#define HAVE_PWD_H 1 +/* Define if you have the function `swab'. */ +#define HAVE_SWAB 1 -/* Define if you have the <regdef.h> header file. */ -/* #undef HAVE_REGDEF_H */ +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 -/* Define if you have the <resolv.h> header file. */ -#define HAVE_RESOLV_H 1 +/* Define to 1 if you have the `sysctl' function. */ +#define HAVE_SYSCTL 1 -/* Define if you have the <rpcsvc/dbm.h> header file. */ -/* #undef HAVE_RPCSVC_DBM_H */ +/* Define to 1 if you have the `syslog' function. */ +#define HAVE_SYSLOG 1 -/* Define if you have the <shadow.h> header file. */ -/* #undef HAVE_SHADOW_H */ +/* Define to 1 if you have the <syslog.h> header file. */ +#define HAVE_SYSLOG_H 1 -/* Define if you have the <sys/attr.h> header file. */ +/* Define to 1 if you have the <sys/attr.h> header file. */ /* #undef HAVE_SYS_ATTR_H */ -/* Define if you have the <sys/bitypes.h> header file. */ +/* Define to 1 if you have the <sys/bitypes.h> header file. */ /* #undef HAVE_SYS_BITYPES_H */ -/* Define if you have the <sys/cdefs.h> header file. */ +/* Define to 1 if you have the <sys/bswap.h> header file. */ +/* #undef HAVE_SYS_BSWAP_H */ + +/* Define to 1 if you have the <sys/cdefs.h> header file. */ #define HAVE_SYS_CDEFS_H 1 -/* Define if you have the <sys/dir.h> header file. */ +/* Define to 1 if you have the <sys/dir.h> header file. */ #define HAVE_SYS_DIR_H 1 -/* Define if you have the <sys/filedesc.h> header file. */ -#define HAVE_SYS_FILEDESC_H 1 +/* Define to 1 if you have the <sys/file.h> header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the <sys/inttypes.h> header file. */ +/* #undef HAVE_SYS_INTTYPES_H */ -/* Define if you have the <sys/ioccom.h> header file. */ +/* Define to 1 if you have the <sys/ioccom.h> header file. */ #define HAVE_SYS_IOCCOM_H 1 -/* Define if you have the <sys/ioctl.h> header file. */ +/* Define to 1 if you have the <sys/ioctl.h> header file. */ #define HAVE_SYS_IOCTL_H 1 -/* Define if you have the <sys/libkern.h> header file. */ +/* Define to 1 if you have the <sys/libkern.h> header file. */ /* #undef HAVE_SYS_LIBKERN_H */ -/* Define if you have the <sys/lkm.h> header file. */ +/* Define to 1 if you have the <sys/lkm.h> header file. */ #define HAVE_SYS_LKM_H 1 -/* Define if you have the <sys/mman.h> header file. */ +/* Define to 1 if you have the <sys/lock.h> header file. */ +#define HAVE_SYS_LOCK_H 1 + +/* Define to 1 if you have the <sys/mkdev.h> header file. */ +/* #undef HAVE_SYS_MKDEV_H */ + +/* Define to 1 if you have the <sys/mman.h> header file. */ #define HAVE_SYS_MMAN_H 1 -/* Define if you have the <sys/module.h> header file. */ +/* Define to 1 if you have the <sys/module.h> header file. */ /* #undef HAVE_SYS_MODULE_H */ -/* Define if you have the <sys/mount.h> header file. */ +/* Define to 1 if you have the <sys/mount.h> header file. */ #define HAVE_SYS_MOUNT_H 1 -/* Define if you have the <sys/param.h> header file. */ +/* Define to 1 if you have the <sys/mutex.h> header file. */ +/* #undef HAVE_SYS_MUTEX_H */ + +/* Define to 1 if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 -/* Define if you have the <sys/poll.h> header file. */ +/* Define to 1 if you have the <sys/poll.h> header file. */ #define HAVE_SYS_POLL_H 1 -/* Define if you have the <sys/prctl.h> header file. */ +/* Define to 1 if you have the <sys/prctl.h> header file. */ /* #undef HAVE_SYS_PRCTL_H */ -/* Define if you have the <sys/proc.h> header file. */ +/* Define to 1 if you have the <sys/proc.h> header file. */ #define HAVE_SYS_PROC_H 1 -/* Define if you have the <sys/queue.h> header file. */ +/* Define to 1 if you have the <sys/queue.h> header file. */ #define HAVE_SYS_QUEUE_H 1 -/* Define if you have the <sys/resource.h> header file. */ +/* Define to 1 if you have the <sys/resource.h> header file. */ #define HAVE_SYS_RESOURCE_H 1 -/* Define if you have the <sys/select.h> header file. */ +/* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 -/* Define if you have the <sys/signalvar.h> header file. */ +/* Define to 1 if you have the <sys/selinfo.h> header file. */ +/* #undef HAVE_SYS_SELINFO_H */ + +/* Define to 1 if you have the <sys/signalvar.h> header file. */ #define HAVE_SYS_SIGNALVAR_H 1 -/* Define if you have the <sys/socket.h> header file. */ +/* Define to 1 if you have the <sys/socket.h> header file. */ #define HAVE_SYS_SOCKET_H 1 -/* Define if you have the <sys/sockio.h> header file. */ +/* Define to 1 if you have the <sys/sockio.h> header file. */ #define HAVE_SYS_SOCKIO_H 1 -/* Define if you have the <sys/stat.h> header file. */ +/* Define to 1 if you have the <sys/statfs.h> header file. */ +/* #undef HAVE_SYS_STATFS_H */ + +/* Define to 1 if you have the <sys/statvfs.h> header file. */ +/* #undef HAVE_SYS_STATVFS_H */ + +/* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 -/* Define if you have the <sys/syscallargs.h> header file. */ +/* Define to 1 if you have the <sys/syscallargs.h> header file. */ #define HAVE_SYS_SYSCALLARGS_H 1 -/* Define if you have the <sys/sysconfig.h> header file. */ -/* #undef HAVE_SYS_SYSCONFIG_H */ - -/* Define if you have the <sys/sysctl.h> header file. */ +/* Define to 1 if you have the <sys/sysctl.h> header file. */ #define HAVE_SYS_SYSCTL_H 1 -/* Define if you have the <sys/sysent.h> header file. */ +/* Define to 1 if you have the <sys/sysent.h> header file. */ /* #undef HAVE_SYS_SYSENT_H */ -/* Define if you have the <sys/sysproto.h> header file. */ +/* Define to 1 if you have the <sys/sysproto.h> header file. */ /* #undef HAVE_SYS_SYSPROTO_H */ -/* Define if you have the <sys/systm.h> header file. */ +/* Define to 1 if you have the <sys/systm.h> header file. */ /* #undef HAVE_SYS_SYSTM_H */ -/* Define if you have the <sys/time.h> header file. */ +/* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 -/* Define if you have the <sys/tty.h> header file. */ +/* Define to 1 if you have the <sys/tty.h> header file. */ #define HAVE_SYS_TTY_H 1 -/* Define if you have the <sys/types.h> header file. */ +/* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define if you have the <sys/ubc.h> header file. */ +/* Define to 1 if you have the <sys/ubc.h> header file. */ /* #undef HAVE_SYS_UBC_H */ -/* Define if you have the <sys/uio.h> header file. */ +/* Define to 1 if you have the <sys/uio.h> header file. */ #define HAVE_SYS_UIO_H 1 -/* Define if you have the <sys/user.h> header file. */ +/* Define to 1 if you have the <sys/user.h> header file. */ #define HAVE_SYS_USER_H 1 -/* Define if you have the <sys/utsname.h> header file. */ +/* Define to 1 if you have the <sys/utsname.h> header file. */ #define HAVE_SYS_UTSNAME_H 1 -/* Define if you have the <sys/vfs.h> header file. */ +/* Define to 1 if you have the <sys/vfs.h> header file. */ /* #undef HAVE_SYS_VFS_H */ -/* Define if you have the <sys/vfs_proto.h> header file. */ +/* Define to 1 if you have the <sys/vfs_proto.h> header file. */ /* #undef HAVE_SYS_VFS_PROTO_H */ -/* Define if you have the <sys/vnode.h> header file. */ +/* Define to 1 if you have the <sys/vnode.h> header file. */ #define HAVE_SYS_VNODE_H 1 -/* Define if you have the <sys/wait.h> header file. */ +/* Define to 1 if you have the <sys/wait.h> header file. */ #define HAVE_SYS_WAIT_H 1 -/* Define if you have the <syslog.h> header file. */ -#define HAVE_SYSLOG_H 1 - -/* Define if you have the <termios.h> header file. */ +/* Define to 1 if you have the <termios.h> header file. */ #define HAVE_TERMIOS_H 1 -/* Define if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the <uvm/uvm_extern.h> header file. */ -#define HAVE_UVM_UVM_EXTERN_H 1 +/* Define to 1 if you have the `tf_init' function. */ +/* #undef HAVE_TF_INIT */ -/* Define if you have the <vm/vm.h> header file. */ -/* #undef HAVE_VM_VM_H */ - -/* Define if you have the <vm/vm_extern.h> header file. */ -/* #undef HAVE_VM_VM_EXTERN_H */ +/* Define to 1 if you have the `tgetent' function. */ +#define HAVE_TGETENT 1 -/* Define if you have the <vm/vm_object.h> header file. */ -/* #undef HAVE_VM_VM_OBJECT_H */ +/* define if selrecord takes three arguments */ +/* #undef HAVE_THREE_ARGUMENT_SELRECORD */ -/* Define if you have the <vm/vm_pager.h> header file. */ -/* #undef HAVE_VM_VM_PAGER_H */ +/* define if vfs_busy takes three arguments */ +/* #undef HAVE_THREE_ARGUMENT_VFS_BUSY */ -/* Define if you have the <vm/vm_zone.h> header file. */ -/* #undef HAVE_VM_VM_ZONE_H */ +/* define if vfs_name_hash takes three arguments */ +/* #undef HAVE_THREE_ARGUMENT_VFS_NAME_HASH */ -/* Define if you have the <vm/vnode_pager.h> header file. */ -/* #undef HAVE_VM_VNODE_PAGER_H */ +/* define if vget takes three arguments */ +#define HAVE_THREE_ARGUMENT_VGET 1 -/* Define if you have the curses library (-lcurses). */ -/* #undef HAVE_LIBCURSES */ +/* define if VOP_LOCK takes three arguments */ +#define HAVE_THREE_ARGUMENT_VOP_LOCK 1 -/* Define if you have the edit library (-ledit). */ -/* #undef HAVE_LIBEDIT */ +/* Define to 1 if you have the `thr_yield' function. */ +/* #undef HAVE_THR_YIELD */ -/* Define if you have the editline library (-leditline). */ -/* #undef HAVE_LIBEDITLINE */ +/* Define if you have the `timezone' variable. */ +#define HAVE_TIMEZONE 1 -/* Define if you have the inet6 library (-linet6). */ -/* #undef HAVE_LIBINET6 */ +/* define if your system declares timezone */ +#define HAVE_TIMEZONE_DECLARATION 1 -/* Define if you have the ip6 library (-lip6). */ -/* #undef HAVE_LIBIP6 */ +/* define if lockstatus takes two arguments */ +/* #undef HAVE_TWO_ARGUMENT_LOCKSTATUS */ -/* Define if you have the kvm library (-lkvm). */ -#define HAVE_LIBKVM 1 +/* define if suser takes two arguments */ +#define HAVE_TWO_ARGUMENT_SUSER 1 -/* Define if you have the ncurses library (-lncurses). */ -/* #undef HAVE_LIBNCURSES */ +/* define if vfs_getnewfsid takes two arguments */ +/* #undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */ -/* Define if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ +/* define if vget takes two arguments */ +/* #undef HAVE_TWO_ARGUMENT_VGET */ -/* Define if you have the pthread library (-lpthread). */ -/* #undef HAVE_LIBPTHREAD */ +/* define if VOP_LOCK takes two arguments */ +/* #undef HAVE_TWO_ARGUMENT_VOP_LOCK */ -/* Define if you have the readline library (-lreadline). */ -#define HAVE_LIBREADLINE 1 +/* Define to 1 if you have the `uint16_t' function. */ +#define HAVE_UINT16_T 1 -/* Define if you have the resolv library (-lresolv). */ -/* #undef HAVE_LIBRESOLV */ +/* Define to 1 if you have the `uint32_t' function. */ +#define HAVE_UINT32_T 1 -/* Define if you have the socket library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ +/* Define to 1 if you have the `uint64_t' function. */ +#define HAVE_UINT64_T 1 -/* Define if you have the syslog library (-lsyslog). */ -/* #undef HAVE_LIBSYSLOG */ +/* Define to 1 if you have the `uint8_t' function. */ +#define HAVE_UINT8_T 1 -/* Define if you have the termcap library (-ltermcap). */ -#define HAVE_LIBTERMCAP 1 +/* Define to 1 if you have the `uintptr_t' function. */ +/* #undef HAVE_UINTPTR_T */ -/* what package is this? */ -#define PACKAGE "arla" +/* Define to 1 if you have the `uname' function. */ +#define HAVE_UNAME 1 -/* and what version? */ -#define VERSION "0.35.7" +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 -/* how should ntohl be done? */ -#define EFF_NTOHL ntohl +/* Define if you have the function `unsetenv'. */ +#define HAVE_UNSETENV 1 -/* define if you need 32 bit compat pioctl */ -/* #undef NEED_VICEIOCTL32 */ +/* Define to 1 if you have the `unvis' function. */ +#define HAVE_UNVIS 1 -/* define this if on Irix6.4 or higher */ -/* #undef IRIX_64 */ +/* Define to 1 if you have the <userconf.h> header file. */ +/* #undef HAVE_USERCONF_H */ -/* define if you need 32 bit compat pioctl */ -/* #undef NEED_VICEIOCTL32 */ +/* Define to 1 if you have the <usersec.h> header file. */ +/* #undef HAVE_USERSEC_H */ -/* define if you have kerberos 4 compat */ -/* #undef HAVE_KRB5_COMPAT_KRB4 */ +/* Define to 1 if you have the <util.h> header file. */ +#define HAVE_UTIL_H 1 -/* define if you have kerberos 5 */ -#define HAVE_KRB5 1 +/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */ +#define HAVE_UVM_UVM_EXTERN_H 1 -/* define if you have kerberos */ -#define KERBEROS 1 +/* Define to 1 if you have the `u_int16' function. */ +/* #undef HAVE_U_INT16 */ -/* define if you have kerberos */ -#define KERBEROS 1 +/* Define to 1 if you have the `u_int16_t' function. */ +#define HAVE_U_INT16_T 1 -/* define if you have kerberos 4 */ -#define HAVE_KRB4 1 +/* Define to 1 if you have the `u_int32' function. */ +/* #undef HAVE_U_INT32 */ -/* define if you have struct msghdr */ -#define HAVE_STRUCT_MSGHDR 1 +/* Define to 1 if you have the `u_int32_t' function. */ +#define HAVE_U_INT32_T 1 -/* define if you have struct iovec */ -#define HAVE_STRUCT_IOVEC 1 +/* Define to 1 if you have the `u_int64_t' function. */ +#define HAVE_U_INT64_T 1 -/* define if you have a struct krb_principal */ -#define HAVE_KRB_PRINCIPAL 1 +/* Define to 1 if you have the `u_int8_t' function. */ +#define HAVE_U_INT8_T 1 -/* define if you have krb_get_err_text */ -#define HAVE_KRB_GET_ERR_TEXT 1 +/* Define to 1 if you have the `vasnprintf' function. */ +/* #undef HAVE_VASNPRINTF */ -/* define if you have krb_get_default_tkt_root */ -#define HAVE_KRB_GET_DEFAULT_TKT_ROOT 1 +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 -/* define if you have krb_get_default_principal */ -#define HAVE_KRB_GET_DEFAULT_PRINCIPAL 1 +/* Define if you have the function `verr'. */ +#define HAVE_VERR 1 -/* define if you have krb_kdctimeofday */ -#define HAVE_KRB_KDCTIMEOFDAY 1 +/* Define if you have the function `verrx'. */ +#define HAVE_VERRX 1 -/* Define if you have the readline package. */ -/* #undef READLINE */ +/* Define to 1 if you have the `vis' function. */ +#define HAVE_VIS 1 -/* define if you have a function readline */ -#define HAVE_READLINE 1 +/* Define to 1 if you have the <vis.h> header file. */ +#define HAVE_VIS_H 1 -/* define if you want to use mmaptime */ -/* #undef USE_MMAPTIME */ +/* Define to 1 if you have the <vm/uma.h> header file. */ +/* #undef HAVE_VM_UMA_H */ -/* define if you have a glibc-based system */ -/* #undef HAVE_GLIBC */ +/* Define to 1 if you have the <vm/vm_extern.h> header file. */ +/* #undef HAVE_VM_VM_EXTERN_H */ -/* define if target is big endian */ -/* #undef WORDS_BIGENDIAN */ +/* Define to 1 if you have the <vm/vm.h> header file. */ +/* #undef HAVE_VM_VM_H */ -/* define if sys/param.h defines the endiness */ -#define ENDIANESS_IN_SYS_PARAM_H 1 +/* Define to 1 if you have the <vm/vm_object.h> header file. */ +/* #undef HAVE_VM_VM_OBJECT_H */ -/* define if your compiler has __FUNCTION__ */ -#define HAVE___FUNCTION__ 1 +/* Define to 1 if you have the <vm/vm_pager.h> header file. */ +/* #undef HAVE_VM_VM_PAGER_H */ -/* define if your compiler has __attribute__ */ -#define HAVE___ATTRIBUTE__ 1 +/* Define to 1 if you have the <vm/vm_zone.h> header file. */ +/* #undef HAVE_VM_VM_ZONE_H */ -/* Define if NDBM really is DB (creates files ending in .db). */ -#define HAVE_NEW_DB 1 +/* Define to 1 if you have the <vm/vnode_pager.h> header file. */ +/* #undef HAVE_VM_VNODE_PAGER_H */ -/* Define if you have NDBM (and not DBM) */ -#define NDBM 1 +/* define if you have a vop_t */ +/* #undef HAVE_VOP_T */ -/* define if struct winsize is declared in sys/termios.h */ -#define HAVE_STRUCT_WINSIZE 1 +/* define if you have a working vsnprintf */ +#define HAVE_VSNPRINTF 1 -/* define if struct winsize has ws_xpixel */ -#define HAVE_WS_XPIXEL 1 +/* Define if you have the function `vsyslog'. */ +#define HAVE_VSYSLOG 1 -/* define if struct winsize has ws_ypixel */ -#define HAVE_WS_YPIXEL 1 +/* Define if you have the function `vwarn'. */ +#define HAVE_VWARN 1 -/* Define if you have IPv6. */ -#define HAVE_IPV6 1 +/* Define if you have the function `vwarnx'. */ +#define HAVE_VWARNX 1 -/* define if you have a working snprintf */ -#define HAVE_SNPRINTF 1 +/* define if you have a wait_queue_head_t */ +/* #undef HAVE_WAIT_QUEUE_HEAD_T */ -/* define if the system is missing a prototype for snprintf() */ -/* #undef NEED_SNPRINTF_PROTO */ +/* define if you have a wait_queue_task_list */ +/* #undef HAVE_WAIT_QUEUE_TASK_LIST */ -/* define if you have sigaction */ -#define HAVE_POSIX_SIGNALS 1 +/* Define if you have the function `warn'. */ +#define HAVE_WARN 1 -/* Define if getlogin has POSIX flavour (and not BSD). */ -/* #undef POSIX_GETLOGIN */ +/* Define if you have the function `warnx'. */ +#define HAVE_WARNX 1 -/* define if the system is missing a prototype for hstrerror() */ -/* #undef NEED_HSTRERROR_PROTO */ +/* Define to 1 if you have the <winsock.h> header file. */ +/* #undef HAVE_WINSOCK_H */ -/* define if hstrerror is const */ -#define NEED_HSTRERROR_CONST 1 +/* Define if you have the function `writev'. */ +#define HAVE_WRITEV 1 -/* define if the system is missing a prototype for inet_aton() */ -/* #undef NEED_INET_ATON_PROTO */ +/* define if struct winsize has ws_xpixel */ +#define HAVE_WS_XPIXEL 1 -/* define if you have optreset */ -#define HAVE_OPTRESET 1 +/* define if struct winsize has ws_ypixel */ +#define HAVE_WS_YPIXEL 1 -/* define if your system declares optreset */ -#define HAVE_OPTRESET_DECLARATION 1 +/* Define if you have the `_res' variable. */ +#define HAVE__RES 1 -/* define if your system declares optreset */ -#define HAVE_OPTRESET_DECLARATION 1 +/* define if your system declares _res */ +#define HAVE__RES_DECLARATION 1 -/* define if the system is missing a prototype for strtok_r() */ -/* #undef NEED_STRTOK_R_PROTO */ +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 -/* define if the system is missing a prototype for select() */ -/* #undef NEED_SELECT_PROTO */ +/* define if your compiler has __FUNCTION__ */ +#define HAVE___FUNCTION__ 1 -/* define if you can include both dirent.h and sys/dir.h */ -#define DIRENT_AND_SYS_DIR_H 1 +/* Define if you have the `__progname' variable. */ +#define HAVE___PROGNAME 1 -/* Define if struct dirent has field d_type. */ -#define HAVE_STRUCT_DIRENT_D_TYPE 1 +/* define if your system declares __progname */ +/* #undef HAVE___PROGNAME_DECLARATION */ -/* Define if struct sockaddr has field sa_len. */ -#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +/* define this if on Irix6.4 or higher */ +/* #undef IRIX_64 */ -/* Define if struct sockaddr_in has field sin_len. */ -#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 +/* define if you have kerberos */ +#define KERBEROS 1 -/* define if you have h_errno */ -#define HAVE_H_ERRNO 1 +/* define if the system is missing a prototype for asnprintf() */ +#define NEED_ASNPRINTF_PROTO 1 -/* define if your system declares h_errno */ -#define HAVE_H_ERRNO_DECLARATION 1 +/* define if the system is missing a prototype for asprintf() */ +/* #undef NEED_ASPRINTF_PROTO */ -/* define if you have h_errlist */ -#define HAVE_H_ERRLIST 1 +/* define if the system is missing a prototype for crypt() */ +/* #undef NEED_CRYPT_PROTO */ -/* define if your system declares h_errlist */ -/* #undef HAVE_H_ERRLIST_DECLARATION */ +/* define if the system is missing a prototype for gethostname() */ +/* #undef NEED_GETHOSTNAME_PROTO */ -/* define if you have h_nerr */ -#define HAVE_H_NERR 1 +/* define if the system is missing a prototype for getusershell() */ +/* #undef NEED_GETUSERSHELL_PROTO */ -/* define if your system declares h_nerr */ -/* #undef HAVE_H_NERR_DECLARATION */ +/* define if the system is missing a prototype for glob() */ +/* #undef NEED_GLOB_PROTO */ -/* define this if your as understands .register */ -/* #undef AS_UNDERSTANDS_REGISTER */ +/* define if the system is missing a prototype for hstrerror() */ +/* #undef NEED_HSTRERROR_PROTO */ -/* define if the system is missing a prototype for vgonel() */ -/* #undef NEED_VGONEL_PROTO */ +/* define if the system is missing a prototype for inet_aton() */ +/* #undef NEED_INET_ATON_PROTO */ /* define if the system is missing a prototype for issignal() */ /* #undef NEED_ISSIGNAL_PROTO */ -/* define if the system is missing a prototype for vn_writechk() */ -/* #undef NEED_VN_WRITECHK_PROTO */ - -/* define if the system is missing a prototype for ubc_pushdirty() */ -#define NEED_UBC_PUSHDIRTY_PROTO 1 - -/* define if the system is missing a prototype for strncmp() */ -#define NEED_STRNCMP_PROTO 1 +/* define if the system is missing a prototype for mkstemp() */ +/* #undef NEED_MKSTEMP_PROTO */ -/* define if you have a vop_t */ -/* #undef HAVE_VOP_T */ - -/* if vfs_object_create takes four arguments */ -/* #undef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE */ - -/* define if VOP_LOCK takes one argument */ -/* #undef HAVE_ONE_ARGUMENT_VOP_LOCK */ - -/* define if VOP_LOCK takes two arguments */ -/* #undef HAVE_TWO_ARGUMENT_VOP_LOCK */ - -/* define if VOP_LOCK takes three arguments */ -#define HAVE_THREE_ARGUMENT_VOP_LOCK 1 - -/* define if vfs_busy takes three arguments */ -/* #undef HAVE_THREE_ARGUMENT_VFS_BUSY */ - -/* define if vfs_busy takes four arguments */ -#define HAVE_FOUR_ARGUMENT_VFS_BUSY 1 - -/* define if vget takes one argument */ -/* #undef HAVE_ONE_ARGUMENT_VGET */ - -/* define if vget takes two arguments */ -/* #undef HAVE_TWO_ARGUMENT_VGET */ - -/* define if vget takes three arguments */ -#define HAVE_THREE_ARGUMENT_VGET 1 - -/* define if suser takes two arguments */ -#define HAVE_TWO_ARGUMENT_SUSER 1 - -/* define if vfs_getnewfsid takes two arguments */ -/* #undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */ - -/* define if lockmgr takes four arguments */ -#define HAVE_FOUR_ARGUMENT_LOCKMGR 1 - -/* define if lockstatus takes two arguments */ -/* #undef HAVE_TWO_ARGUMENT_LOCKSTATUS */ - -/* define if lockstatus takes one argument */ -#define HAVE_ONE_ARGUMENT_LOCKSTATUS 1 - -/* define if selrecord takes three arguments */ -/* #undef HAVE_THREE_ARGUMENT_SELRECORD */ - -/* define if ubc_lookup takes six arguments */ -/* #undef HAVE_SIX_ARGUMENT_UBC_LOOKUP */ - -/* define if vfs_name_hash takes four arguments */ -/* #undef HAVE_FOUR_ARGUMENT_VFS_NAME_HASH */ - -/* define if vfs_name_hash takes three arguments */ -/* #undef HAVE_THREE_ARGUMENT_VFS_NAME_HASH */ - -/* define if DIRSIZ is defined in dirent.h */ -/* #undef DIRSIZ_IN_DIRENT_H */ - -/* define if DIRSIZ is defined in sys/dir.h */ -#define DIRSIZ_IN_SYS_DIR_H 1 - -/* define if DIRSIZ is defined in sys/dirent.h */ -/* #undef GENERIC_DIRSIZ_IN_SYS_DIRENT_H */ - -/* Define if struct proc has field p_sigmask. */ -#define HAVE_STRUCT_PROC_P_SIGMASK 1 - -/* Define if struct proc has field p_sigctx. */ -/* #undef HAVE_STRUCT_PROC_P_SIGCTX */ - -/* Define if struct mount has field mnt_syncer */ -#define HAVE_STRUCT_MOUNT_MNT_SYNCER 1 - -/* Define if struct mount has field mnt_nvnodelist */ -/* #undef HAVE_STRUCT_MOUNT_MNT_NVNODELIST */ - -/* Define if struct mount has field m_info */ -/* #undef HAVE_STRUCT_MOUNT_M_INFO */ - -/* Define if struct vfsconf has field vfc_refcount */ -#define HAVE_STRUCT_VFSCONF_VFC_REFCOUNT 1 +/* define if the system is missing a prototype for select() */ +/* #undef NEED_SELECT_PROTO */ -/* Define if struct vfsconf has field vfc_mountroot */ -/* #undef HAVE_STRUCT_VFSCONF_VFC_MOUNTROOT */ +/* define if the system is missing a prototype for setenv() */ +/* #undef NEED_SETENV_PROTO */ -/* Define if struct uio has field uio_procp */ -#define HAVE_STRUCT_UIO_UIO_PROCP 1 - -/* Define if struct vfsops has field vfs_opv_descs */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_OPV_DESCS */ +/* libsl need sl_apropos */ +/* #undef NEED_SLCOMPAT_SL_APROPOS */ -/* Define if struct vfsops has field vfs_name */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_NAME */ - -/* Define if struct vfsops has field vfs_uninit */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_UNINIT */ - -/* Define if struct vfsops has field vfs_reinit */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_REINIT */ +/* define if the system is missing a prototype for snprintf() */ +/* #undef NEED_SNPRINTF_PROTO */ -/* Define if struct vfsops has field vfs_oid */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_OID */ +/* define if the system is missing a prototype for strncmp() */ +#define NEED_STRNCMP_PROTO 1 -/* Define if struct vfsops has field vfs_done */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_DONE */ +/* define if the system is missing a prototype for strndup() */ +#define NEED_STRNDUP_PROTO 1 -/* Define if struct vfsops has field vfs_checkexp */ -#define HAVE_STRUCT_VFSOPS_VFS_CHECKEXP 1 +/* define if the system is missing a prototype for strsep() */ +/* #undef NEED_STRSEP_PROTO */ -/* Define if struct vfsops has field vfs_mountroot */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_MOUNTROOT */ +/* define if the system is missing a prototype for strsvis() */ +/* #undef NEED_STRSVIS_PROTO */ -/* Define if struct vfsops has field vfs_swapvp */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_SWAPVP */ +/* define if the system is missing a prototype for strtok_r() */ +/* #undef NEED_STRTOK_R_PROTO */ -/* Define if struct vfsops has field vfs_smoothsync */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_SMOOTHSYNC */ +/* define if the system is missing a prototype for strunvis() */ +/* #undef NEED_STRUNVIS_PROTO */ -/* Define if struct sysent has field sy_flags */ -/* #undef HAVE_STRUCT_SYSENT_SY_FLAGS */ +/* define if the system is missing a prototype for strvisx() */ +/* #undef NEED_STRVISX_PROTO */ -/* Define if struct sysent has field sy_info */ -/* #undef HAVE_STRUCT_SYSENT_SY_INFO */ +/* define if the system is missing a prototype for strvis() */ +/* #undef NEED_STRVIS_PROTO */ -/* Define if struct vop_fsync_args has field a_flags */ -/* #undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS */ +/* define if the system is missing a prototype for svis() */ +/* #undef NEED_SVIS_PROTO */ -/* Define if struct vop_putpages_args has field a_sync */ -/* #undef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC */ +/* define if the system is missing a prototype for ubc_pushdirty() */ +#define NEED_UBC_PUSHDIRTY_PROTO 1 -/* Define if struct proc has field p_retval */ -/* #undef HAVE_STRUCT_PROC_P_RETVAL */ +/* define if the system is missing a prototype for unsetenv() */ +/* #undef NEED_UNSETENV_PROTO */ -/* Define if you have struct setgroups_args */ -/* #undef HAVE_DEF_STRUCT_SETGROUPS_ARGS */ +/* define if the system is missing a prototype for unvis() */ +/* #undef NEED_UNVIS_PROTO */ -/* Define if you have struct sys_setgroups_args */ -#define HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS 1 +/* define if the system is missing a prototype for vasnprintf() */ +#define NEED_VASNPRINTF_PROTO 1 -/* Define if struct cdevsw has field d_stop */ -/* #undef HAVE_STRUCT_CDEVSW_D_STOP */ +/* define if the system is missing a prototype for vasprintf() */ +/* #undef NEED_VASPRINTF_PROTO */ -/* Define if struct cdevsw has field d_reset */ -/* #undef HAVE_STRUCT_CDEVSW_D_RESET */ +/* define if the system is missing a prototype for vgonel() */ +/* #undef NEED_VGONEL_PROTO */ -/* Define if struct cdevsw has field d_bogoreset */ -/* #undef HAVE_STRUCT_CDEVSW_D_BOGORESET */ +/* define if you need 32 bit compat pioctl */ +/* #undef NEED_VICEIOCTL32 */ -/* Define if struct cdevsw has field d_devtotty */ -/* #undef HAVE_STRUCT_CDEVSW_D_DEVTOTTY */ +/* define if the system is missing a prototype for vis() */ +/* #undef NEED_VIS_PROTO */ -/* Define if struct cdevsw has field d_bogoparms */ -/* #undef HAVE_STRUCT_CDEVSW_D_BOGOPARMS */ +/* define if the system is missing a prototype for vn_writechk() */ +/* #undef NEED_VN_WRITECHK_PROTO */ -/* Define if struct cdevsw has field d_spare */ -/* #undef HAVE_STRUCT_CDEVSW_D_SPARE */ +/* define if the system is missing a prototype for vsnprintf() */ +/* #undef NEED_VSNPRINTF_PROTO */ -/* Define if struct cdevsw has field d_maxio */ -/* #undef HAVE_STRUCT_CDEVSW_D_MAXIO */ +/* define if prototype of openlog is compatible with void openlog(const char + *, int, int) */ +#define OPENLOG_PROTO_COMPATIBLE 1 -/* Define if struct cdevsw has field d_bmaj */ -/* #undef HAVE_STRUCT_CDEVSW_D_BMAJ */ +/* Name of package */ +#define PACKAGE "arla" -/* Define if struct componentname has field cn_hash */ -#define HAVE_STRUCT_COMPONENTNAME_CN_HASH 1 +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "arla-drinkers@stacken.kth.se" -/* define if we only can include uvm headers */ -/* #undef HAVE_KERNEL_UVM_ONLY */ +/* Define to the full name of this package. */ +#define PACKAGE_NAME "arla" -/* define if d_alloc_root takes two arguments */ -/* #undef HAVE_D_ALLOC_ROOT_TWO_ARGS */ +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "arla 0.36pre29" -/* define if devfs_register takes eleven arguments */ -/* #undef HAVE_DEVFS_REGISTER_ELEVEN_ARGS */ +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "arla" -/* Define if struct ViceIoctl has field in */ -/* #undef HAVE_STRUCT_VICEIOCTL_IN */ +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.36pre29" -/* Define if struct super_operations has field notify_change */ -/* #undef HAVE_STRUCT_SUPER_OPERATIONS_NOTIFY_CHANGE */ +/* Define if getlogin has POSIX flavour (and not BSD). */ +/* #undef POSIX_GETLOGIN */ -/* Define if struct inode_operations has field default_file_ops */ -/* #undef HAVE_STRUCT_INODE_OPERATIONS_DEFAULT_FILE_OPS */ +/* define this if your as understands .register */ +/* #undef PROG_AS_UNDERSTANDS_REGISTER */ -/* Define if struct inode_operations has field updatepage */ -/* #undef HAVE_STRUCT_INODE_OPERATIONS_UPDATEPAGE */ +/* Define if you have the readline package. */ +/* #undef READLINE */ -/* Define if struct inode_operations has field bmap */ -/* #undef HAVE_STRUCT_INODE_OPERATIONS_BMAP */ +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void -/* Define if struct inode_operations has field smap */ -/* #undef HAVE_STRUCT_INODE_OPERATIONS_SMAP */ +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 -/* define if you have a wait_queue_head_t */ -/* #undef HAVE_WAIT_QUEUE_HEAD_T */ +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#define TIME_WITH_SYS_TIME 1 -/* define if you have a wait_queue_task_list */ -/* #undef HAVE_WAIT_QUEUE_TASK_LIST */ +/* Version number of package */ +#define VERSION "0.36pre29" -/* define if you have a init_waitqueue_head */ -/* #undef HAVE_INIT_WAITQUEUE_HEAD */ +/* Define if signal handlers return void. */ +#define VOID_RETSIGTYPE 1 -/* define if you have a function init_MUTEX */ -/* #undef HAVE_INIT_MUTEX */ +/* define if target is big endian */ +/* #undef WORDS_BIGENDIAN */ -/* define if you have a function list_del_init */ -/* #undef HAVE_LIST_DEL_INIT */ +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ -/* define if filldir_t takes a dt_type argument */ -/* #undef HAVE_FILLDIR_T_DT_TYPE */ +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 -/* define if you have a function dget_locked */ -/* #undef HAVE_DGET_LOCKED */ -/* Define if struct task_struct has field pending */ -/* #undef HAVE_STRUCT_TASK_STRUCT_PENDING */ +/* + * Defining this enables us to get the definition of `sigset_t' and + * other importatnt definitions on Solaris. + */ -/* define if d_delete in struct dentry_operations returns void */ -/* #undef HAVE_D_DELETE_VOID */ +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif -/* Define if struct vfsops has field vfs_freevfs */ -/* #undef HAVE_STRUCT_VFSOPS_VFS_FREEVFS */ -/* define? */ -/* #undef HAVE_REPAIRABLE_HTONL */ +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ +/* Define to `int' if <sys/types.h> doesn't define. */ +/* #undef gid_t */ -/* RCSID */ -#define RCSID(msg) \ -static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +/* #undef inline */ -/* Maximum values on all known systems */ -#define MaxHostNameLen (64+4) -#define MaxPathLen (1024+4) +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef pid_t */ -/* we always have stds.h */ -#define HAVE_STDS_H +/* Define to `unsigned' if <sys/types.h> does not define. */ +/* #undef size_t */ -/* - * Defintions that are ugly but needed to get all the symbols used - */ +/* Define to `int' if <sys/types.h> doesn't define. */ +/* #undef uid_t */ -/* - * Defining this enables lots of useful (and used) extensions on - * glibc-based systems such as Linux - */ -#define _GNU_SOURCE +#if !(defined(USING_ASM) || defined(_KERNEL) || defined(__KERNEL__) || defined(_LKM) || defined(KERNEL)) +#if ENDIANESS_IN_SYS_PARAM_H +# include <sys/types.h> +# include <sys/param.h> +# if BYTE_ORDER == BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif +#endif -/* - * Defining this enables us to get the definition of `sigset_t' and - * other importatnt definitions on Solaris. - */ -#ifndef __EXTENSIONS__ -#define __EXTENSIONS__ +#ifdef VOID_RETSIGTYPE +#define SIGRETURN(x) return +#else +#define SIGRETURN(x) return (RETSIGTYPE)(x) #endif -#ifndef HAVE___ATTRIBUTE__ -#define __attribute__(x) +#ifdef BROKEN_REALLOC +#define realloc(X, Y) isoc_realloc((X), (Y)) +#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y)) #endif diff --git a/sys/xfs/xfs_deb.c b/sys/xfs/xfs_deb.c index be655c777d5..8bedf932fda 100644 --- a/sys/xfs/xfs_deb.c +++ b/sys/xfs/xfs_deb.c @@ -34,7 +34,7 @@ #include <xfs/xfs_deb.h> #include <xfs/xfs_debug.h> -/* $Id: xfs_deb.c,v 1.5 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_deb.c,v 1.15 2002/09/07 10:45:03 lha Exp $ */ /* X is on */ #define X(y) y diff --git a/sys/xfs/xfs_deb.h b/sys/xfs/xfs_deb.h index 5c37a157929..cf237084fc4 100644 --- a/sys/xfs/xfs_deb.h +++ b/sys/xfs/xfs_deb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_deb.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_deb.h,v 1.11 2002/09/07 10:45:59 lha Exp $ */ #ifndef _xfs_deb_h #define _xfs_deb_h @@ -51,10 +51,10 @@ extern unsigned int xfsdeb; -#ifdef XFS_DEBUG -#define XFSDEB(mask, args) do { if (mask&xfsdeb) printf args; } while (0) +#ifdef NNPFS_DEBUG +#define NNPFSDEB(mask, args) do { if (mask&xfsdeb) printf args; } while (0) #else -#define XFSDEB(mask, args) do { ; } while (0) +#define NNPFSDEB(mask, args) do { ; } while (0) #endif #endif /* _xfs_deb_h */ diff --git a/sys/xfs/xfs_debug.h b/sys/xfs/xfs_debug.h index d96d4c80d5a..fda2d9eb502 100644 --- a/sys/xfs/xfs_debug.h +++ b/sys/xfs/xfs_debug.h @@ -31,10 +31,10 @@ * SUCH DAMAGE. */ -/* $Id: xfs_debug.h,v 1.4 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_debug.h,v 1.5 2002/09/14 09:56:01 tol Exp $ */ -#ifndef __XFS_DEBUG_H -#define __XFS_DEBUG_H +#ifndef __NNPFS_DEBUG_H +#define __NNPFS_DEBUG_H /* * These are GLOBAL xfs debugging masks @@ -56,5 +56,6 @@ #define XDEBREADDIR 0x00000200 /* readdir (linux) */ #define XDEBLOCK 0x00000400 /* locking (linux) */ #define XDEBCACHE 0x00000800 /* Cache handeling (linux) */ +#define XDEBREF 0x00001000 /* track reference count */ #endif diff --git a/sys/xfs/xfs_dev-bsd.c b/sys/xfs/xfs_dev-bsd.c index a310d119a71..c56d13610d9 100644 --- a/sys/xfs/xfs_dev-bsd.c +++ b/sys/xfs/xfs_dev-bsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -38,24 +38,24 @@ #include <xfs/xfs_dev.h> #include <xfs/xfs_deb.h> -RCSID("$Id: xfs_dev-bsd.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_dev-bsd.c,v 1.35 2003/04/01 14:04:11 lha Exp $"); int -xfs_devopen(dev_t dev, int flag, int devtype, struct proc *proc) +xfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc) { - XFSDEB(XDEBDEV, ("xfsopen dev = %d.%d, flag = %d, devtype = %d\n", + NNPFSDEB(XDEBDEV, ("xfsopen dev = %d.%d, flag = %d, devtype = %d\n", major(dev), minor(dev), flag, devtype)); - return xfs_devopen_common(dev, proc); + return xfs_devopen_common(dev); } int -xfs_devclose(dev_t dev, int flag, int devtype, struct proc *p) +xfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *p) { -#ifdef XFS_DEBUG +#ifdef NNPFS_DEBUG char devname[64]; #endif - XFSDEB(XDEBDEV, ("xfs_devclose dev = %s, flag = 0x%x\n", + NNPFSDEB(XDEBDEV, ("xfs_devclose dev = %s, flag = 0x%x\n", xfs_devtoname_r(dev, devname, sizeof(devname)), flag)); return xfs_devclose_common(dev, p); @@ -70,9 +70,9 @@ xfs_devioctl(dev_t dev, u_long cmd, caddr_t data, int flags, - struct proc *p) + d_thread_t *p) { - XFSDEB(XDEBDEV, ("xfs_devioctl dev = %d.%d, cmd = %lu, " + NNPFSDEB(XDEBDEV, ("xfs_devioctl dev = %d.%d, cmd = %lu, " "data = %lx, flags = %x\n", major(dev), minor(dev), (unsigned long)cmd, (unsigned long)data, flags)); @@ -80,7 +80,7 @@ xfs_devioctl(dev_t dev, } static int -xfs_realselect(dev_t dev, struct proc *p, void *wql) +xfs_realselect(dev_t dev, d_thread_t *p, void *wql) { struct xfs_channel *chan = &xfs_channel[minor(dev)]; @@ -98,11 +98,13 @@ xfs_realselect(dev_t dev, struct proc *p, void *wql) #ifdef HAVE_VOP_POLL static int -xfs_devpoll(dev_t dev, int events, struct proc * p) +xfs_devpoll(dev_t dev, int events, d_thread_t * p) { +#ifdef NNPFS_DEBUG char devname[64]; +#endif - XFSDEB(XDEBDEV, ("xfs_devpoll dev = %s, events = 0x%x\n", + NNPFSDEB(XDEBDEV, ("xfs_devpoll dev = %s, events = 0x%x\n", xfs_devtoname_r (dev, devname, sizeof(devname)), events)); @@ -119,7 +121,7 @@ xfs_devpoll(dev_t dev, int events, struct proc * p) int xfs_devselect(dev_t dev, int which, void *wql, struct proc * p) { - XFSDEB(XDEBDEV, ("xfs_devselect dev = %d, which = %d\n", dev, which)); + NNPFSDEB(XDEBDEV, ("xfs_devselect dev = %d, which = %d\n", dev, which)); if (which != FREAD) return 0; @@ -128,9 +130,9 @@ xfs_devselect(dev_t dev, int which, void *wql, struct proc * p) } #else int -xfs_devselect(dev_t dev, int which, struct proc * p) +xfs_devselect(dev_t dev, int which, d_thread_t * p) { - XFSDEB(XDEBDEV, ("xfs_devselect dev = %d, which = %d\n", dev, which)); + NNPFSDEB(XDEBDEV, ("xfs_devselect dev = %d, which = %d\n", dev, which)); if (which != FREAD) return 0; @@ -180,49 +182,53 @@ struct cdevsw xfs_dev = { #elif defined(__FreeBSD__) struct cdevsw xfs_dev = { - xfs_devopen, - xfs_devclose, - xfs_devread, - xfs_devwrite, - xfs_devioctl, + d_name: "xfs", + d_open: xfs_devopen, + d_close: xfs_devclose, + d_read: xfs_devread, + d_write: xfs_devwrite, + d_ioctl: xfs_devioctl, + d_mmap: nommap, + d_strategy: nostrategy, + d_flags: 0, #ifdef HAVE_STRUCT_CDEVSW_D_STOP - nostop, + d_stop: nostop, +#endif +#ifdef HAVE_STRUCT_CDEVSW_D_RESET + d_reset: noreset, #endif -#if defined(HAVE_STRUCT_CDEVSW_D_BOGORESET) \ - || defined(HAVE_STRUCT_CDEVSW_D_RESET) - noreset, +#ifdef HAVE_STRUCT_CDEVSW_D_BOGORESET + d_bogoreset: noreset, #endif #ifdef HAVE_STRUCT_CDEVSW_D_DEVTOTTY - nodevtotty, + d_devtotty: nodevtotty, #endif #if defined(HAVE_VOP_SELECT) - xfs_devselect, + d_select: xfs_devselect, #elif defined(HAVE_VOP_POLL) - xfs_devpoll, + d_poll: xfs_devpoll, #else #error select or poll: that is the question #endif - nommap, - nostrategy, - "xfs", #ifdef HAVE_STRUCT_CDEVSW_D_BOGOPARMS - noparms, /* d_bogoparms */ + d_bogoparms: noparms, #endif #ifdef HAVE_STRUCT_CDEVSW_D_SPARE - NULL, /* d_spare */ + d_spare: NULL, +#endif + d_maj: 128, /* XXX */ + d_dump: nodump, +#ifdef HAVE_STRUCT_CDEVSW_D_PSIZE + d_psize: nopsize, #endif - 128, /* XXX */ - nodump, - nopsize, - 0, /* flags */ #ifdef HAVE_STRUCT_CDEVSW_D_MAXIO - 0, /* maxio */ + d_maxio: 0, #endif #ifdef HAVE_STRUCT_CDEVSW_D_BMAJ #ifdef NOUDEV - NOUDEV /* bmaj */ + d_bmaj: NOUDEV #else - NODEV /* bmaj */ + d_bmaj: NODEV #endif #endif /* HAVE_STRUCT_CDEVSW_D_BMAJ */ }; @@ -250,7 +256,7 @@ static struct cdevsw xfs_dev = { extern int xfs_dev_major; #include <miscfs/devfs/devfs.h> -static void *devfs_handles[NXFS]; +static void *devfs_handles[NNNPFS]; #endif @@ -262,22 +268,22 @@ xfs_install_device(void) #if defined(__APPLE__) xfs_dev_major = cdevsw_add(-1, &xfs_dev); if (xfs_dev_major == -1) { - XFSDEB(XDEBDEV, ("failed installing cdev\n")); + NNPFSDEB(XDEBDEV, ("failed installing cdev\n")); return ENFILE; } - for (i = 0; i < NXFS; ++i) + for (i = 0; i < NNNPFS; ++i) devfs_handles[i] = devfs_make_node(makedev(xfs_dev_major, i), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0600, "xfs%d", i); - XFSDEB(XDEBDEV, ("done installing cdev !\n")); - XFSDEB(XDEBDEV, ("Char device number %d\n", xfs_dev_major)); + NNPFSDEB(XDEBDEV, ("done installing cdev !\n")); + NNPFSDEB(XDEBDEV, ("Char device number %d\n", xfs_dev_major)); #endif - for (i = 0; i < NXFS; i++) { - XFSDEB(XDEBDEV, ("before initq(messageq and sleepq)\n")); + for (i = 0; i < NNNPFS; i++) { + NNPFSDEB(XDEBDEV, ("before initq(messageq and sleepq)\n")); xfs_initq(&xfs_channel[i].messageq); xfs_initq(&xfs_channel[i].sleepq); xfs_channel[i].status = 0; @@ -292,27 +298,27 @@ xfs_uninstall_device(void) struct xfs_channel *chan; int ret = 0; - for (i = 0; i < NXFS; i++) { + for (i = 0; i < NNNPFS; i++) { chan = &xfs_channel[i]; if (chan->status & CHANNEL_OPENED) xfs_devclose(makedev(0, i), 0, 0, NULL); } #if defined(__APPLE__) - for (i = 0; i < NXFS; ++i) + for (i = 0; i < NNNPFS; ++i) devfs_remove (devfs_handles[i]); ret = cdevsw_remove(xfs_dev_major, &xfs_dev); if (ret == -1) { - XFSDEB(XDEBLKM, ("xfs_uninstall_device error %d\n", ret)); + NNPFSDEB(XDEBLKM, ("xfs_uninstall_device error %d\n", ret)); } else if (ret == xfs_dev_major) { ret = 0; } else { - XFSDEB(XDEBLKM, ("xfs_uninstall_device unexpected error error %d\n", + NNPFSDEB(XDEBLKM, ("xfs_uninstall_device unexpected error error %d\n", ret)); } #endif - XFSDEB(XDEBLKM, ("xfs_uninstall_device error %d\n", ret)); + NNPFSDEB(XDEBLKM, ("xfs_uninstall_device error %d\n", ret)); return ret; } @@ -328,6 +334,6 @@ xfs_is_xfs_dev(dev_t dev) { return major(dev) <= nchrdev && cdevsw[major(dev)].d_open == xfs_devopen && - minor(dev) >= 0 && minor(dev) < NXFS; + minor(dev) >= 0 && minor(dev) < NNNPFS; } #endif diff --git a/sys/xfs/xfs_dev-common.c b/sys/xfs/xfs_dev-common.c index d3894d3a19a..774596dd1d5 100644 --- a/sys/xfs/xfs_dev-common.c +++ b/sys/xfs/xfs_dev-common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -39,9 +39,9 @@ #include <xfs/xfs_dev.h> #include <xfs/xfs_deb.h> -RCSID("$Id: xfs_dev-common.c,v 1.5 2002/07/02 19:38:55 nate Exp $"); +RCSID("$arla: xfs_dev-common.c,v 1.61 2003/07/15 16:25:42 lha Exp $"); -struct xfs_channel xfs_channel[NXFS]; +struct xfs_channel xfs_channel[NNNPFS]; void xfs_initq(struct xfs_link *q) @@ -87,24 +87,24 @@ xfs_outq(struct xfs_link *p) * Only allow one open. */ int -xfs_devopen_common(dev_t dev, struct proc *p) +xfs_devopen_common(dev_t dev) { struct xfs_channel *chan; - if (minor(dev) < 0 || minor(dev) >= NXFS) + if (minor(dev) < 0 || minor(dev) >= NNNPFS) return ENXIO; chan = &xfs_channel[minor(dev)]; /* Only allow one reader/writer */ if (chan->status & CHANNEL_OPENED) { - XFSDEB(XDEBDEV, ("xfs_devopen: already open\n")); + NNPFSDEB(XDEBDEV, ("xfs_devopen: already open\n")); return EBUSY; } else { chan->status |= CHANNEL_OPENED; } - chan->message_buffer = xfs_alloc(MAX_XMSG_SIZE); + chan->message_buffer = xfs_alloc(MAX_XMSG_SIZE, M_NNPFS_MSG); /* initialize the queues if they have not been initialized before */ xfs_initq(&chan->sleepq); @@ -131,7 +131,7 @@ xfs_devopen_common(dev_t dev, struct proc *p) * Wakeup all sleepers and cleanup. */ int -xfs_devclose_common(dev_t dev, struct proc *proc) +xfs_devclose_common(dev_t dev, d_thread_t *proc) { struct xfs_channel *chan = &xfs_channel[minor(dev)]; struct xfs_link *first; @@ -144,31 +144,31 @@ xfs_devclose_common(dev_t dev, struct proc *proc) /* No one is going to read those messages so empty queue! */ while (!xfs_emptyq(&chan->messageq)) { - XFSDEB(XDEBDEV, ("before outq(messageq)\n")); + NNPFSDEB(XDEBDEV, ("before outq(messageq)\n")); first = chan->messageq.next; xfs_outq(first); if (first->error_or_size != 0) - xfs_free(first, first->error_or_size); + xfs_free(first, first->error_or_size, M_NNPFS_LINK); - XFSDEB(XDEBDEV, ("after outq(messageq)\n")); + NNPFSDEB(XDEBDEV, ("after outq(messageq)\n")); } /* Wakeup those waiting for replies that will never arrive. */ while (!xfs_emptyq(&chan->sleepq)) { - XFSDEB(XDEBDEV, ("before outq(sleepq)\n")); + NNPFSDEB(XDEBDEV, ("before outq(sleepq)\n")); first = chan->sleepq.next; xfs_outq(first); first->error_or_size = ENODEV; wakeup((caddr_t) first); - XFSDEB(XDEBDEV, ("after outq(sleepq)\n")); + NNPFSDEB(XDEBDEV, ("after outq(sleepq)\n")); } if (chan->status & CHANNEL_WAITING) wakeup((caddr_t) chan); if (chan->message_buffer) { - xfs_free(chan->message_buffer, MAX_XMSG_SIZE); + xfs_free(chan->message_buffer, MAX_XMSG_SIZE, M_NNPFS_MSG); chan->message_buffer = NULL; } @@ -178,7 +178,7 @@ xfs_devclose_common(dev_t dev, struct proc *proc) if (xfs[minor(dev)].mp != NULL) { if (xfs_vfs_busy(xfs[minor(dev)].mp, 0, NULL, proc)) { - XFSDEB(XDEBNODE, ("xfs_dev_close: vfs_busy() --> BUSY\n")); + NNPFSDEB(XDEBNODE, ("xfs_dev_close: vfs_busy() --> BUSY\n")); return EBUSY; } free_all_xfs_nodes(&xfs[minor(dev)], FORCECLOSE, 0); @@ -189,21 +189,32 @@ xfs_devclose_common(dev_t dev, struct proc *proc) return 0; } -#ifdef XFS_DEBUG +#ifdef NNPFS_DEBUG /* - * osf glue for CURSIG + * debugging glue for CURSIG */ static long -xfs_cursig (struct proc *p) +xfs_cursig (d_thread_t *p) { -#ifdef __osf__ +#if defined(__osf__) thread_t th = current_thread(); struct np_uthread *npu = thread_to_np_uthread(th); return CURSIG(p,npu); +#elif defined(HAVE_FREEBSD_THREAD) +#ifndef CURSIG + return 0; /* XXX we would like to use sig_ffs, but that isn't + * exported */ +#else + return CURSIG(p->td_proc); +#endif +#else +#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000 + return 0; /* XXX CURSIG operates on a struct lwp */ #else return CURSIG(p); #endif +#endif } #endif @@ -217,19 +228,23 @@ xfs_devread(dev_t dev, struct uio * uiop, int ioflag) struct xfs_channel *chan = &xfs_channel[minor(dev)]; struct xfs_link *first; int error = 0; -#ifdef XFS_DEBUG +#ifdef NNPFS_DEBUG char devname[64]; #endif - XFSDEB(XDEBDEV, ("xfs_devread dev = %s\n", + NNPFSDEB(XDEBDEV, ("xfs_devread dev = %s\n", xfs_devtoname_r(dev, devname, sizeof(devname)))); - XFSDEB(XDEBDEV, ("xfs_devread: m = %lx, m->prev = %lx, m->next = %lx\n", + NNPFSDEB(XDEBDEV, ("xfs_devread: m = %lx, m->prev = %lx, m->next = %lx\n", (unsigned long)&chan->messageq, (unsigned long)chan->messageq.prev, (unsigned long)chan->messageq.next)); +#ifdef HAVE_FREEBSD_THREAD + chan->proc = xfs_uio_to_thread(uiop); +#else chan->proc = xfs_uio_to_proc(uiop); +#endif again: @@ -237,13 +252,13 @@ xfs_devread(dev_t dev, struct uio * uiop, int ioflag) while (!xfs_emptyq (&chan->messageq)) { /* Remove message */ first = chan->messageq.next; - XFSDEB(XDEBDEV, ("xfs_devread: first = %lx, " + NNPFSDEB(XDEBDEV, ("xfs_devread: first = %lx, " "first->prev = %lx, first->next = %lx\n", (unsigned long)first, (unsigned long)first->prev, (unsigned long)first->next)); - XFSDEB(XDEBDEV, ("xfs_devread: message->size = %u\n", + NNPFSDEB(XDEBDEV, ("xfs_devread: message->size = %u\n", first->message->size)); if (first->message->size > uiop->uio_resid) @@ -257,14 +272,20 @@ xfs_devread(dev_t dev, struct uio * uiop, int ioflag) xfs_outq(first); if (first->error_or_size != 0) - xfs_free(first, first->error_or_size); + xfs_free(first, first->error_or_size, M_NNPFS_LINK); } } else { chan->status |= CHANNEL_WAITING; if (tsleep((caddr_t) chan, (PZERO + 1) | PCATCH, "xfsread", 0)) { - XFSDEB(XDEBMSG, +#ifdef HAVE_FREEBSD_THREAD + NNPFSDEB(XDEBMSG, + ("caught signal xfs_devread: %ld\n", + xfs_cursig(xfs_uio_to_thread(uiop)))); +#else + NNPFSDEB(XDEBMSG, ("caught signal xfs_devread: %ld\n", xfs_cursig(xfs_uio_to_proc(uiop)))); +#endif error = EINTR; } else if ((chan->status & CHANNEL_WAITING) == 0) { goto again; @@ -272,7 +293,7 @@ xfs_devread(dev_t dev, struct uio * uiop, int ioflag) error = EIO; } - XFSDEB(XDEBDEV, ("xfs_devread done error = %d\n", error)); + NNPFSDEB(XDEBDEV, ("xfs_devread done error = %d\n", error)); return error; } @@ -289,14 +310,18 @@ xfs_devwrite(dev_t dev, struct uio *uiop, int ioflag) int error; u_int cnt; struct xfs_message_header *msg_buf; -#ifdef XFS_DEBUG +#ifdef NNPFS_DEBUG char devname[64]; #endif - XFSDEB(XDEBDEV, ("xfs_devwrite dev = %s\n", + NNPFSDEB(XDEBDEV, ("xfs_devwrite dev = %s\n", xfs_devtoname_r (dev, devname, sizeof(devname)))); +#ifdef HAVE_FREEBSD_THREAD + chan->proc = xfs_uio_to_thread(uiop); +#else chan->proc = xfs_uio_to_proc(uiop); +#endif cnt = uiop->uio_resid; error = uiomove((caddr_t) chan->message_buffer, MAX_XMSG_SIZE, uiop); if (error != 0) @@ -310,7 +335,11 @@ xfs_devwrite(dev_t dev, struct uio *uiop, int ioflag) for (p = (char *)chan->message_buffer; cnt > 0; p += msg_buf->size, cnt -= msg_buf->size) { - struct proc *pp = xfs_uio_to_proc(uiop); +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *pp = xfs_uio_to_thread(uiop); +#else + d_thread_t *pp = xfs_uio_to_proc(uiop); +#endif msg_buf = (struct xfs_message_header *)p; error = xfs_message_receive (minor(dev), @@ -318,7 +347,7 @@ xfs_devwrite(dev_t dev, struct uio *uiop, int ioflag) msg_buf->size, pp); } - XFSDEB(XDEBDEV, ("xfs_devwrite error = %d\n", error)); + NNPFSDEB(XDEBDEV, ("xfs_devwrite error = %d\n", error)); return error; } @@ -334,7 +363,7 @@ xfs_message_send(int fd, struct xfs_message_header * message, u_int size) struct xfs_message_header msg; } *t; - XFSDEB(XDEBMSG, ("xfs_message_send opcode = %d\n", message->opcode)); + NNPFSDEB(XDEBMSG, ("xfs_message_send opcode = %d\n", message->opcode)); if (!(chan->status & CHANNEL_OPENED)) /* No receiver? */ return ENODEV; @@ -343,7 +372,7 @@ xfs_message_send(int fd, struct xfs_message_header * message, u_int size) message->size = size; message->sequence_num = chan->nsequence++; - t = xfs_alloc(sizeof(t->this_message) + size); + t = xfs_alloc(sizeof(t->this_message) + size, M_NNPFS); t->this_message.error_or_size = sizeof(t->this_message) + size; bcopy(message, &t->msg, size); @@ -359,30 +388,34 @@ xfs_message_send(int fd, struct xfs_message_header * message, u_int size) } #if defined(SWEXIT) -#define XFS_P_EXIT SWEXIT +#define NNPFS_P_EXIT SWEXIT #elif defined(P_WEXIT) -#define XFS_P_EXIT P_WEXIT +#define NNPFS_P_EXIT P_WEXIT #else #error what is your exit named ? #endif -#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) +#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) || defined(HAVE_STRUCT_PROC_P_SIGWAITMASK) || defined(__osf__) || defined(HAVE_FREEBSD_THREAD) static void xfs_block_sigset (sigset_t *sigset) { + #if defined(__sigaddset) - __sigaddset(sigset, SIGIO); - __sigaddset(sigset, SIGALRM); - __sigaddset(sigset, SIGVTALRM); +#define xfs_sig_block(ss,signo) __sigaddset((ss), (signo)) #elif defined(SIGADDSET) - SIGADDSET(*sigset, SIGIO); - SIGADDSET(*sigset, SIGALRM); - SIGADDSET(*sigset, SIGVTALRM); +#define xfs_sig_block(ss,signo) SIGADDSET(*(ss), (signo)) #else - *sigset |= sigmask(SIGIO); - *sigset |= sigmask(SIGALRM); - *sigset |= sigmask(SIGVTALRM); -#endif /* __sigaddset */ +#define xfs_sig_block(ss,signo) *(ss) |= sigmask(signo) +#endif + + xfs_sig_block(sigset, SIGIO); + xfs_sig_block(sigset, SIGALRM); + xfs_sig_block(sigset, SIGVTALRM); + xfs_sig_block(sigset, SIGCHLD); +#ifdef SIGINFO + xfs_sig_block(sigset, SIGINFO); +#endif +#undef xfs_sig_block } #endif @@ -392,29 +425,40 @@ xfs_block_sigset (sigset_t *sigset) int xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, - struct proc *proc) + d_thread_t *proc) { int ret; struct xfs_channel *chan = &xfs_channel[fd]; struct xfs_link *this_message; struct xfs_link *this_process; struct xfs_message_header *msg; -#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) || defined(__osf__) +#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) || defined(__osf__) || defined(HAVE_FREEBSD_THREAD) sigset_t oldsigmask; #endif int catch; - XFSDEB(XDEBMSG, ("xfs_message_rpc opcode = %d\n", message->opcode)); + NNPFSDEB(XDEBMSG, ("xfs_message_rpc opcode = %d\n", message->opcode)); - if (proc == NULL) + if (proc == NULL) { +#ifdef HAVE_FREEBSD_THREAD + proc = xfs_curthread(); +#else proc = xfs_curproc(); - +#endif + } if (!(chan->status & CHANNEL_OPENED)) /* No receiver? */ return ENODEV; +#ifdef HAVE_FREEBSD_THREAD + if (chan->proc != NULL && chan->proc->td_proc != NULL && + proc->td_proc->p_pid == chan->proc->td_proc->p_pid) { + printf("xfs_message_rpc: deadlock avoided " + "pid = %u == %u\n", proc->td_proc->p_pid, chan->proc->td_proc->p_pid); +#else if (chan->proc != NULL && proc->p_pid == chan->proc->p_pid) { printf("xfs_message_rpc: deadlock avoided " "pid = %u == %u\n", proc->p_pid, chan->proc->p_pid); +#endif #if 0 psignal (proc, SIGABRT); #endif @@ -422,12 +466,12 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, } if (size < sizeof(struct xfs_message_wakeup)) { - printf("XFS PANIC Error: Message to small to receive wakeup, opcode = %d\n", message->opcode); + printf("NNPFS PANIC Error: Message to small to receive wakeup, opcode = %d\n", message->opcode); return ENOMEM; } - this_message = xfs_alloc(sizeof(struct xfs_link)); - this_process = xfs_alloc(sizeof(struct xfs_link)); - msg = xfs_alloc(size); + this_message = xfs_alloc(sizeof(struct xfs_link), M_NNPFS_LINK); + this_process = xfs_alloc(sizeof(struct xfs_link), M_NNPFS_LINK); + msg = xfs_alloc(size, M_NNPFS_MSG); bcopy(message, msg, size); msg->size = size; @@ -446,11 +490,16 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, } /* - * Remove SIGIO from the sigmask so no IO will - * wake us up from tsleep() + * Remove signals from the sigmask so no IO will wake us up from + * tsleep(). We don't want to wake up from since program (emacs, + * bash & co can't handle them. */ -#ifdef HAVE_STRUCT_PROC_P_SIGMASK +#ifdef HAVE_FREEBSD_THREAD + /* FreeBSD 5.1 */ + oldsigmask = proc->td_sigmask; + xfs_block_sigset (&proc->td_sigmask); +#elif HAVE_STRUCT_PROC_P_SIGMASK /* NetBSD 1.5, Darwin 1.3, FreeBSD 4.3, 5.0, OpenBSD 2.8 */ oldsigmask = proc->p_sigmask; xfs_block_sigset (&proc->p_sigmask); @@ -461,14 +510,11 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, #elif defined(HAVE_STRUCT_PROC_P_SIGWAITMASK) /* OSF 4.0 */ oldsigmask = proc->p_sigwaitmask; - sigaddset(&proc->p_sigwaitmask, SIGIO); - sigaddset(&proc->p_sigwaitmask, SIGALRM); - sigaddset(&proc->p_sigwaitmask, SIGVTALRM); + xfs_block_sigset (&proc->p_sigwaitmask); #elif defined(__osf__) + /* OSF 5.0 */ oldsigmask = u.u_sigmask; - sigaddset(&u.u_sigmask, SIGIO); - sigaddset(&u.u_sigmask, SIGALRM); - sigaddset(&u.u_sigmask, SIGVTALRM); + xfs_block_sigset (&u.u_sigmask); #endif /* @@ -479,7 +525,11 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, */ catch = 0; - if (!(proc->p_flag & XFS_P_EXIT)) +#ifdef HAVE_FREEBSD_THREAD + if (!(proc->td_proc->p_flag & NNPFS_P_EXIT)) +#else + if (!(proc->p_flag & NNPFS_P_EXIT)) +#endif catch |= PCATCH; /* @@ -488,16 +538,18 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, * happen sometimes when rebooting. */ if (!(chan->status & CHANNEL_OPENED)) { - XFSDEB(XDEBMSG, ("xfs_message_rpc: channel went away\n")); + NNPFSDEB(XDEBMSG, ("xfs_message_rpc: channel went away\n")); this_process->error_or_size = EINTR; } else if ((ret = tsleep((caddr_t) this_process, (PZERO + 1) | catch, "xfs", 0)) != 0) { - XFSDEB(XDEBMSG, ("caught signal (%d): %ld\n", + NNPFSDEB(XDEBMSG, ("caught signal (%d): %ld\n", ret, xfs_cursig(proc))); this_process->error_or_size = EINTR; } -#ifdef HAVE_STRUCT_PROC_P_SIGMASK +#ifdef HAVE_FREEBSD_THREAD + proc->td_sigmask = oldsigmask; +#elif HAVE_STRUCT_PROC_P_SIGMASK proc->p_sigmask = oldsigmask; #elif defined(HAVE_STRUCT_PROC_P_SIGCTX) proc->p_sigctx.ps_sigmask = oldsigmask; @@ -519,15 +571,15 @@ xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, } ret = this_process->error_or_size; - XFSDEB(XDEBMSG, ("xfs_message_rpc this_process->error_or_size = %d\n", + NNPFSDEB(XDEBMSG, ("xfs_message_rpc this_process->error_or_size = %d\n", this_process->error_or_size)); - XFSDEB(XDEBMSG, ("xfs_message_rpc opcode ((xfs_message_wakeup*)(this_process->message))->error = %d\n", ((struct xfs_message_wakeup *) (this_process->message))->error)); + NNPFSDEB(XDEBMSG, ("xfs_message_rpc opcode ((xfs_message_wakeup*)(this_process->message))->error = %d\n", ((struct xfs_message_wakeup *) (this_process->message))->error)); bcopy(msg, message, size); - xfs_free(this_message, sizeof(*this_message)); - xfs_free(this_process, sizeof(*this_process)); - xfs_free(msg, size); + xfs_free(this_message, sizeof(*this_message), M_NNPFS_LINK); + xfs_free(this_process, sizeof(*this_process), M_NNPFS_LINK); + xfs_free(msg, size, M_NNPFS_MSG); return ret; } @@ -541,64 +593,64 @@ int xfs_message_receive(int fd, struct xfs_message_header *message, u_int size, - struct proc *p) + d_thread_t *p) { - XFSDEB(XDEBMSG, ("xfs_message_receive opcode = %d\n", message->opcode)); + NNPFSDEB(XDEBMSG, ("xfs_message_receive opcode = %d\n", message->opcode)); /* Dispatch and coerce message type */ switch (message->opcode) { - case XFS_MSG_WAKEUP: + case NNPFS_MSG_WAKEUP: return xfs_message_wakeup(fd, (struct xfs_message_wakeup *) message, message->size, p); - case XFS_MSG_WAKEUP_DATA: + case NNPFS_MSG_WAKEUP_DATA: return xfs_message_wakeup_data(fd, (struct xfs_message_wakeup_data *) message, message->size, p); - case XFS_MSG_INSTALLROOT: + case NNPFS_MSG_INSTALLROOT: return xfs_message_installroot(fd, (struct xfs_message_installroot *) message, message->size, p); - case XFS_MSG_INSTALLNODE: + case NNPFS_MSG_INSTALLNODE: return xfs_message_installnode(fd, (struct xfs_message_installnode *) message, message->size, p); - case XFS_MSG_INSTALLATTR: + case NNPFS_MSG_INSTALLATTR: return xfs_message_installattr(fd, (struct xfs_message_installattr *) message, message->size, p); - case XFS_MSG_INSTALLDATA: + case NNPFS_MSG_INSTALLDATA: return xfs_message_installdata(fd, (struct xfs_message_installdata *) message, message->size, p); - case XFS_MSG_INVALIDNODE: + case NNPFS_MSG_INVALIDNODE: return xfs_message_invalidnode(fd, (struct xfs_message_invalidnode *) message, message->size, p); - case XFS_MSG_UPDATEFID: + case NNPFS_MSG_UPDATEFID: return xfs_message_updatefid(fd, (struct xfs_message_updatefid *)message, message->size, p); - case XFS_MSG_GC_NODES: + case NNPFS_MSG_GC_NODES: return xfs_message_gc_nodes(fd, (struct xfs_message_gc_nodes *)message, message->size, p); - case XFS_MSG_VERSION: + case NNPFS_MSG_VERSION: return xfs_message_version(fd, (struct xfs_message_version *)message, message->size, p); default: - printf("XFS PANIC Warning xfs_dev: Unknown message opcode == %d\n", + printf("NNPFS PANIC Warning xfs_dev: Unknown message opcode == %d\n", message->opcode); return EINVAL; } @@ -608,18 +660,18 @@ int xfs_message_wakeup(int fd, struct xfs_message_wakeup *message, u_int size, - struct proc *p) + d_thread_t *p) { struct xfs_channel *chan = &xfs_channel[fd]; struct xfs_link *sleepq = &chan->sleepq; struct xfs_link *t = chan->sleepq.next; /* Really first in q */ - XFSDEB(XDEBMSG, ("xfs_message_wakeup error: %d\n", message->error)); + NNPFSDEB(XDEBMSG, ("xfs_message_wakeup error: %d\n", message->error)); for (; t != sleepq; t = t->next) if (t->message->sequence_num == message->sleepers_sequence_num) { if (t->message->size < size) { - printf("XFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode); + printf("NNPFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode); t->error_or_size = ENOMEM; } else bcopy(message, t->message, size); @@ -635,18 +687,18 @@ int xfs_message_wakeup_data(int fd, struct xfs_message_wakeup_data * message, u_int size, - struct proc *p) + d_thread_t *p) { struct xfs_channel *chan = &xfs_channel[fd]; struct xfs_link *sleepq = &chan->sleepq; struct xfs_link *t = chan->sleepq.next; /* Really first in q */ - XFSDEB(XDEBMSG, ("xfs_message_wakeup_data error: %d\n", message->error)); + NNPFSDEB(XDEBMSG, ("xfs_message_wakeup_data error: %d\n", message->error)); for (; t != sleepq; t = t->next) if (t->message->sequence_num == message->sleepers_sequence_num) { if (t->message->size < size) { - printf("XFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode); + printf("NNPFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode); t->error_or_size = ENOMEM; } else bcopy(message, t->message, size); @@ -665,7 +717,7 @@ xfs_uprintf_device(void) #if 0 int i; - for (i = 0; i < NXFS; i++) { + for (i = 0; i < NNNPFS; i++) { uprintf("xfs_channel[%d] = {\n", i); uprintf("messageq.next = %lx ", xfs_channel[i].messageq.next); uprintf("messageq.prev = %lx ", xfs_channel[i].messageq.prev); diff --git a/sys/xfs/xfs_dev.h b/sys/xfs/xfs_dev.h index 4531dfdb512..08cf5970c8d 100644 --- a/sys/xfs/xfs_dev.h +++ b/sys/xfs/xfs_dev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_dev.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_dev.h,v 1.19 2003/01/19 20:53:52 lha Exp $ */ #ifndef _xfs_dev_h #define _xfs_dev_h @@ -63,10 +63,10 @@ struct xfs_channel { int status; #define CHANNEL_OPENED 0x1 #define CHANNEL_WAITING 0x2 - struct proc *proc; + d_thread_t *proc; }; -extern struct xfs_channel xfs_channel[NXFS]; +extern struct xfs_channel xfs_channel[NNNPFS]; /* * These are variant dependent @@ -104,22 +104,22 @@ void xfs_outq(struct xfs_link *p); int -xfs_devopen_common(dev_t dev, struct proc *); +xfs_devopen_common(dev_t dev); #ifndef __osf__ /* XXX - we should do the same for osf */ -int xfs_devopen(dev_t dev, int flag, int devtype, struct proc *proc); -int xfs_devclose(dev_t dev, int flag, int devtype, struct proc *proc); +int xfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc); +int xfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *proc); int xfs_devioctl(dev_t dev, u_long cmd, caddr_t data, int flags, - struct proc *p); + d_thread_t *p); #ifdef HAVE_THREE_ARGUMENT_SELRECORD -int xfs_devselect(dev_t dev, int which, void *wql, struct proc *p); +int xfs_devselect(dev_t dev, int which, void *wql, d_thread_t *p); #else -int xfs_devselect(dev_t dev, int which, struct proc *p); +int xfs_devselect(dev_t dev, int which, d_thread_t *p); #endif #endif /* ! __osf__ */ int -xfs_devclose_common(dev_t dev, struct proc *p); +xfs_devclose_common(dev_t dev, d_thread_t *p); int xfs_devread(dev_t dev, struct uio * uiop, int ioflag); @@ -132,25 +132,25 @@ xfs_message_send(int fd, struct xfs_message_header * message, u_int size); int xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_receive(int fd, struct xfs_message_header *message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_wakeup(int fd, struct xfs_message_wakeup *message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_wakeup_data(int fd, struct xfs_message_wakeup_data * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_uprintf_device(void); diff --git a/sys/xfs/xfs_fs.h b/sys/xfs/xfs_fs.h index 6031048f79c..525fc077829 100644 --- a/sys/xfs/xfs_fs.h +++ b/sys/xfs/xfs_fs.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_fs.h,v 1.7 2003/07/24 22:00:24 mickey Exp $ */ +/* $arla: xfs_fs.h,v 1.22 2002/12/19 09:49:19 lha Exp $ */ #ifndef _xfs_h #define _xfs_h @@ -42,39 +42,42 @@ #include <xfs/xfs_node.h> #include <xfs/xfs_attr.h> -#include <xfs/nxfs.h> +#define NNNPFS 2 /* maximal number of filesystems on a single device */ /* * Filesystem struct. */ + struct xfs { u_int status; /* Inited, opened or mounted */ -#define XFS_MOUNTED 0x1 +#define NNPFS_MOUNTED 0x1 struct mount *mp; struct xfs_node *root; u_int nnodes; int fd; + struct xfs_nodelist_head nodehead; }; #ifdef __osf__ #ifdef HAVE_STRUCT_MOUNT_M_INFO -#define VFS_TO_XFS(v) ((struct xfs *) ((v)->m_info)) +#define VFS_TO_NNPFS(v) ((struct xfs *) ((v)->m_info)) #else -#define VFS_TO_XFS(v) ((struct xfs *) ((v)->m_data)) +#define VFS_TO_NNPFS(v) ((struct xfs *) ((v)->m_data)) #endif #else -#define VFS_TO_XFS(v) ((struct xfs *) ((v)->mnt_data)) +#define VFS_TO_NNPFS(v) ((struct xfs *) ((v)->mnt_data)) #endif -#define XFS_TO_VFS(x) ((x)->mp) +#define NNPFS_TO_VFS(x) ((x)->mp) -#define XFS_FROM_VNODE(vp) VFS_TO_XFS((vp)->v_mount) -#define XFS_FROM_XNODE(xp) XFS_FROM_VNODE(XNODE_TO_VNODE(xp)) +#define NNPFS_FROM_VNODE(vp) VFS_TO_NNPFS((vp)->v_mount) +#define NNPFS_FROM_XNODE(xp) NNPFS_FROM_VNODE(XNODE_TO_VNODE(xp)) extern struct xfs xfs[]; -struct xfs_node *xfs_node_find(struct xfs *, struct xfs_handle *); +extern struct vnodeops xfs_vnodeops; + int new_xfs_node(struct xfs *, struct xfs_msg_node *, struct xfs_node **, - struct proc *); + d_thread_t *); void free_xfs_node(struct xfs_node *); int free_all_xfs_nodes(struct xfs *, int, int); diff --git a/sys/xfs/xfs_global.h b/sys/xfs/xfs_global.h index b23c1d20f08..7280191b5f2 100644 --- a/sys/xfs/xfs_global.h +++ b/sys/xfs/xfs_global.h @@ -1,9 +1,9 @@ -#ifndef __XFS_GLOBAL_H -#define __XFS_GLOBAL_H +#ifndef __NNPFS_GLOBAL_H +#define __NNPFS_GLOBAL_H #ifndef RCSID #define RCSID(msg) \ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #endif /* RCSID */ -#endif /* __XFS_GLOBAL_H */ +#endif /* __NNPFS_GLOBAL_H */ diff --git a/sys/xfs/xfs_locl.h b/sys/xfs/xfs_locl.h index 80999053858..f973b9e668d 100644 --- a/sys/xfs/xfs_locl.h +++ b/sys/xfs/xfs_locl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,12 +31,10 @@ * SUCH DAMAGE. */ -/* $Id: xfs_locl.h,v 1.5 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_locl.h,v 1.72 2003/02/15 16:40:00 lha Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> -#else -#include <xfs/xfs_config.h> #endif #ifndef RCSID @@ -66,12 +64,12 @@ #include <vm/vm_ubc.h> typedef short int16_t; -typedef unsigned short u_int16_t; +typedef unsigned short uint16_t; typedef int int32_t; -typedef unsigned int u_int32_t; +typedef unsigned int uint32_t; #define VT_AFS VT_ADDON -#define MOUNT_XFS MOUNT_PC +#define MOUNT_NNPFS MOUNT_PC typedef struct nameidata xfs_componentname; @@ -125,9 +123,7 @@ typedef struct componentname xfs_componentname; #include <sys/types.h> #include <sys/param.h> -#if 0 -#include <sys/ioctl.h> -#endif +#include <sys/time.h> #include <sys/proc.h> #include <sys/filedesc.h> #include <sys/kernel.h> @@ -148,6 +144,13 @@ typedef struct componentname xfs_componentname; #ifdef HAVE_SYS_LKM_H #include <sys/lkm.h> #endif +#ifdef HAVE_SYS_LOCK_H +#include <sys/lock.h> +#endif +#ifdef HAVE_SYS_MUTEX_H +#include <sys/mutex.h> +#endif +#include <sys/vnode.h> #include <sys/errno.h> #include <sys/file.h> #include <sys/namei.h> @@ -161,6 +164,9 @@ typedef struct componentname xfs_componentname; #ifdef HAVE_SYS_SIGNALVAR_H #include <sys/signalvar.h> #endif +#ifdef HAVE_SYS_INTTYPES_H +#include <sys/inttypes.h> +#endif #include <sys/syscall.h> #include <sys/queue.h> #include <sys/malloc.h> @@ -174,6 +180,9 @@ typedef struct componentname xfs_componentname; #ifdef HAVE_MISCFS_GENFS_GENFS_H #include <miscfs/genfs/genfs.h> #endif +#ifdef HAVE_MISCFS_SYNCFS_SYNCFS_H +#include <miscfs/syncfs/syncfs.h> +#endif #ifndef HAVE_KERNEL_UVM_ONLY #ifdef HAVE_VM_VM_H #include <vm/vm.h> @@ -191,6 +200,9 @@ typedef struct componentname xfs_componentname; #ifdef HAVE_UVM_UVM_EXTERN_H #include <uvm/uvm_extern.h> #endif +#ifdef HAVE_VM_UMA_H +#include <vm/uma.h> +#endif #if defined(__APPLE__) #include <machine/machine_routines.h> @@ -202,34 +214,117 @@ void cache_enter(struct vnode *, struct vnode *, struct componentname *); void cache_purgevfs(struct mount *); #endif +#define xfs_vop_read(t, uio, ioflag, cred, error) (error) = VOP_READ((t), (uio), (ioflag), (cred)) +#define xfs_vop_write(t, uio, ioflag, cred, error) (error) = VOP_WRITE((t), (uio), (ioflag), (cred)) +#define xfs_vop_getattr(t, attr, cred, proc, error) (error) = VOP_GETATTR((t), (attr), (cred), (proc)) +#define xfs_vop_access(dvp, mode, cred, proc, error) (error) = VOP_ACCESS((dvp), (mode), (cred), (proc)) + +typedef u_quad_t va_size_t; + +#endif /* !__osf__ */ + +#ifdef __FreeBSD_version +#if __FreeBSD_version < 400000 +# error This version is unsupported +#elif __FreeBSD_version < 440001 || (__FreeBSD_version >= 500000 && __FreeBSD_version < 500023) +typedef struct proc d_thread_t; +#elif __FreeBSD_version == 500023 +# define HAVE_FREEBSD_THREAD +typedef struct thread d_thread_t; +#elif __FreeBSD_version >= 500024 +# define HAVE_FREEBSD_THREAD +#endif +typedef d_thread_t syscall_d_thread_t; +#define syscall_thread_to_thread(x) (x) +#else /* !__FreeBSD_version */ +#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000 +typedef struct lwp syscall_d_thread_t; +#define syscall_thread_to_thread(x) ((x)->l_proc) +#else +typedef struct proc syscall_d_thread_t; +#define syscall_thread_to_thread(x) (x) +#endif +typedef struct proc d_thread_t; +#endif /* !__FreeBSD_version */ + +#ifdef VV_ROOT +#define NNPFS_MAKE_VROOT(v) ((v)->v_vflag |= VV_ROOT) /* FreeBSD 5 */ +#else +#define NNPFS_MAKE_VROOT(v) ((v)->v_flag |= VROOT) +#endif + +#if defined(__NetBSD__) && __NetBSD_Version__ >= 105280000 +#include <miscfs/genfs/genfs.h> +#include <miscfs/genfs/genfs_node.h> + +struct genfs_ops xfs_genfsops; +#endif + + +#if defined(HAVE_FREEBSD_THREAD) +#define xfs_uio_to_thread(uiop) ((uiop)->uio_td) +#define xfs_cnp_to_thread(cnp) ((cnp)->cn_thread) +#define xfs_thread_to_cred(td) ((td)->td_proc->p_ucred) +#define xfs_thread_to_euid(td) ((td)->td_proc->p_ucred->cr_uid) +#else #define xfs_uio_to_proc(uiop) ((uiop)->uio_procp) #define xfs_cnp_to_proc(cnp) ((cnp)->cn_proc) #define xfs_proc_to_cred(p) ((p)->p_ucred) #define xfs_proc_to_euid(p) ((p)->p_ucred->cr_uid) +#endif + +#if defined(__FreeBSD_version) && __FreeBSD_version >= 500043 +extern const char *VT_AFS; +#endif + +#if defined(__FreeBSD__) +typedef void * xfs_malloc_type; +#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106140000 /* 1.6N */ +typedef struct malloc_type * xfs_malloc_type; +#else +typedef int xfs_malloc_type; +#endif #ifdef __APPLE__ #define xfs_curproc() (current_proc()) #else +#if defined(HAVE_FREEBSD_THREAD) +#define xfs_curthread() (curthread) +#else #define xfs_curproc() (curproc) #endif +#endif -#define xfs_vop_read(t, uio, ioflag, cred, error) (error) = VOP_READ((t), (uio), (ioflag), (cred)) -#define xfs_vop_write(t, uio, ioflag, cred, error) (error) = VOP_WRITE((t), (uio), (ioflag), (cred)) -#define xfs_vop_getattr(t, attr, cred, proc, error) (error) = VOP_GETATTR((t), (attr), (cred), (proc)) -#define xfs_vop_access(dvp, mode, cred, proc, error) (error) = VOP_ACCESS((dvp), (mode), (cred), (proc)) +#ifdef __osf__ +#define xfs_pushdirty(vp, cred, p) +#else +void xfs_pushdirty(struct vnode *, struct ucred *, d_thread_t *); +#endif -typedef u_quad_t va_size_t; -#endif /* !__osf__ */ +#if defined(HAVE_UINTPTR_T) /* c99 enviroment */ +#define xfs_uintptr_t uintptr_t +#else +#if defined(_LP64) || defined(alpha) || defined(__alpha__) || defined(__sparc64__) || defined(__sparcv9__) +#define xfs_uintptr_t unsigned long long +#else /* !LP64 */ +#define xfs_uintptr_t unsigned long +#endif /* LP64 */ +#endif /* * XXX */ #ifndef SCARG +#if defined(__FreeBSD_version) && __FreeBSD_version > 500042 +#define SCARG(a, b) ((a)->b) +#define syscallarg(x) x +#else #define SCARG(a, b) ((a)->b.datum) #define syscallarg(x) union { x datum; register_t pad; } -#endif +#endif /* __FreeBSD_version */ +#endif /* SCARG */ #ifndef syscallarg #define syscallarg(x) x @@ -239,6 +334,11 @@ typedef u_quad_t va_size_t; typedef int register_t; #endif +/* malloc(9) waits by default, freebsd post 5.0 choose to remove the flag */ +#ifndef M_WAITOK +#define M_WAITOK 0 +#endif + #if defined(HAVE_DEF_STRUCT_SETGROUPS_ARGS) #define xfs_setgroups_args setgroups_args #elif defined(HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS) @@ -270,7 +370,7 @@ struct xfs_setgroups_args{ #define xfs_vfs_object_create(vp,proc,ucred) vfs_object_create(vp,proc,ucred) #endif -#ifdef UVM +#if defined(UVM) || (defined(__NetBSD__) && __NetBSD_Version__ >= 105280000) #define xfs_set_vp_size(vp, sz) uvm_vnp_setsize(vp, sz) #elif HAVE_KERNEL_VNODE_PAGER_SETSIZE #define xfs_set_vp_size(vp, sz) vnode_pager_setsize(vp, sz) @@ -280,6 +380,33 @@ struct xfs_setgroups_args{ #define xfs_set_vp_size(vp, sz) #endif +/* namei flag */ +#ifdef LOCKLEAF +#define NNPFS_LOCKLEAF LOCKLEAF +#else +#define NNPFS_LOCKLEAF 0 +#endif + +#ifdef NEED_VGONEL_PROTO +void vgonel (struct vnode *vp, d_thread_t *p); +#endif + +#ifdef NEED_ISSIGNAL_PROTO +int issignal (d_thread_t *); +#endif + +#ifdef NEED_STRNCMP_PROTO +int strncmp (const char *, const char *, size_t); +#endif + +#ifdef NEED_VN_WRITECHK_PROTO +int vn_writechk (struct vnode *); +#endif + +#ifdef NEED_UBC_PUSHDIRTY_PROTO +int ubc_pushdirty (struct vnode *); +#endif + #include <xfs/xfs_syscalls.h> /* @@ -288,4 +415,8 @@ struct xfs_setgroups_args{ * What VOPs do we have today ? */ +#define NNPFS_VOP_DEF(n) \ + struct vop_##n##_args; \ + int xfs_##n(struct vop_##n##_args *); + #include "xfs/xfs_vopdefs.h" diff --git a/sys/xfs/xfs_message.c b/sys/xfs/xfs_message.c index cc4a349b13a..f8f9d05ab49 100644 --- a/sys/xfs/xfs_message.c +++ b/sys/xfs/xfs_message.c @@ -41,30 +41,42 @@ #include <xfs/xfs_vnodeops.h> #include <xfs/xfs_dev.h> -RCSID("$Id: xfs_message.c,v 1.8 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_message.c,v 1.84 2003/06/02 18:25:20 lha Exp $"); + +static void +send_inactive_node(int fd, xfs_handle *handle) +{ + struct xfs_message_inactivenode msg; + + msg.header.opcode = NNPFS_MSG_INACTIVENODE; + msg.handle = *handle; + msg.flag = NNPFS_NOREFS | NNPFS_DELETE; + xfs_message_send(fd, &msg.header, sizeof(msg)); +} + int xfs_message_installroot(int fd, struct xfs_message_installroot * message, u_int size, - struct proc *p) + d_thread_t *p) { int error = 0; - XFSDEB(XDEBMSG, ("xfs_message_installroot (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBMSG, ("xfs_message_installroot (%d,%d,%d,%d)\n", message->node.handle.a, message->node.handle.b, message->node.handle.c, message->node.handle.d)); if (xfs[fd].root != NULL) { - printf("XFS PANIC WARNING! xfs_message_installroot: called again!\n"); + printf("NNPFS PANIC WARNING! xfs_message_installroot: called again!\n"); error = EBUSY; } else { error = new_xfs_node(&xfs[fd], &message->node, &xfs[fd].root, p); if (error) return error; - xfs[fd].root->vn->v_flag |= VROOT; + NNPFS_MAKE_VROOT(xfs[fd].root->vn); } return error; } @@ -73,22 +85,25 @@ int xfs_message_installnode(int fd, struct xfs_message_installnode * message, u_int size, - struct proc *p) + d_thread_t *p) { int error = 0; struct xfs_node *n, *dp; - XFSDEB(XDEBMSG, ("xfs_message_installnode (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBMSG, ("xfs_message_installnode (%d,%d,%d,%d)\n", message->node.handle.a, message->node.handle.b, message->node.handle.c, message->node.handle.d)); retry: - dp = xfs_node_find(&xfs[fd], &message->parent_handle); + dp = xfs_node_find(&xfs[fd].nodehead, &message->parent_handle); if (dp) { struct vnode *t_vnode = XNODE_TO_VNODE(dp); + NNPFSDEB(XDEBMSG, ("xfs_message_installnode: t_vnode = %lx\n", + (unsigned long)t_vnode)); + if (xfs_do_vget(t_vnode, 0 /* LK_SHARED */, p)) goto retry; @@ -104,10 +119,10 @@ retry: vrele (XNODE_TO_VNODE(n)); vrele (t_vnode); } else { - printf("XFS PANIC WARNING! xfs_message_installnode: no parent\n"); + printf("NNPFS PANIC WARNING! xfs_message_installnode: no parent\n"); error = ENOENT; } - XFSDEB(XDEBMSG, ("return: xfs_message_installnode: %d\n", error)); + NNPFSDEB(XDEBMSG, ("return: xfs_message_installnode: %d\n", error)); return error; } @@ -116,31 +131,32 @@ int xfs_message_installattr(int fd, struct xfs_message_installattr * message, u_int size, - struct proc *p) + d_thread_t *p) { int error = 0; struct xfs_node *t; - XFSDEB(XDEBMSG, ("xfs_message_installattr (%d,%d,%d,%d) \n", + NNPFSDEB(XDEBMSG, ("xfs_message_installattr (%d,%d,%d,%d) \n", message->node.handle.a, message->node.handle.b, message->node.handle.c, message->node.handle.d)); - t = xfs_node_find(&xfs[fd], &message->node.handle); + t = xfs_node_find(&xfs[fd].nodehead, &message->node.handle); if (t != 0) { t->tokens = message->node.tokens; - if ((t->tokens & XFS_DATA_MASK) && DATA_FROM_XNODE(t) == NULL) { + if ((t->tokens & NNPFS_DATA_MASK) && DATA_FROM_XNODE(t) == NULL) { printf ("xfs_message_installattr: tokens and no data\n"); - t->tokens &= ~XFS_DATA_MASK; + t->tokens &= ~NNPFS_DATA_MASK; } xfs_attr2vattr(&message->node.attr, &t->attr, 0); - xfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size); + if ((t->flags & NNPFS_VMOPEN) == 0) + xfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size); bcopy(message->node.id, t->id, sizeof(t->id)); bcopy(message->node.rights, t->rights, sizeof(t->rights)); t->anonrights = message->node.anonrights; } else { - XFSDEB(XDEBMSG, ("xfs_message_installattr: no such node\n")); + NNPFSDEB(XDEBMSG, ("xfs_message_installattr: no such node\n")); } return error; @@ -150,31 +166,32 @@ int xfs_message_installdata(int fd, struct xfs_message_installdata * message, u_int size, - struct proc *p) + d_thread_t *p) { struct xfs_node *t; int error = 0; - XFSDEB(XDEBMSG, ("xfs_message_installdata (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBMSG, ("xfs_message_installdata (%d,%d,%d,%d)\n", message->node.handle.a, message->node.handle.b, message->node.handle.c, message->node.handle.d)); retry: - t = xfs_node_find(&xfs[fd], &message->node.handle); + t = xfs_node_find(&xfs[fd].nodehead, &message->node.handle); if (t != NULL) { - struct xfs_fhandle_t *fh = (struct xfs_fhandle_t *)&message->cache_handle; - struct vnode *vp; + struct xfs_fhandle_t *fh = + (struct xfs_fhandle_t *)&message->cache_handle; struct vnode *t_vnode = XNODE_TO_VNODE(t); + struct vnode *vp; message->cache_name[sizeof(message->cache_name)-1] = '\0'; - XFSDEB(XDEBMSG, ("cache_name = '%s'\n", message->cache_name)); + NNPFSDEB(XDEBMSG, ("cache_name = '%s'\n", message->cache_name)); if (xfs_do_vget(t_vnode, 0 /* LK_SHARED */, p)) goto retry; - if (message->flag & XFS_ID_HANDLE_VALID) { + if (message->flag & NNPFS_ID_HANDLE_VALID) { error = xfs_fhlookup (p, fh, &vp); } else { error = EINVAL; @@ -187,11 +204,11 @@ retry: struct nameidata *ndp = &nd; #endif - XFSDEB(XDEBMSG, + NNPFSDEB(XDEBMSG, ("xfs_message_installdata: fhlookup failed: %d, " "opening by name\n", error)); - NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, + NDINIT(ndp, LOOKUP, FOLLOW | NNPFS_LOCKLEAF, UIO_SYSSPACE, message->cache_name, p); error = namei(ndp); vp = ndp->ni_vp; @@ -205,31 +222,33 @@ retry: vrele(DATA_FROM_XNODE(t)); DATA_FROM_XNODE(t) = vp; - XFSDEB(XDEBMSG, ("xfs_message_installdata: t = %lx;" + NNPFSDEB(XDEBMSG, ("xfs_message_installdata: t = %lx;" " tokens = %x\n", (unsigned long)t, message->node.tokens)); t->tokens = message->node.tokens; xfs_attr2vattr(&message->node.attr, &t->attr, 1); - xfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size); + if ((t->flags & NNPFS_VMOPEN) == 0) + xfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size); if (XNODE_TO_VNODE(t)->v_type == VDIR - && (message->flag & XFS_ID_INVALID_DNLC)) - cache_purge (XNODE_TO_VNODE(t)); + && (message->flag & NNPFS_ID_INVALID_DNLC)) + xfs_dnlc_purge (XNODE_TO_VNODE(t)); bcopy(message->node.id, t->id, sizeof(t->id)); bcopy(message->node.rights, t->rights, sizeof(t->rights)); t->anonrights = message->node.anonrights; + t->offset = message->offset; #if 0 - if (message->flag & XFS_ID_AFSDIR) - t->flags |= XFS_AFSDIR; + if (message->flag & NNPFS_ID_AFSDIR) + t->flags |= NNPFS_AFSDIR; #endif } else { - printf("XFS PANIC WARNING! xfs_message_installdata failed!\n"); + printf("NNPFS PANIC WARNING! xfs_message_installdata failed!\n"); printf("Reason: lookup failed on cache file '%s', error = %d\n", message->cache_name, error); } vrele (t_vnode); } else { - printf("XFS PANIC WARNING! xfs_message_installdata failed\n"); + printf("NNPFS PANIC WARNING! xfs_message_installdata failed\n"); printf("Reason: No node to install the data into!\n"); error = ENOENT; } @@ -247,18 +266,21 @@ int xfs_message_invalidnode(int fd, struct xfs_message_invalidnode * message, u_int size, - struct proc *p) + d_thread_t *p) { int error = 0; struct xfs_node *t; - XFSDEB(XDEBMSG, ("xfs_message_invalidnode (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBMSG, ("xfs_message_invalidnode (%d,%d,%d,%d)\n", message->handle.a, message->handle.b, message->handle.c, message->handle.d)); - t = xfs_node_find(&xfs[fd], &message->handle); +#ifdef __APPLE__ + retry: +#endif + t = xfs_node_find(&xfs[fd].nodehead, &message->handle); if (t != 0) { struct vnode *vp = XNODE_TO_VNODE(t); @@ -284,14 +306,19 @@ xfs_message_invalidnode(int fd, /* If node is in use, mark as stale */ if (vp->v_usecount > 0 && vp->v_type != VDIR) { #ifdef __APPLE__ - if (UBCISVALID(vp) && !ubc_isinuse(vp, 0)) { + if (vget(vp, 0, p)) + goto retry; + + if (UBCISVALID(vp) && !ubc_isinuse(vp, 1)) { ubc_setsize(vp, 0); + vrele(vp); } else { - t->flags |= XFS_STALE; + vrele(vp); + t->flags |= NNPFS_STALE; return 0; } #else - t->flags |= XFS_STALE; + t->flags |= NNPFS_STALE; return 0; #endif } @@ -300,19 +327,23 @@ xfs_message_invalidnode(int fd, vrele(DATA_FROM_XNODE(t)); DATA_FROM_XNODE(t) = (struct vnode *) 0; } - XFS_TOKEN_CLEAR(t, ~0, - XFS_OPEN_MASK | XFS_ATTR_MASK | - XFS_DATA_MASK | XFS_LOCK_MASK); + NNPFS_TOKEN_CLEAR(t, ~0, + NNPFS_OPEN_MASK | NNPFS_ATTR_MASK | + NNPFS_DATA_MASK | NNPFS_LOCK_MASK); /* Dir changed, must invalidate DNLC. */ if (vp->v_type == VDIR) xfs_dnlc_purge(vp); if (vp->v_usecount == 0) { - XFSDEB(XDEBVNOPS, ("xfs_message_invalidnode: vrecycle\n")); #ifndef __osf__ + NNPFSDEB(XDEBVNOPS, ("xfs_message_invalidnode: vrecycle\n")); vrecycle(vp, 0, p); -#endif +#else + /* XXX */ +#endif /* __osf__ */ } } else { + NNPFSDEB(XDEBMSG, ("xfs_message_invalidnode: no such node\n")); + send_inactive_node(fd, &message->handle); error = ENOENT; } @@ -323,24 +354,26 @@ int xfs_message_updatefid(int fd, struct xfs_message_updatefid * message, u_int size, - struct proc *p) + d_thread_t *p) { int error = 0; struct xfs_node *t; - XFSDEB(XDEBMSG, ("xfs_message_updatefid (%d,%d,%d,%d)\n", - message->old_handle.a, - message->old_handle.b, - message->old_handle.c, - message->old_handle.d)); - - t = xfs_node_find (&xfs[fd], &message->old_handle); - if (t != NULL) { - t->handle = message->new_handle; - } else { - printf ("XFS PANIC WARNING! xfs_message_updatefid: no node!\n"); - error = ENOENT; - } + NNPFSDEB(XDEBMSG, ("xfs_message_updatefid (%d,%d,%d,%d) (%d,%d,%d,%d)\n", + message->old_handle.a, + message->old_handle.b, + message->old_handle.c, + message->old_handle.d, + message->new_handle.a, + message->new_handle.b, + message->new_handle.c, + message->new_handle.d)); + + error = xfs_update_handle(&xfs[fd].nodehead, + &message->old_handle, + &message->new_handle); + if (error) + printf ("NNPFS PANIC WARNING! xfs_message_updatefid: %d\n", error); return error; } @@ -352,7 +385,7 @@ xfs_message_updatefid(int fd, static void gc_vnode (struct vnode *vp, - struct proc *p) + d_thread_t *p) { /* This node is on the freelist */ if (vp->v_usecount <= 0) { @@ -363,49 +396,15 @@ gc_vnode (struct vnode *vp, panic("vrele: ref cnt"); } - XFSDEB(XDEBMSG, ("xfs_message_gc: success\n")); + NNPFSDEB(XDEBMSG, ("xfs_message_gc: success\n")); vgone(vp, VX_NOSLEEP, NULL); } else { - XFSDEB(XDEBMSG, ("xfs_message_gc: used\n")); + NNPFSDEB(XDEBMSG, ("xfs_message_gc: used\n")); } } -int -xfs_message_gc_nodes(int fd, - struct xfs_message_gc_nodes *message, - u_int size, - struct proc *p) -{ - XFSDEB(XDEBMSG, ("xfs_message_gc\n")); - - if (message->len == 0) { - struct vnode *vp; - - /* XXX see comment in xfs_node_find */ - - for(vp = XFS_TO_VFS(&xfs[fd])->m_mounth; - vp != NULL; - vp = vp->v_mountf) { - gc_vnode (vp, p); - } - - } else { - struct xfs_node *t; - int i; - - for (i = 0; i < message->len; i++) { - t = xfs_node_find (&xfs[fd], &message->handle[i]); - if (t == NULL) - continue; - - gc_vnode(XNODE_TO_VNODE(t), p); - } - } - - return 0; -} #else /* !__osf__ */ @@ -415,9 +414,13 @@ xfs_message_gc_nodes(int fd, static void gc_vnode (struct vnode *vp, - struct proc *p) + d_thread_t *p) { +#ifdef HAVE_SYS_MUTEX_H + mtx_lock(&vp->v_interlock); +#else simple_lock(&vp->v_interlock); +#endif /* This node is on the freelist */ if (vp->v_usecount <= 0) { @@ -432,75 +435,65 @@ gc_vnode (struct vnode *vp, || (obj->flags & OBJ_MIGHTBEDIRTY) != 0 #endif )) { +#ifdef HAVE_SYS_MUTEX_H + mtx_unlock(&vp->v_interlock); +#else simple_unlock (&vp->v_interlock); +#endif return; } #endif /* __FreeBSD__ */ /* DIAGNOSTIC */ if (vp->v_usecount < 0 || vp->v_writecount != 0) { - vprint("Pjäxomatic-4700: bad ref count", vp); - panic("Pjäxomatic-4650: ref cnt"); + vprint("vrele: bad ref count", vp); + panic("vrele: ref cnt"); } - XFSDEB(XDEBMSG, ("xfs_message_gc: success\n")); + NNPFSDEB(XDEBMSG, ("xfs_message_gc: success\n")); -#ifdef HAVE_KERNEL_FUNC_VGONEL +#ifdef HAVE_KERNEL_VGONEL vgonel (vp, p); #else +#ifdef HAVE_SYS_MUTEX_H + mtx_unlock(&vp->v_interlock); +#else simple_unlock(&vp->v_interlock); +#endif vgone (vp); #endif } else { +#ifdef HAVE_SYS_MUTEX_H + mtx_unlock(&vp->v_interlock); +#else simple_unlock(&vp->v_interlock); - XFSDEB(XDEBMSG, ("xfs_message_gc: used\n")); +#endif + NNPFSDEB(XDEBMSG, ("xfs_message_gc: used\n")); } } +#endif + int xfs_message_gc_nodes(int fd, - struct xfs_message_gc_nodes *message, - u_int size, - struct proc *p) + struct xfs_message_gc_nodes *message, + u_int size, + d_thread_t *p) { - XFSDEB(XDEBMSG, ("xfs_message_gc\n")); - - if (message->len == 0) { - struct vnode *vp, *next; - - /* XXX see comment in xfs_node_find */ - /* XXXSMP do gone[l] need to get mntvnode_slock ? */ - -/* FreeBSD 4.5 and above did rename mnt_vnodelist to mnt_nvnodelist */ -#ifdef HAVE_STRUCT_MOUNT_MNT_NVNODELIST - for(vp = TAILQ_FIRST(&XFS_TO_VFS(&xfs[fd])->mnt_nvnodelist); - vp != NULL; - vp = next) { - - next = TAILQ_NEXT(vp, v_nmntvnodes); - gc_vnode (vp, p); - } -#else - for(vp = XFS_TO_VFS(&xfs[fd])->mnt_vnodelist.lh_first; - vp != NULL; - vp = next) { - - next = vp->v_mntvnodes.le_next; - gc_vnode (vp, p); - } -#endif - } else { - struct xfs_node *t; - int i; - - for (i = 0; i < message->len; i++) { - t = xfs_node_find (&xfs[fd], &message->handle[i]); - if (t == NULL) - continue; - - gc_vnode(XNODE_TO_VNODE(t), p); + struct xfs_node *node; + int i; + + NNPFSDEB(XDEBMSG, ("xfs_message_gc\n")); + + for (i = 0; i < message->len; i++) { + node = xfs_node_find (&xfs[fd].nodehead, &message->handle[i]); + if (node) + gc_vnode(XNODE_TO_VNODE(node), p); + else { + NNPFSDEB(XDEBMSG, ("xfs_message_gc_nodes: no such node\n")); + send_inactive_node(fd, &message->handle[i]); } } @@ -508,8 +501,6 @@ xfs_message_gc_nodes(int fd, } -#endif - /* * Probe what version of xfs this support */ @@ -518,16 +509,17 @@ int xfs_message_version(int fd, struct xfs_message_version *message, u_int size, - struct proc *p) + d_thread_t *p) { struct xfs_message_wakeup msg; int ret; - ret = XFS_VERSION; + ret = NNPFS_VERSION; - msg.header.opcode = XFS_MSG_WAKEUP; + msg.header.opcode = NNPFS_MSG_WAKEUP; msg.sleepers_sequence_num = message->header.sequence_num; msg.error = ret; - return xfs_message_send(fd, (struct xfs_message_header *) &msg, sizeof(msg)); + return xfs_message_send(fd, + (struct xfs_message_header *) &msg, sizeof(msg)); } diff --git a/sys/xfs/xfs_message.h b/sys/xfs/xfs_message.h index 887fdc96c2f..75657ae44d1 100644 --- a/sys/xfs/xfs_message.h +++ b/sys/xfs/xfs_message.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,63 +31,41 @@ * SUCH DAMAGE. */ -/* $Id: xfs_message.h,v 1.5 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_message.h,v 1.55 2002/09/27 09:43:21 lha Exp $ */ #ifndef _xmsg_h #define _xmsg_h /* bump this for any incompatible changes */ -#define XFS_VERSION 17 - -#if defined(WIN32) -#ifdef i386 -#ifndef __CYGWIN__ -typedef int int32_t; -typedef unsigned int u_int32_t; -typedef short int16_t; -typedef unsigned char u_char; -#endif -#else -#error not a i386 -#endif -#elif !defined(__LINUX__) && !defined(HAVE_GLIBC) -#include <sys/types.h> -#if !defined(__OpenBSD__) && defined(_KERNEL) -#include <atypes.h> -#endif -#include <sys/param.h> -#else -#include <linux/types.h> -#include <linux/param.h> -#endif +#define NNPFS_VERSION 18 #include <xfs/xfs_attr.h> /* Temporary hack? */ #define MAX_XMSG_SIZE (1024*64) -typedef u_int32_t xfs_pag_t; +typedef uint32_t xfs_pag_t; /* * The xfs_cred, if pag == 0, use uid */ typedef struct xfs_cred { - u_int32_t uid; + uint32_t uid; xfs_pag_t pag; } xfs_cred; -typedef u_int32_t xfs_locktype_t; -typedef u_int32_t xfs_lockid_t; +typedef uint32_t xfs_locktype_t; +typedef uint32_t xfs_lockid_t; #define MAXHANDLE (4*4) #define MAXRIGHTS 8 -#define XFS_ANONYMOUSID 32766 +#define NNPFS_ANONYMOUSID 32766 typedef struct xfs_handle { - u_int32_t a, b, c, d; + uint32_t a, b, c, d; } xfs_handle; #define xfs_handle_eq(p, q) \ @@ -107,250 +85,267 @@ typedef struct xfs_cache_handle { * Tokens that apply to nodes, open modes and attributes. Shared * reading might be used for exec and exclusive write for remove. */ -#define XFS_OPEN_MASK 0x000f -#define XFS_OPEN_NR 0x0001 /* Normal reading, data might change */ -#define XFS_OPEN_SR 0x0002 /* Shared reading, data won't change */ -#define XFS_OPEN_NW 0x0004 /* Normal writing, multiple writers */ -#define XFS_OPEN_EW 0x0008 /* Exclusive writing (open really) */ +#define NNPFS_OPEN_MASK 0x000f +#define NNPFS_OPEN_NR 0x0001 /* Normal reading, data might change */ +#define NNPFS_OPEN_SR 0x0002 /* Shared reading, data won't change */ +#define NNPFS_OPEN_NW 0x0004 /* Normal writing, multiple writers */ +#define NNPFS_OPEN_EW 0x0008 /* Exclusive writing (open really) */ -#define XFS_ATTR_MASK 0x0030 -#define XFS_ATTR_R 0x0010 /* Attributes valid */ -#define XFS_ATTR_W 0x0020 /* Attributes valid and modifiable */ +#define NNPFS_ATTR_MASK 0x0030 +#define NNPFS_ATTR_R 0x0010 /* Attributes valid */ +#define NNPFS_ATTR_W 0x0020 /* Attributes valid and modifiable */ /* * Tokens that apply to node data. */ -#define XFS_DATA_MASK 0x00c0 -#define XFS_DATA_R 0x0040 /* Data valid */ -#define XFS_DATA_W 0x0080 /* Data valid and modifiable */ -#define XFS_LOCK_MASK 0x0300 -#define XFS_LOCK_R 0x0100 /* Data Shared locks */ -#define XFS_LOCK_W 0x0200 /* Data Exclusive locks */ - -#define XFS_ATTR_VALID XFS_ATTR_R -#define XFS_DATA_VALID XFS_DATA_W - -/* xfs_node.flags */ -#define XFS_DATA_DIRTY 0x0001 -#define XFS_ATTR_DIRTY 0x0002 -#define XFS_AFSDIR 0x0004 -#define XFS_STALE 0x0008 -#define XFS_XDELETED 0x0010 +#define NNPFS_DATA_MASK 0x00c0 +#define NNPFS_DATA_R 0x0040 /* Data valid */ +#define NNPFS_DATA_W 0x0080 /* Data valid and modifiable */ +#define NNPFS_LOCK_MASK 0x0300 +#define NNPFS_LOCK_R 0x0100 /* Data Shared locks */ +#define NNPFS_LOCK_W 0x0200 /* Data Exclusive locks */ + +#define NNPFS_ATTR_VALID NNPFS_ATTR_R +#define NNPFS_DATA_VALID NNPFS_DATA_W + +/* xfs_node.flags + * The lower 16 bit flags are reserved for common xfs flags + * The upper 16 bit flags are reserved for operting system dependant + * flags. + */ + +#define NNPFS_DATA_DIRTY 0x0001 +#define NNPFS_ATTR_DIRTY 0x0002 +#define NNPFS_AFSDIR 0x0004 +#define NNPFS_STALE 0x0008 +#define NNPFS_XDELETED 0x0010 +#define NNPFS_VMOPEN 0x0020 + +/* + * Token match macros, NNPFS_TOKEN_GOT is depricated and + * NNPFS_TOKEN_GOT_* should be used instead. + */ /* Are necessary tokens available? */ -#define XFS_TOKEN_GOT(xn, tok) ((xn)->tokens & (tok)) -#define XFS_TOKEN_SET(xn, tok, mask) ((xn)->tokens |= ((tok) & (mask))) -#define XFS_TOKEN_CLEAR(xn, tok, mask) ((xn)->tokens &= ~((tok) & (mask))) +#define NNPFS_TOKEN_GOT(xn, tok) ((xn)->tokens & (tok)) /* deprecated */ +#define NNPFS_TOKEN_GOT_ANY(xn, tok) ((xn)->tokens & (tok)) /* at least one must match */ +#define NNPFS_TOKEN_GOT_ALL(xn, tok) (((xn)->tokens & (tok)) == (tok)) /* all tokens must match */ +#define NNPFS_TOKEN_SET(xn, tok, mask) ((xn)->tokens |= ((tok) & (mask))) +#define NNPFS_TOKEN_CLEAR(xn, tok, mask) ((xn)->tokens &= ~((tok) & (mask))) /* definitions for the rights fields */ -#define XFS_RIGHT_R 0x01 /* may read? */ -#define XFS_RIGHT_W 0x02 /* may write? */ -#define XFS_RIGHT_X 0x04 /* may execute? */ +#define NNPFS_RIGHT_R 0x01 /* may read? */ +#define NNPFS_RIGHT_W 0x02 /* may write? */ +#define NNPFS_RIGHT_X 0x04 /* may execute? */ /* Max name length passed in xfs messages */ -#define XFS_MAX_NAME 256 -#define XFS_MAX_SYMLINK_CONTENT 2048 +#define NNPFS_MAX_NAME 256 +#define NNPFS_MAX_SYMLINK_CONTENT 2048 struct xfs_msg_node { xfs_handle handle; - u_int32_t tokens; - u_int32_t pad1; + uint32_t tokens; + uint32_t pad1; struct xfs_attr attr; xfs_pag_t id[MAXRIGHTS]; u_char rights[MAXRIGHTS]; u_char anonrights; - u_int16_t pad2; - u_int32_t pad3; + uint16_t pad2; + uint32_t pad3; }; /* * Messages passed through the xfs_dev. */ struct xfs_message_header { - u_int32_t size; - u_int32_t opcode; - u_int32_t sequence_num; /* Private */ - u_int32_t pad1; + uint32_t size; + uint32_t opcode; + uint32_t sequence_num; /* Private */ + uint32_t pad1; }; /* * Used by putdata flag */ -enum { XFS_READ = 0x01, - XFS_WRITE = 0x02, - XFS_NONBLOCK = 0x04, - XFS_APPEND = 0x08, - XFS_FSYNC = 0x10}; +enum { NNPFS_READ = 0x01, + NNPFS_WRITE = 0x02, + NNPFS_NONBLOCK = 0x04, + NNPFS_APPEND = 0x08, + NNPFS_FSYNC = 0x10}; /* * Flags for inactivenode */ -enum { XFS_NOREFS = 1, XFS_DELETE = 2 }; +enum { NNPFS_NOREFS = 1, NNPFS_DELETE = 2 }; /* * Flags for installdata */ -enum { XFS_ID_INVALID_DNLC = 0x01, XFS_ID_AFSDIR = 0x02, - XFS_ID_HANDLE_VALID = 0x04 }; +enum { NNPFS_ID_INVALID_DNLC = 0x01, NNPFS_ID_AFSDIR = 0x02, + NNPFS_ID_HANDLE_VALID = 0x04 }; /* * Defined message types and their opcodes. */ -#define XFS_MSG_VERSION 0 -#define XFS_MSG_WAKEUP 1 +#define NNPFS_MSG_VERSION 0 +#define NNPFS_MSG_WAKEUP 1 -#define XFS_MSG_GETROOT 2 -#define XFS_MSG_INSTALLROOT 3 +#define NNPFS_MSG_GETROOT 2 +#define NNPFS_MSG_INSTALLROOT 3 -#define XFS_MSG_GETNODE 4 -#define XFS_MSG_INSTALLNODE 5 +#define NNPFS_MSG_GETNODE 4 +#define NNPFS_MSG_INSTALLNODE 5 -#define XFS_MSG_GETATTR 6 -#define XFS_MSG_INSTALLATTR 7 +#define NNPFS_MSG_GETATTR 6 +#define NNPFS_MSG_INSTALLATTR 7 -#define XFS_MSG_GETDATA 8 -#define XFS_MSG_INSTALLDATA 9 +#define NNPFS_MSG_GETDATA 8 +#define NNPFS_MSG_INSTALLDATA 9 -#define XFS_MSG_INACTIVENODE 10 -#define XFS_MSG_INVALIDNODE 11 +#define NNPFS_MSG_INACTIVENODE 10 +#define NNPFS_MSG_INVALIDNODE 11 /* XXX Must handle dropped/revoked tokens better */ -#define XFS_MSG_OPEN 12 +#define NNPFS_MSG_OPEN 12 -#define XFS_MSG_PUTDATA 13 -#define XFS_MSG_PUTATTR 14 +#define NNPFS_MSG_PUTDATA 13 +#define NNPFS_MSG_PUTATTR 14 /* Directory manipulating messages. */ -#define XFS_MSG_CREATE 15 -#define XFS_MSG_MKDIR 16 -#define XFS_MSG_LINK 17 -#define XFS_MSG_SYMLINK 18 +#define NNPFS_MSG_CREATE 15 +#define NNPFS_MSG_MKDIR 16 +#define NNPFS_MSG_LINK 17 +#define NNPFS_MSG_SYMLINK 18 -#define XFS_MSG_REMOVE 19 -#define XFS_MSG_RMDIR 20 +#define NNPFS_MSG_REMOVE 19 +#define NNPFS_MSG_RMDIR 20 -#define XFS_MSG_RENAME 21 +#define NNPFS_MSG_RENAME 21 -#define XFS_MSG_PIOCTL 22 -#define XFS_MSG_WAKEUP_DATA 23 +#define NNPFS_MSG_PIOCTL 22 +#define NNPFS_MSG_WAKEUP_DATA 23 -#define XFS_MSG_UPDATEFID 24 +#define NNPFS_MSG_UPDATEFID 24 -#define XFS_MSG_ADVLOCK 25 +#define NNPFS_MSG_ADVLOCK 25 -#define XFS_MSG_GC_NODES 26 +#define NNPFS_MSG_GC_NODES 26 -#define XFS_MSG_COUNT 27 +#define NNPFS_MSG_COUNT 27 -/* XFS_MESSAGE_VERSION */ +/* NNPFS_MESSAGE_VERSION */ struct xfs_message_version { struct xfs_message_header header; - u_int32_t ret; + uint32_t ret; }; -/* XFS_MESSAGE_WAKEUP */ +/* NNPFS_MESSAGE_WAKEUP */ struct xfs_message_wakeup { struct xfs_message_header header; - u_int32_t sleepers_sequence_num; /* Where to send wakeup */ - u_int32_t error; /* Return value */ + uint32_t sleepers_sequence_num; /* Where to send wakeup */ + uint32_t error; /* Return value */ }; -/* XFS_MESSAGE_GETROOT */ +/* NNPFS_MESSAGE_GETROOT */ struct xfs_message_getroot { struct xfs_message_header header; struct xfs_cred cred; }; -/* XFS_MESSAGE_INSTALLROOT */ +/* NNPFS_MESSAGE_INSTALLROOT */ struct xfs_message_installroot { struct xfs_message_header header; struct xfs_msg_node node; }; -/* XFS_MESSAGE_GETNODE */ +/* NNPFS_MESSAGE_GETNODE */ struct xfs_message_getnode { struct xfs_message_header header; struct xfs_cred cred; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; }; -/* XFS_MESSAGE_INSTALLNODE */ +/* NNPFS_MESSAGE_INSTALLNODE */ struct xfs_message_installnode { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; struct xfs_msg_node node; }; -/* XFS_MESSAGE_GETATTR */ +/* NNPFS_MESSAGE_GETATTR */ struct xfs_message_getattr { struct xfs_message_header header; struct xfs_cred cred; xfs_handle handle; }; -/* XFS_MESSAGE_INSTALLATTR */ +/* NNPFS_MESSAGE_INSTALLATTR */ struct xfs_message_installattr { struct xfs_message_header header; struct xfs_msg_node node; }; -/* XFS_MESSAGE_GETDATA */ +/* NNPFS_MESSAGE_GETDATA */ struct xfs_message_getdata { struct xfs_message_header header; struct xfs_cred cred; xfs_handle handle; - u_int32_t tokens; - u_int32_t pad1; + uint32_t tokens; + uint32_t pad1; + uint32_t offset; + uint32_t pad2; }; -/* XFS_MESSAGE_INSTALLDATA */ +/* NNPFS_MESSAGE_INSTALLDATA */ struct xfs_message_installdata { struct xfs_message_header header; struct xfs_msg_node node; - char cache_name[XFS_MAX_NAME]; + char cache_name[NNPFS_MAX_NAME]; struct xfs_cache_handle cache_handle; - u_int32_t flag; - u_int32_t pad1; + uint32_t flag; + uint32_t pad1; + uint32_t offset; + uint32_t pad2; }; -/* XFS_MSG_INACTIVENODE */ +/* NNPFS_MSG_INACTIVENODE */ struct xfs_message_inactivenode { struct xfs_message_header header; xfs_handle handle; - u_int32_t flag; - u_int32_t pad1; + uint32_t flag; + uint32_t pad1; }; -/* XFS_MSG_INVALIDNODE */ +/* NNPFS_MSG_INVALIDNODE */ struct xfs_message_invalidnode { struct xfs_message_header header; xfs_handle handle; }; -/* XFS_MSG_OPEN */ +/* NNPFS_MSG_OPEN */ struct xfs_message_open { struct xfs_message_header header; struct xfs_cred cred; xfs_handle handle; - u_int32_t tokens; - u_int32_t pad1; + uint32_t tokens; + uint32_t pad1; }; -/* XFS_MSG_PUTDATA */ +/* NNPFS_MSG_PUTDATA */ struct xfs_message_putdata { struct xfs_message_header header; xfs_handle handle; struct xfs_attr attr; /* XXX ??? */ struct xfs_cred cred; - u_int32_t flag; - u_int32_t pad1; + uint32_t flag; + uint32_t pad1; }; -/* XFS_MSG_PUTATTR */ +/* NNPFS_MSG_PUTATTR */ struct xfs_message_putattr { struct xfs_message_header header; xfs_handle handle; @@ -358,120 +353,139 @@ struct xfs_message_putattr { struct xfs_cred cred; }; -/* XFS_MSG_CREATE */ +/* NNPFS_MSG_CREATE */ struct xfs_message_create { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; struct xfs_attr attr; - u_int32_t mode; - u_int32_t pad1; + uint32_t mode; + uint32_t pad1; struct xfs_cred cred; }; -/* XFS_MSG_MKDIR */ +/* NNPFS_MSG_MKDIR */ struct xfs_message_mkdir { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; struct xfs_attr attr; struct xfs_cred cred; }; -/* XFS_MSG_LINK */ +/* NNPFS_MSG_LINK */ struct xfs_message_link { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; xfs_handle from_handle; struct xfs_cred cred; }; -/* XFS_MSG_SYMLINK */ +/* NNPFS_MSG_SYMLINK */ struct xfs_message_symlink { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; - char contents[XFS_MAX_SYMLINK_CONTENT]; + char name[NNPFS_MAX_NAME]; + char contents[NNPFS_MAX_SYMLINK_CONTENT]; struct xfs_attr attr; struct xfs_cred cred; }; -/* XFS_MSG_REMOVE */ +/* NNPFS_MSG_REMOVE */ struct xfs_message_remove { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; struct xfs_cred cred; }; -/* XFS_MSG_RMDIR */ +/* NNPFS_MSG_RMDIR */ struct xfs_message_rmdir { struct xfs_message_header header; xfs_handle parent_handle; - char name[XFS_MAX_NAME]; + char name[NNPFS_MAX_NAME]; struct xfs_cred cred; }; -/* XFS_MSG_RENAME */ +/* NNPFS_MSG_RENAME */ struct xfs_message_rename { struct xfs_message_header header; xfs_handle old_parent_handle; - char old_name[XFS_MAX_NAME]; + char old_name[NNPFS_MAX_NAME]; xfs_handle new_parent_handle; - char new_name[XFS_MAX_NAME]; + char new_name[NNPFS_MAX_NAME]; struct xfs_cred cred; }; -/* XFS_MSG_PIOCTL */ +#define NNPFS_MSG_MAX_DATASIZE 2048 + +/* NNPFS_MSG_PIOCTL */ struct xfs_message_pioctl { struct xfs_message_header header; - u_int32_t opcode ; - u_int32_t pad1; + uint32_t opcode ; + uint32_t pad1; xfs_cred cred; - u_int32_t insize; - u_int32_t outsize; - char msg[2048] ; /* XXX */ + uint32_t insize; + uint32_t outsize; + char msg[NNPFS_MSG_MAX_DATASIZE]; xfs_handle handle; }; -/* XFS_MESSAGE_WAKEUP_DATA */ +/* NNPFS_MESSAGE_WAKEUP_DATA */ struct xfs_message_wakeup_data { struct xfs_message_header header; - u_int32_t sleepers_sequence_num; /* Where to send wakeup */ - u_int32_t error; /* Return value */ - u_int32_t len; - u_int32_t pad1; - char msg[2048] ; /* XXX */ + uint32_t sleepers_sequence_num; /* Where to send wakeup */ + uint32_t error; /* Return value */ + uint32_t len; + uint32_t pad1; + char msg[NNPFS_MSG_MAX_DATASIZE]; }; -/* XFS_MESSAGE_UPDATEFID */ +/* NNPFS_MESSAGE_UPDATEFID */ struct xfs_message_updatefid { struct xfs_message_header header; xfs_handle old_handle; xfs_handle new_handle; }; -/* XFS_MESSAGE_ADVLOCK */ +/* NNPFS_MESSAGE_ADVLOCK */ struct xfs_message_advlock { struct xfs_message_header header; xfs_handle handle; struct xfs_cred cred; xfs_locktype_t locktype; -#define XFS_WR_LOCK 1 /* Write lock */ -#define XFS_RD_LOCK 2 /* Read lock */ -#define XFS_UN_LOCK 3 /* Unlock */ -#define XFS_BR_LOCK 4 /* Break lock (inform that we don't want the lock) */ +#define NNPFS_WR_LOCK 1 /* Write lock */ +#define NNPFS_RD_LOCK 2 /* Read lock */ +#define NNPFS_UN_LOCK 3 /* Unlock */ +#define NNPFS_BR_LOCK 4 /* Break lock (inform that we don't want the lock) */ xfs_lockid_t lockid; }; -/* XFS_MESSAGE_GC_NODES */ +/* NNPFS_MESSAGE_GC_NODES */ struct xfs_message_gc_nodes { struct xfs_message_header header; -#define XFS_GC_NODES_MAX_HANDLE 50 - u_int32_t len; - u_int32_t pad1; - xfs_handle handle[XFS_GC_NODES_MAX_HANDLE]; +#define NNPFS_GC_NODES_MAX_HANDLE 50 + uint32_t len; + uint32_t pad1; + xfs_handle handle[NNPFS_GC_NODES_MAX_HANDLE]; +}; + +#if 0 +struct xfs_name { + u_int16_t name; + char name[1]; }; +#endif + +struct xfs_message_bulkgetnode { + struct xfs_message_header header; + xfs_handle parent_handle; + uint32_t flags; +#define NNPFS_BGN_LAZY 0x1 + uint32_t numnodes; + struct xfs_handle handles[1]; +}; + #endif /* _xmsg_h */ diff --git a/sys/xfs/xfs_msg_locl.h b/sys/xfs/xfs_msg_locl.h index bc15c0b64d7..8c80253c92f 100644 --- a/sys/xfs/xfs_msg_locl.h +++ b/sys/xfs/xfs_msg_locl.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_msg_locl.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_msg_locl.h,v 1.6 2002/09/07 10:46:05 lha Exp $ */ #ifndef _xfs_msg_locl_h #define _xfs_msg_locl_h @@ -40,48 +40,48 @@ int xfs_message_installroot(int fd, struct xfs_message_installroot * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_installnode(int fd, struct xfs_message_installnode * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_installattr(int fd, struct xfs_message_installattr * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_installdata(int fd, struct xfs_message_installdata * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_invalidnode(int fd, struct xfs_message_invalidnode * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_updatefid(int fd, struct xfs_message_updatefid * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_gc_nodes(int fd, struct xfs_message_gc_nodes * message, u_int size, - struct proc *p); + d_thread_t *p); int xfs_message_version(int fd, struct xfs_message_version *message, u_int size, - struct proc *p); + d_thread_t *p); #endif /* _xfs_msg_locl_h */ diff --git a/sys/xfs/xfs_node-bsd.c b/sys/xfs/xfs_node-bsd.c index afcbb8bdeda..b74b1169d05 100644 --- a/sys/xfs/xfs_node-bsd.c +++ b/sys/xfs/xfs_node-bsd.c @@ -37,7 +37,7 @@ #include <xfs/xfs_deb.h> #include <xfs/xfs_vnodeops.h> -RCSID("$Id: xfs_node-bsd.c,v 1.5 2003/01/31 17:37:50 art Exp $"); +RCSID("$arla: xfs_node-bsd.c,v 1.70 2003/02/28 02:01:06 lha Exp $"); extern vop_t **xfs_vnodeop_p; @@ -51,17 +51,18 @@ extern vop_t **xfs_vnodeop_p; */ int -xfs_getnewvnode(struct mount *mp, struct vnode **vpp, +xfs_getnewvnode(struct xfs *xfsp, struct vnode **vpp, struct xfs_handle *handle) { - struct xfs_node *result; + struct xfs_node *result, *check; + struct mount *mp; int error; - error = getnewvnode(VT_AFS, mp, xfs_vnodeop_p, vpp); + error = getnewvnode(VT_AFS, NNPFS_TO_VFS(xfsp), xfs_vnodeop_p, vpp); if (error) return error; - result = xfs_alloc(sizeof(*result)); + result = xfs_alloc(sizeof(*result), M_NNPFS_NODE); bzero(result, sizeof(*result)); (*vpp)->v_data = result; @@ -70,13 +71,28 @@ xfs_getnewvnode(struct mount *mp, struct vnode **vpp, result->handle = *handle; result->flags = 0; result->tokens = 0; + result->offset = 0; #if defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR) lockinit (&result->lock, PVFS, "xfs_lock", 0, LK_NOPAUSE); #else result->vnlocks = 0; #endif result->anonrights = 0; - result->cred = NULL; + result->rd_cred = NULL; + result->wr_cred = NULL; + +#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000 + genfs_node_init(*vpp, &xfs_genfsops); +#endif + + check = xfs_node_find(&xfsp->nodehead, handle); + if (check) { + vput(*vpp); + *vpp = result->vn; + return 0; + } + + xfs_insert(&xfs->nodehead, result); return 0; } @@ -92,11 +108,11 @@ int new_xfs_node(struct xfs *xfsp, struct xfs_msg_node *node, struct xfs_node **xpp, - struct proc *p) + d_thread_t *p) { struct xfs_node *result; - XFSDEB(XDEBNODE, ("new_xfs_node (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBNODE, ("new_xfs_node (%d,%d,%d,%d)\n", node->handle.a, node->handle.b, node->handle.c, @@ -104,12 +120,12 @@ new_xfs_node(struct xfs *xfsp, retry: /* Does not allow duplicates */ - result = xfs_node_find(xfsp, &node->handle); + result = xfs_node_find(&xfsp->nodehead, &node->handle); if (result == 0) { int error; struct vnode *v; - error = xfs_getnewvnode(XFS_TO_VFS(xfsp), &v, &node->handle); + error = xfs_getnewvnode(xfsp, &v, &node->handle); if (error) return error; @@ -136,16 +152,16 @@ retry: #endif *xpp = result; - XFSDEB(XDEBNODE, ("return: new_xfs_node\n")); + NNPFSDEB(XDEBNODE, ("return: new_xfs_node\n")); return 0; } void free_xfs_node(struct xfs_node *node) { - struct xfs *xfsp = XFS_FROM_XNODE(node); + struct xfs *xfsp = NNPFS_FROM_XNODE(node); - XFSDEB(XDEBNODE, ("free_xfs_node(%lx) (%d,%d,%d,%d)\n", + NNPFSDEB(XDEBNODE, ("free_xfs_node(%lx) (%d,%d,%d,%d)\n", (unsigned long)node, node->handle.a, node->handle.b, @@ -160,14 +176,18 @@ free_xfs_node(struct xfs_node *node) } xfsp->nnodes--; XNODE_TO_VNODE(node)->v_data = NULL; - if (node->cred) { - crfree (node->cred); - node->cred = NULL; + if (node->rd_cred) { + crfree (node->rd_cred); + node->rd_cred = NULL; + } + if (node->wr_cred) { + crfree (node->wr_cred); + node->wr_cred = NULL; } - xfs_free(node, sizeof(*node)); + xfs_free(node, sizeof(*node), M_NNPFS_NODE); - XFSDEB(XDEBNODE, ("free_xfs_node done\n")); + NNPFSDEB(XDEBNODE, ("free_xfs_node done\n")); } /* @@ -188,26 +208,26 @@ int free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp) { int error = 0; - struct mount *mp = XFS_TO_VFS(xfsp); + struct mount *mp = NNPFS_TO_VFS(xfsp); if (mp == NULL) { - XFSDEB(XDEBNODE, ("free_all_xfs_nodes already freed\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes already freed\n")); return 0; } - XFSDEB(XDEBNODE, ("free_all_xfs_nodes starting\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes starting\n")); xfs_dnlc_purge_mp(mp); if (xfsp->root) { - XFSDEB(XDEBNODE, ("free_all_xfs_nodes now removing root\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes now removing root\n")); vgone(XNODE_TO_VNODE(xfsp->root)); xfsp->root = NULL; } - XFSDEB(XDEBNODE, ("free_all_xfs_nodes root removed\n")); - XFSDEB(XDEBNODE, ("free_all_xfs_nodes now killing all remaining nodes\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes root removed\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes now killing all remaining nodes\n")); /* * If we have a syncer vnode, release it (to emulate dounmount) @@ -220,14 +240,14 @@ free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp) #ifdef HAVE_KERNEL_VFS_DEALLOCATE_SYNCVNODE vfs_deallocate_syncvnode(mp); #else - /* - * FreeBSD and OpenBSD uses different semantics, - * FreeBSD does vrele, and OpenBSD does vgone. - */ + /* + * FreeBSD and OpenBSD uses different semantics, + * FreeBSD does vrele, and OpenBSD does vgone. + */ #if defined(__OpenBSD__) - vgone(mp->mnt_syncer); + vgone(mp->mnt_syncer); #elif defined(__FreeBSD__) - vrele(mp->mnt_syncer); + vrele(mp->mnt_syncer); #else #error what os do you use ? #endif @@ -239,7 +259,7 @@ free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp) error = xfs_vflush(mp, flags); #ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER if (!unmountp) { - XFSDEB(XDEBNODE, ("free_all_xfs_nodes not flushing syncer vnode\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes not flushing syncer vnode\n")); if (mp->mnt_syncer == NULL) if (vfs_allocate_syncvnode(mp)) panic("failed to allocate syncer node when xfs daemon died"); @@ -247,62 +267,22 @@ free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp) #endif if (error) { - XFSDEB(XDEBNODE, ("xfree_all_xfs_nodes: vflush() error == %d\n", + NNPFSDEB(XDEBNODE, ("xfree_all_xfs_nodes: vflush() error == %d\n", error)); return error; } - XFSDEB(XDEBNODE, ("free_all_xfs_nodes done\n")); + NNPFSDEB(XDEBNODE, ("free_all_xfs_nodes done\n")); return error; } -struct xfs_node * -xfs_node_find(struct xfs *xfsp, xfs_handle *handlep) -{ - struct vnode *t; - struct xfs_node *xn = NULL; - - XFSDEB(XDEBNODE, ("xfs_node_find: xfsp = %lx " - " handlep = (%d,%d,%d,%d)\n", - (unsigned long)xfsp, - handlep->a, - handlep->b, - handlep->c, - handlep->d)); - - /* - * XXXSMP - the vnodes on mnt_vnodelist are invalid unless we hold - * mntvnode_slock (same on Open,Free and Net - current). - * XXX - Another problem here is that the data in the vnode doesn't - * have to be correct unless we do a vget first (if usecount on - * vnode == 0). This should only be a problem when someone uses - * revoke, when unmounting or when arlad dies or on systems - * with a shortage of vnodes. - * We might want to vget here, but that was a problem - * on FreeBSD once. - */ - -/* FreeBSD 4.5 and above did rename mnt_vnodelist to mnt_nvnodelist */ -#ifdef HAVE_STRUCT_MOUNT_MNT_NVNODELIST - TAILQ_FOREACH(t, &XFS_TO_VFS(xfsp)->mnt_nvnodelist, v_nmntvnodes) { - xn = VNODE_TO_XNODE(t); - if (xn && xfs_handle_eq(&xn->handle, handlep)) - break; - } -#else - LIST_FOREACH(t, &XFS_TO_VFS(xfsp)->mnt_vnodelist, v_mntvnodes) { - xn = VNODE_TO_XNODE(t); - if (xn && xfs_handle_eq(&xn->handle, handlep)) - break; - } +#ifndef LIST_FOREACH +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) #endif - if (t != NULL) - return xn; - else - return NULL; -} - void vattr2xfs_attr(const struct vattr *va, struct xfs_attr *xa) { @@ -327,31 +307,31 @@ vattr2xfs_attr(const struct vattr *va, struct xfs_attr *xa) XA_SET_FILEID(xa, va->va_fileid); switch (va->va_type) { case VNON: - xa->xa_type = XFS_FILE_NON; + xa->xa_type = NNPFS_FILE_NON; break; case VREG: - xa->xa_type = XFS_FILE_REG; + xa->xa_type = NNPFS_FILE_REG; break; case VDIR: - xa->xa_type = XFS_FILE_DIR; + xa->xa_type = NNPFS_FILE_DIR; break; case VBLK: - xa->xa_type = XFS_FILE_BLK; + xa->xa_type = NNPFS_FILE_BLK; break; case VCHR: - xa->xa_type = XFS_FILE_CHR; + xa->xa_type = NNPFS_FILE_CHR; break; case VLNK: - xa->xa_type = XFS_FILE_LNK; + xa->xa_type = NNPFS_FILE_LNK; break; case VSOCK: - xa->xa_type = XFS_FILE_SOCK; + xa->xa_type = NNPFS_FILE_SOCK; break; case VFIFO: - xa->xa_type = XFS_FILE_FIFO; + xa->xa_type = NNPFS_FILE_FIFO; break; case VBAD: - xa->xa_type = XFS_FILE_BAD; + xa->xa_type = NNPFS_FILE_BAD; break; default: panic("xfs_attr2attr: bad value"); @@ -369,8 +349,10 @@ xfs_attr2vattr(const struct xfs_attr *xa, struct vattr *va, int clear_node) va->va_mode = xa->xa_mode; if (XA_VALID_NLINK(xa)) va->va_nlink = xa->xa_nlink; - if (XA_VALID_SIZE(xa)) + if (XA_VALID_SIZE(xa)) { va->va_size = xa->xa_size; + va->va_bytes = va->va_size; + } if (XA_VALID_UID(xa)) va->va_uid = xa->xa_uid; if (XA_VALID_GID(xa)) @@ -389,31 +371,31 @@ xfs_attr2vattr(const struct xfs_attr *xa, struct vattr *va, int clear_node) } if (XA_VALID_TYPE(xa)) { switch (xa->xa_type) { - case XFS_FILE_NON: + case NNPFS_FILE_NON: va->va_type = VNON; break; - case XFS_FILE_REG: + case NNPFS_FILE_REG: va->va_type = VREG; break; - case XFS_FILE_DIR: + case NNPFS_FILE_DIR: va->va_type = VDIR; break; - case XFS_FILE_BLK: + case NNPFS_FILE_BLK: va->va_type = VBLK; break; - case XFS_FILE_CHR: + case NNPFS_FILE_CHR: va->va_type = VCHR; break; - case XFS_FILE_LNK: + case NNPFS_FILE_LNK: va->va_type = VLNK; break; - case XFS_FILE_SOCK: + case NNPFS_FILE_SOCK: va->va_type = VSOCK; break; - case XFS_FILE_FIFO: + case NNPFS_FILE_FIFO: va->va_type = VFIFO; break; - case XFS_FILE_BAD: + case NNPFS_FILE_BAD: va->va_type = VBAD; break; default: @@ -422,7 +404,6 @@ xfs_attr2vattr(const struct xfs_attr *xa, struct vattr *va, int clear_node) } va->va_flags = 0; va->va_blocksize = 8192; - va->va_bytes = va->va_size; } /* @@ -498,13 +479,13 @@ xfs_dnlc_enter(struct vnode *dvp, xfs_componentname *cnp, struct vnode *vp) { - XFSDEB(XDEBDNLC, ("xfs_dnlc_enter_cnp(%lx, %lx, %lx)\n", + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_enter_cnp(%lx, %lx, %lx)\n", (unsigned long)dvp, (unsigned long)cnp, (unsigned long)vp)); - XFSDEB(XDEBDNLC, ("xfs_dnlc_enter: v_id = %ld\n", dvp->v_id)); + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_enter: v_id = %lu\n", (u_long)dvp->v_id)); - XFSDEB(XDEBDNLC, ("xfs_dnlc_enter: calling cache_enter:" + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_enter: calling cache_enter:" "dvp = %lx, vp = %lx, cnp = (%s, %ld), " "nameiop = %lu, flags = %lx\n", (unsigned long)dvp, @@ -533,15 +514,15 @@ xfs_dnlc_enter(struct vnode *dvp, * The real change is sys/kern/vfs_cache:1.20 */ -#if __NetBSD_Version__ >= 104120000 || defined(__OpenBSD__) +#if __NetBSD_Version__ >= 104120000 || OpenBSD > 200211 if (cache_lookup(dvp, &dummy, cnp) != -1) { - VOP_UNLOCK(dummy, 0, cnp->cn_proc); - printf ("XFS PANIC WARNING! xfs_dnlc_enter: %s already in cache\n", + xfs_vfs_unlock(dummy, xfs_cnp_to_proc(cnp)); + printf ("NNPFS PANIC WARNING! xfs_dnlc_enter: %s already in cache\n", cnp->cn_nameptr); } #else if (cache_lookup(dvp, &dummy, cnp) != 0) { - printf ("XFS PANIC WARNING! xfs_dnlc_enter: %s already in cache\n", + printf ("NNPFS PANIC WARNING! xfs_dnlc_enter: %s already in cache\n", cnp->cn_nameptr); } #endif @@ -562,30 +543,42 @@ xfs_dnlc_enter(struct vnode *dvp, static void xfs_cnp_init (struct componentname *cn, const char *name, - struct proc *proc, struct ucred *cred, + d_thread_t *proc, struct ucred *cred, int nameiop) { - const unsigned char *p; - bzero(cn, sizeof(*cn)); cn->cn_nameptr = (char *)name; cn->cn_namelen = strlen(name); cn->cn_flags = 0; #if __APPLE__ { + const unsigned char *p; int i; cn->cn_hash = 0; for (p = cn->cn_nameptr, i = 1; *p; ++p, ++i) cn->cn_hash += *p * i; } +#elif defined(HAVE_KERNEL_NAMEI_HASH) + { + const char *cp = name + cn->cn_namelen; + cn->cn_hash = namei_hash(name, &cp); + } #elif defined(HAVE_STRUCT_COMPONENTNAME_CN_HASH) - cn->cn_hash = 0; - for (p = cn->cn_nameptr; *p; ++p) - cn->cn_hash += *p; + { + const unsigned char *p; + + cn->cn_hash = 0; + for (p = cn->cn_nameptr; *p; ++p) + cn->cn_hash += *p; + } #endif cn->cn_nameiop = nameiop; +#ifdef HAVE_FREEBSD_THREAD + cn->cn_thread = proc; +#else cn->cn_proc = proc; +#endif cn->cn_cred = cred; } @@ -601,7 +594,7 @@ xfs_dnlc_enter_name(struct vnode *dvp, { struct componentname cn; - XFSDEB(XDEBDNLC, ("xfs_dnlc_enter_name(%lx, \"%s\", %lx)\n", + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_enter_name(%lx, \"%s\", %lx)\n", (unsigned long)dvp, name, (unsigned long)vp)); @@ -623,12 +616,12 @@ xfs_dnlc_lookup_int(struct vnode *dvp, int error; u_long saved_flags; - XFSDEB(XDEBDNLC, ("xfs_dnlc_lookup(%lx, \"%s\")\n", + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_lookup(%lx, \"%s\")\n", (unsigned long)dvp, cnp->cn_nameptr)); - XFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: v_id = %ld\n", dvp->v_id)); + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: v_id = %lu\n", (u_long)dvp->v_id)); - XFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: calling cache_lookup:" + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: calling cache_lookup:" "dvp = %lx, cnp = (%s, %ld), flags = %lx\n", (unsigned long)dvp, cnp->cn_nameptr, cnp->cn_namelen, @@ -641,7 +634,7 @@ xfs_dnlc_lookup_int(struct vnode *dvp, cnp->cn_flags = saved_flags; - XFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: cache_lookup returned. " + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_lookup: cache_lookup returned. " "error = %d, *res = %lx\n", error, (unsigned long)*res)); return error; @@ -671,16 +664,26 @@ xfs_dnlc_lock(struct vnode *dvp, } else if (cnp->cn_flags & ISDOTDOT) { /* ".." */ u_long vpid = dvp->v_id; +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_unlock(dvp, xfs_cnp_to_thread(cnp)); + error = xfs_do_vget(*res, LK_EXCLUSIVE, xfs_cnp_to_thread(cnp)); + xfs_vfs_writelock(dvp, xfs_cnp_to_thread(cnp)); +#else xfs_vfs_unlock(dvp, xfs_cnp_to_proc(cnp)); error = xfs_do_vget(*res, LK_EXCLUSIVE, xfs_cnp_to_proc(cnp)); xfs_vfs_writelock(dvp, xfs_cnp_to_proc(cnp)); +#endif if (error == 0 && dvp->v_id != vpid) { vput(*res); return 0; } } else { +#ifdef HAVE_FREEBSD_THREAD + error = xfs_do_vget(*res, LK_EXCLUSIVE, xfs_cnp_to_thread(cnp)); +#else error = xfs_do_vget(*res, LK_EXCLUSIVE, xfs_cnp_to_proc(cnp)); +#endif } if (error == 0) @@ -722,7 +725,7 @@ xfs_dnlc_lookup(struct vnode *dvp, return xfs_dnlc_lock (dvp, cnp, res); } -#else /* ! __NetBSD_Version__ >= 104120000 */ +#else /* ! __NetBSD_Version__ >= 104120000 && ! OpenBSD > 200211 */ int xfs_dnlc_lookup(struct vnode *dvp, @@ -740,7 +743,7 @@ xfs_dnlc_lookup(struct vnode *dvp, return xfs_dnlc_lock (dvp, cnp, res); } -#endif /* __NetBSD_Version__ >= 104120000 */ +#endif /* __NetBSD_Version__ >= 104120000 || OpenBSD > 200211 */ /* * Remove one entry from the DNLC @@ -749,7 +752,7 @@ xfs_dnlc_lookup(struct vnode *dvp, void xfs_dnlc_purge (struct vnode *vp) { - XFSDEB(XDEBDNLC, ("xfs_dnlc_purge\n")); + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_purge\n")); if (tbl.dvp == vp || tbl.vp == vp) tbl_clear (); @@ -764,7 +767,7 @@ xfs_dnlc_purge (struct vnode *vp) void xfs_dnlc_purge_mp(struct mount *mp) { - XFSDEB(XDEBDNLC, ("xfs_dnlc_purge_mp()\n")); + NNPFSDEB(XDEBDNLC, ("xfs_dnlc_purge_mp()\n")); tbl_clear (); cache_purgevfs(mp); @@ -785,3 +788,21 @@ xfs_has_pag(const struct xfs_node *xn, xfs_pag_t pag) return 0; } + +void +xfs_update_write_cred(struct xfs_node *xn, struct ucred *cred) +{ + if (xn->wr_cred) + crfree (xn->wr_cred); + crhold (cred); + xn->wr_cred = cred; +} + +void +xfs_update_read_cred(struct xfs_node *xn, struct ucred *cred) +{ + if (xn->rd_cred) + crfree (xn->rd_cred); + crhold (cred); + xn->rd_cred = cred; +} diff --git a/sys/xfs/xfs_node.h b/sys/xfs/xfs_node.h index 83c4145cde3..2aef3a3e571 100644 --- a/sys/xfs/xfs_node.h +++ b/sys/xfs/xfs_node.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,22 +31,20 @@ * SUCH DAMAGE. */ -/* $Id: xfs_node.h,v 1.7 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_node.h,v 1.33 2003/01/25 18:48:28 lha Exp $ */ #ifndef _xfs_xnode_h #define _xfs_xnode_h #include <sys/types.h> #include <sys/time.h> -#if defined(_KERNEL) || !defined(__OpenBSD__) -#include <sys/vnode.h> -#endif -#ifdef __NetBSD__ +#ifdef HAVE_KERNEL_LF_ADVLOCK #include <sys/lockf.h> -#endif /* __NetBSD__ */ +#endif #include <xfs/xfs_attr.h> #include <xfs/xfs_message.h> +#include <xfs/xfs_queue.h> #ifdef __APPLE__ typedef struct lock__bsd__ xfs_vnode_lock; @@ -55,9 +53,13 @@ typedef struct lock xfs_vnode_lock; #endif struct xfs_node { +#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000 + struct genfs_node gnode; +#endif struct vnode *vn; struct vnode *data; struct vattr attr; + uint32_t offset; u_int flags; u_int tokens; xfs_handle handle; @@ -69,14 +71,37 @@ struct xfs_node { #else int vnlocks; #endif -#ifdef __NetBSD__ - struct lockf *i_lockf; +#ifdef HAVE_KERNEL_LF_ADVLOCK + struct lockf *lockf; #endif - struct ucred *cred; + struct ucred *rd_cred; + struct ucred *wr_cred; + NNPQUEUE_ENTRY(xfs_node) nn_hash; }; -int xfs_getnewvnode(struct mount *mp, struct vnode **vpp, - struct xfs_handle *handle); +#define XN_HASHSIZE 101 + +NNPQUEUE_HEAD(nh_node_list, xfs_node); + +struct xfs_nodelist_head { + struct nh_node_list nh_nodelist[XN_HASHSIZE]; +}; + +void nnfs_init_head(struct xfs_nodelist_head *); +void xfs_node_purge(struct xfs_nodelist_head *, + void (*func)(struct xfs_node *)); +struct xfs_node * + xfs_node_find(struct xfs_nodelist_head *, xfs_handle *); +void xfs_remove_node(struct xfs_nodelist_head *, struct xfs_node *); +void xfs_insert(struct xfs_nodelist_head *, struct xfs_node *); +int xfs_update_handle(struct xfs_nodelist_head *, xfs_handle *, + xfs_handle *); + + +struct xfs; + +int xfs_getnewvnode(struct xfs *xfsp, struct vnode **vpp, + struct xfs_handle *handle); #define DATA_FROM_VNODE(vp) DATA_FROM_XNODE(VNODE_TO_XNODE(vp)) @@ -130,4 +155,7 @@ typedef int vop_t (void *); #define LK_SHARED 1 #endif +void xfs_update_write_cred(struct xfs_node *, struct ucred *); +void xfs_update_read_cred(struct xfs_node *, struct ucred *); + #endif /* _xfs_xnode_h */ diff --git a/sys/xfs/xfs_syscalls-common.c b/sys/xfs/xfs_syscalls-common.c index fae1c4ae024..491ae9ddd2c 100644 --- a/sys/xfs/xfs_syscalls-common.c +++ b/sys/xfs/xfs_syscalls-common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,10 +33,10 @@ #include <xfs/xfs_locl.h> -RCSID("$Id: xfs_syscalls-common.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_syscalls-common.c,v 1.72 2003/01/19 20:53:49 lha Exp $"); /* - * XFS system calls. + * NNPFS system calls. */ #include <xfs/xfs_syscalls.h> @@ -54,43 +54,77 @@ RCSID("$Id: xfs_syscalls-common.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); #include <sys/ioctl.h> #endif /* - * XXX - horrible kludge. If we're built without HAVE_CONFIG_H we assume that - * we're built inside the kernel on OpenBSD. + * XXX - horrible kludge. If we are openbsd and not building an lkm, + * then use their headerfile. */ -#ifdef HAVE_CONFIG_H +#if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(_LKM) +#define NNPFS_NOT_LKM 1 +#elif defined(__FreeBSD__) && !defined(KLD_MODULE) +#define NNPFS_NOT_LKM 1 +#endif + +#ifdef NNPFS_NOT_LKM +#include <xfs/xfs_pioctl.h> +#else #include <kafs.h> +#endif + +int (*old_setgroups_func)(syscall_d_thread_t *p, void *v, register_t *retval); + +#if defined(__FreeBSD__) && __FreeBSD_version >= 500026 +/* + * XXX This is wrong + */ +static struct ucred * +xfs_crcopy(struct ucred *cr) +{ + struct ucred *ncr; + + if (crshared(cr)) { + ncr = crdup(cr); + crfree(cr); + return ncr; + } + return cr; +} #else -#include <xfs/xfs_pioctl.h> +#define xfs_crcopy crcopy #endif + /* * the syscall entry point */ -#if defined(_LKM) || defined(KLD_MODULE) || defined(__osf__) || defined(__APPLE__) +#ifdef NNPFS_NOT_LKM int -xfspioctl(struct proc *proc, void *varg, register_t *return_value) +sys_xfspioctl(syscall_d_thread_t *proc, void *varg, register_t *return_value) #else int -sys_xfspioctl(struct proc *proc, void *varg, register_t *return_value) +xfspioctl(syscall_d_thread_t *proc, void *varg, register_t *return_value) #endif { -#if defined(_LKM) || defined(KLD_MODULE) || defined(__osf__) || defined(__APPLE__) - struct sys_pioctl_args *arg = (struct sys_pioctl_args *) varg; -#else +#ifdef NNPFS_NOT_LKM struct sys_xfspioctl_args *arg = (struct sys_xfspioctl_args *) varg; +#else + struct sys_pioctl_args *arg = (struct sys_pioctl_args *) varg; #endif int error = EINVAL; switch (SCARG(arg, operation)) { case AFSCALL_PIOCTL: - error = xfs_pioctl_call(proc, varg, return_value); + error = xfs_pioctl_call(syscall_thread_to_thread(proc), + varg, return_value); break; case AFSCALL_SETPAG: - error = xfs_setpag_call(&xfs_proc_to_cred(proc)); +#ifdef HAVE_FREEBSD_THREAD + error = xfs_setpag_call(&xfs_thread_to_cred(proc)); +#else + error = xfs_setpag_call(&xfs_proc_to_cred(syscall_thread_to_thread(proc))); +#endif break; default: - XFSDEB(XDEBSYS, ("Unimplemeted xfspioctl: %d\n", + NNPFSDEB(XDEBSYS, ("Unimplemeted xfspioctl: %d\n", SCARG(arg, operation))); error = EINVAL; break; @@ -105,13 +139,13 @@ sys_xfspioctl(struct proc *proc, void *varg, register_t *return_value) * 32512 <= g1 <= 48896 */ -#define XFS_PAG1_LLIM 33536 -#define XFS_PAG1_ULIM 34560 -#define XFS_PAG2_LLIM 32512 -#define XFS_PAG2_ULIM 48896 +#define NNPFS_PAG1_LLIM 33536 +#define NNPFS_PAG1_ULIM 34560 +#define NNPFS_PAG2_LLIM 32512 +#define NNPFS_PAG2_ULIM 48896 -static gid_t pag_part_one = XFS_PAG1_LLIM; -static gid_t pag_part_two = XFS_PAG2_LLIM; +static gid_t pag_part_one = NNPFS_PAG1_LLIM; +static gid_t pag_part_two = NNPFS_PAG2_LLIM; /* * Is `cred' member of a PAG? @@ -123,10 +157,10 @@ xfs_is_pag(struct ucred *cred) /* The first group is the gid of the user ? */ if (cred->cr_ngroups >= 3 && - cred->cr_groups[1] >= XFS_PAG1_LLIM && - cred->cr_groups[1] <= XFS_PAG1_ULIM && - cred->cr_groups[2] >= XFS_PAG2_LLIM && - cred->cr_groups[2] <= XFS_PAG2_ULIM) + cred->cr_groups[1] >= NNPFS_PAG1_LLIM && + cred->cr_groups[1] <= NNPFS_PAG1_ULIM && + cred->cr_groups[2] >= NNPFS_PAG2_LLIM && + cred->cr_groups[2] <= NNPFS_PAG2_ULIM) return 1; else return 0; @@ -163,14 +197,14 @@ store_pag (struct ucred **ret_cred, gid_t part1, gid_t part2) if (cred->cr_ngroups + 2 >= NGROUPS) return E2BIG; - cred = crcopy (cred); + cred = xfs_crcopy (cred); for (i = cred->cr_ngroups - 1; i > 0; i--) { cred->cr_groups[i + 2] = cred->cr_groups[i]; } cred->cr_ngroups += 2; } else { - cred = crcopy (cred); + cred = xfs_crcopy (cred); } cred->cr_groups[1] = part1; cred->cr_groups[2] = part2; @@ -192,14 +226,14 @@ xfs_setpag_call(struct ucred **ret_cred) if (ret) return ret; - if (pag_part_two > XFS_PAG2_ULIM) { + if (pag_part_two > NNPFS_PAG2_ULIM) { pag_part_one++; - pag_part_two = XFS_PAG2_LLIM; + pag_part_two = NNPFS_PAG2_LLIM; } return 0; } -#if defined(_LKM) || defined(KLD_MODULE) || defined(__osf__) || defined(__APPLE__) +#ifndef NNPFS_NOT_LKM /* * remove a pag */ @@ -222,11 +256,16 @@ xfs_unpag (struct ucred *cred) */ int -xfs_setgroups (struct proc *p, - void *varg) +xfs_setgroups (syscall_d_thread_t *p, + void *varg, + register_t *retval) { struct xfs_setgroups_args *uap = (struct xfs_setgroups_args *)varg; - struct ucred **cred = &xfs_proc_to_cred(p); +#ifdef HAVE_FREEBSD_THREAD + struct ucred **cred = &xfs_thread_to_cred(p); +#else + struct ucred **cred = &xfs_proc_to_cred(syscall_thread_to_thread(p)); +#endif if (xfs_is_pag (*cred)) { gid_t part1, part2; @@ -237,14 +276,14 @@ xfs_setgroups (struct proc *p, part1 = (*cred)->cr_groups[1]; part2 = (*cred)->cr_groups[2]; - ret = (*old_setgroups_func) (p, uap); + ret = (*old_setgroups_func) (p, uap, retval); if (ret) return ret; return store_pag (cred, part1, part2); } else { int ret; - ret = (*old_setgroups_func) (p, uap); + ret = (*old_setgroups_func) (p, uap, retval); /* don't support setting a PAG */ if (xfs_is_pag (*cred)) { xfs_unpag (*cred); @@ -253,7 +292,7 @@ xfs_setgroups (struct proc *p, return ret; } } -#endif +#endif /* !NNPFS_NOT_LKM */ /* * Return the vnode corresponding to `pathptr' @@ -263,7 +302,7 @@ static int lookup_node (const char *pathptr, int follow_links_p, struct vnode **res, - struct proc *proc) + d_thread_t *proc) { int error; char path[MAXPATHLEN]; @@ -275,12 +314,12 @@ lookup_node (const char *pathptr, struct vnode *vp; size_t count; - XFSDEB(XDEBSYS, ("xfs_syscall: looking up: %lx\n", + NNPFSDEB(XDEBSYS, ("xfs_syscall: looking up: %lx\n", (unsigned long)pathptr)); error = copyinstr((char *) pathptr, path, MAXPATHLEN, &count); - XFSDEB(XDEBSYS, ("xfs_syscall: looking up: %s, error: %d\n", path, error)); + NNPFSDEB(XDEBSYS, ("xfs_syscall: looking up: %s, error: %d\n", path, error)); if (error) return error; @@ -292,7 +331,7 @@ lookup_node (const char *pathptr, error = namei(ndp); if (error != 0) { - XFSDEB(XDEBSYS, ("xfs_syscall: error during namei: %d\n", error)); + NNPFSDEB(XDEBSYS, ("xfs_syscall: error during namei: %d\n", error)); return EINVAL; } @@ -308,7 +347,7 @@ lookup_node (const char *pathptr, */ static int -getfh_compat (struct proc *p, +getfh_compat (d_thread_t *p, struct ViceIoctl *vice_ioctl, struct vnode *vp) { @@ -336,9 +375,8 @@ getfh_compat (struct proc *p, * implement xfs fhget by combining (dev, ino, generation) */ -#ifndef __OpenBSD__ static int -trad_fhget (struct proc *p, +trad_fhget (d_thread_t *p, struct ViceIoctl *vice_ioctl, struct vnode *vp) { @@ -349,7 +387,11 @@ trad_fhget (struct proc *p, struct xfs_fhandle_t xfs_handle; struct xfs_fh_args fh_args; +#ifdef HAVE_FREEBSD_THREAD + xfs_vop_getattr(vp, &vattr, xfs_thread_to_cred(p), p, error); +#else xfs_vop_getattr(vp, &vattr, xfs_proc_to_cred(p), p, error); +#endif if (error) return error; @@ -368,11 +410,10 @@ trad_fhget (struct proc *p, error = copyout (&xfs_handle, vice_ioctl->out, len); if (error) { - XFSDEB(XDEBSYS, ("fhget_call: copyout failed: %d\n", error)); + NNPFSDEB(XDEBSYS, ("fhget_call: copyout failed: %d\n", error)); } return error; } -#endif /* !__OpenBSD__ */ /* * return file handle of `vp' in vice_ioctl->out @@ -380,13 +421,13 @@ trad_fhget (struct proc *p, */ static int -fhget_call (struct proc *p, +fhget_call (d_thread_t *p, struct ViceIoctl *vice_ioctl, struct vnode *vp) { int error; - XFSDEB(XDEBSYS, ("fhget_call\n")); + NNPFSDEB(XDEBSYS, ("fhget_call\n")); if (vp == NULL) return EBADF; @@ -415,14 +456,14 @@ out: */ static int -fhopen_call (struct proc *p, +fhopen_call (d_thread_t *p, struct ViceIoctl *vice_ioctl, struct vnode *vp, int flags, register_t *retval) { - XFSDEB(XDEBSYS, ("fhopen_call: flags = %d\n", flags)); + NNPFSDEB(XDEBSYS, ("fhopen_call: flags = %d\n", flags)); if (vp != NULL) { vrele (vp); @@ -444,7 +485,7 @@ fhopen_call (struct proc *p, */ static int -remote_pioctl (struct proc *p, +remote_pioctl (d_thread_t *p, struct sys_pioctl_args *arg, struct ViceIoctl *vice_ioctl, struct vnode *vp) @@ -457,7 +498,7 @@ remote_pioctl (struct proc *p, struct xfs_node *xn; if (vp->v_tag != VT_AFS) { - XFSDEB(XDEBSYS, ("xfs_syscall: file is not in afs\n")); + NNPFSDEB(XDEBSYS, ("xfs_syscall: file is not in afs\n")); vrele(vp); return EINVAL; } @@ -468,27 +509,36 @@ remote_pioctl (struct proc *p, vrele(vp); } - if (vice_ioctl->in_size > 2048) { + if (vice_ioctl->in_size < 0) { + printf("xfs: remote pioctl: got a negative data size: opcode: %d", + SCARG(arg, a_opcode)); + return EINVAL; + } + + if (vice_ioctl->in_size > NNPFS_MSG_MAX_DATASIZE) { printf("xfs_pioctl_call: got a humongous in packet: opcode: %d", SCARG(arg, a_opcode)); return EINVAL; } if (vice_ioctl->in_size != 0) { - error = copyin(vice_ioctl->in, - &msg.msg, - vice_ioctl->in_size); - + error = copyin(vice_ioctl->in, msg.msg, vice_ioctl->in_size); if (error) return error; } - msg.header.opcode = XFS_MSG_PIOCTL; + msg.header.opcode = NNPFS_MSG_PIOCTL; + msg.header.size = sizeof(msg); msg.opcode = SCARG(arg, a_opcode); msg.insize = vice_ioctl->in_size; msg.outsize = vice_ioctl->out_size; +#ifdef HAVE_FREEBSD_THREAD + msg.cred.uid = xfs_thread_to_euid(p); + msg.cred.pag = xfs_get_pag(xfs_thread_to_cred(p)); +#else msg.cred.uid = xfs_proc_to_euid(p); msg.cred.pag = xfs_get_pag(xfs_proc_to_cred(p)); +#endif error = xfs_message_rpc(0, &msg.header, sizeof(msg), p); /* XXX */ msg2 = (struct xfs_message_wakeup_data *) &msg; @@ -498,14 +548,24 @@ remote_pioctl (struct proc *p, if (error == ENODEV) error = EINVAL; - if (error == 0 && msg2->header.opcode == XFS_MSG_WAKEUP_DATA) - error = copyout(msg2->msg, vice_ioctl->out, - min(msg2->len, vice_ioctl->out_size)); + if (error == 0 && msg2->header.opcode == NNPFS_MSG_WAKEUP_DATA) { + int len; + + len = msg2->len; + if (len > vice_ioctl->out_size) + len = vice_ioctl->out_size; + if (len > NNPFS_MSG_MAX_DATASIZE) + len = NNPFS_MSG_MAX_DATASIZE; + if (len < 0) + len = 0; + + error = copyout(msg2->msg, vice_ioctl->out, len); + } return error; } static int -xfs_debug (struct proc *p, +xfs_debug (d_thread_t *p, struct ViceIoctl *vice_ioctl) { int32_t flags; @@ -548,7 +608,7 @@ xfs_debug (struct proc *p, */ int -xfs_pioctl_call(struct proc *proc, +xfs_pioctl_call(d_thread_t *proc, struct sys_pioctl_args *arg, register_t *return_value) { @@ -557,7 +617,7 @@ xfs_pioctl_call(struct proc *proc, char *pathptr; struct vnode *vp = NULL; - XFSDEB(XDEBSYS, ("xfs_syscall(%d, %lx, %d, %lx, %d)\n", + NNPFSDEB(XDEBSYS, ("xfs_syscall(%d, %lx, %d, %lx, %d)\n", SCARG(arg, operation), (unsigned long)SCARG(arg, a_pathP), SCARG(arg, a_opcode), @@ -588,12 +648,12 @@ xfs_pioctl_call(struct proc *proc, case VIOC_FHOPEN : return fhopen_call (proc, &vice_ioctl, vp, SCARG(arg, a_followSymlinks), return_value); - case VIOC_XFSDEBUG : + case VIOC_NNPFSDEBUG : if (vp != NULL) vrele (vp); return xfs_debug (proc, &vice_ioctl); default : - XFSDEB(XDEBSYS, ("a_opcode = %x\n", SCARG(arg, a_opcode))); + NNPFSDEB(XDEBSYS, ("a_opcode = %x\n", SCARG(arg, a_opcode))); return remote_pioctl (proc, arg, &vice_ioctl, vp); } } diff --git a/sys/xfs/xfs_syscalls.h b/sys/xfs/xfs_syscalls.h index 6971283ba30..41249d06e43 100644 --- a/sys/xfs/xfs_syscalls.h +++ b/sys/xfs/xfs_syscalls.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_syscalls.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_syscalls.h,v 1.29 2003/01/19 20:53:54 lha Exp $ */ #ifndef __xfs_syscalls #define __xfs_syscalls @@ -39,7 +39,7 @@ #include <xfs/xfs_common.h> #include <xfs/xfs_message.h> -#include <xfs/afssysdefs.h> +#include <afssysdefs.h> struct sys_pioctl_args { syscallarg(int) operation; @@ -49,12 +49,12 @@ struct sys_pioctl_args { syscallarg(int) a_followSymlinks; }; -#define XFS_FHMAXDATA 40 +#define NNPFS_FHMAXDATA 40 struct xfs_fhandle_t { u_short len; u_short pad; - char fhdata[XFS_FHMAXDATA]; + char fhdata[NNPFS_FHMAXDATA]; }; struct xfs_fh_args { @@ -69,16 +69,15 @@ int xfs_stat_syscalls(void); xfs_pag_t xfs_get_pag(struct ucred *); int xfs_setpag_call(struct ucred **ret_cred); -int xfs_pioctl_call(struct proc *proc, +int xfs_pioctl_call(d_thread_t *proc, struct sys_pioctl_args *args, register_t *return_value); -int xfspioctl(struct proc *proc, void *varg, register_t *retval); +int xfspioctl(syscall_d_thread_t *proc, void *varg, register_t *retval); -int xfs_setgroups (struct proc *p, - void *varg); +int xfs_setgroups(syscall_d_thread_t *p, void *varg, register_t *retval); -extern int (*old_setgroups_func)(struct proc *, void *); +extern int (*old_setgroups_func)(syscall_d_thread_t *, void *, register_t *); extern int xfs_syscall_num; /* The old syscall number */ diff --git a/sys/xfs/xfs_vfsops-bsd.c b/sys/xfs/xfs_vfsops-bsd.c index 9df6f14fd3b..56da67ae471 100644 --- a/sys/xfs/xfs_vfsops-bsd.c +++ b/sys/xfs/xfs_vfsops-bsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,10 +33,10 @@ #include <xfs/xfs_locl.h> -RCSID("$Id: xfs_vfsops-bsd.c,v 1.8 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_vfsops-bsd.c,v 1.72 2002/12/19 10:30:17 lha Exp $"); /* - * XFS vfs operations. + * NNPFS vfs operations. */ #include <xfs/xfs_common.h> @@ -49,32 +49,28 @@ RCSID("$Id: xfs_vfsops-bsd.c,v 1.8 2002/06/07 04:10:32 hin Exp $"); #include <xfs/xfs_vnodeops.h> int -xfs_mount(struct mount *mp, - const char *user_path, -#ifdef __OpenBSD__ - void *user_data, -#else - caddr_t user_data, -#endif - struct nameidata *ndp, - struct proc *p) +xfs_mount_caddr(struct mount *mp, + const char *user_path, + caddr_t user_data, + struct nameidata *ndp, + d_thread_t *p) { return xfs_mount_common(mp, user_path, user_data, ndp, p); } int -xfs_start(struct mount * mp, int flags, struct proc * p) +xfs_start(struct mount * mp, int flags, d_thread_t * p) { - XFSDEB(XDEBVFOPS, ("xfs_start mp = %lx, flags = %d, proc = %lx\n", + NNPFSDEB(XDEBVFOPS, ("xfs_start mp = %lx, flags = %d, proc = %lx\n", (unsigned long)mp, flags, (unsigned long)p)); return 0; } int -xfs_unmount(struct mount * mp, int mntflags, struct proc *p) +xfs_unmount(struct mount * mp, int mntflags, d_thread_t *p) { - XFSDEB(XDEBVFOPS, ("xfs_umount: mp = %lx, mntflags = %d, proc = %lx\n", + NNPFSDEB(XDEBVFOPS, ("xfs_umount: mp = %lx, mntflags = %d, proc = %lx\n", (unsigned long)mp, mntflags, (unsigned long)p)); return xfs_unmount_common(mp, mntflags); } @@ -82,14 +78,18 @@ xfs_unmount(struct mount * mp, int mntflags, struct proc *p) int xfs_root(struct mount *mp, struct vnode **vpp) { - XFSDEB(XDEBVFOPS, ("xfs_root mp = %lx\n", (unsigned long)mp)); + NNPFSDEB(XDEBVFOPS, ("xfs_root mp = %lx\n", (unsigned long)mp)); +#ifdef HAVE_FREEBSD_THREAD + return xfs_root_common(mp, vpp, xfs_curthread(), xfs_curthread()->td_proc->p_ucred); +#else return xfs_root_common(mp, vpp, xfs_curproc(), xfs_curproc()->p_ucred); +#endif } int -xfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct proc *p) +xfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p) { - XFSDEB(XDEBVFOPS, ("xfs_quotactl: mp = %lx, cmd = %d, uid = %u, " + NNPFSDEB(XDEBVFOPS, ("xfs_quotactl: mp = %lx, cmd = %d, uid = %u, " "arg = %lx, proc = %lx\n", (unsigned long)mp, cmd, uid, (unsigned long)arg, (unsigned long)p)); @@ -97,9 +97,9 @@ xfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct proc *p) } int -xfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p) +xfs_statfs(struct mount *mp, struct statfs *sbp, d_thread_t *p) { - XFSDEB(XDEBVFOPS, ("xfs_statfs: mp = %lx, sbp = %lx, proc = %lx\n", + NNPFSDEB(XDEBVFOPS, ("xfs_statfs: mp = %lx, sbp = %lx, proc = %lx\n", (unsigned long)mp, (unsigned long)sbp, (unsigned long)p)); @@ -108,9 +108,9 @@ xfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p) } int -xfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct proc *p) +xfs_sync(struct mount *mp, int waitfor, struct ucred *cred, d_thread_t *p) { - XFSDEB(XDEBVFOPS, ("xfs_sync: mp = %lx, waitfor = %d, " + NNPFSDEB(XDEBVFOPS, ("xfs_sync: mp = %lx, waitfor = %d, " "cred = %lx, proc = %lx\n", (unsigned long)mp, waitfor, @@ -128,53 +128,35 @@ xfs_vget(struct mount * mp, #endif struct vnode ** vpp) { - XFSDEB(XDEBVFOPS, ("xfs_vget\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_vget\n")); return EOPNOTSUPP; } -#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP -int -xfs_fhtovp(struct mount * mp, +static int +common_fhtovp(struct mount * mp, struct fid * fhp, struct vnode ** vpp) -#else -int -xfs_fhtovp(struct mount * mp, - struct fid * fhp, - struct mbuf * nam, - struct vnode ** vpp, - int *exflagsp, - struct ucred ** credanonp) -#endif { #ifdef ARLA_KNFS - static struct ucred fhtovpcred; struct netcred *np = NULL; struct xfs_node *xn; struct vnode *vp; xfs_handle handle; int error; - XFSDEB(XDEBVFOPS, ("xfs_fhtovp\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_fhtovp\n")); if (fhp->fid_len != 16) { printf("xfs_fhtovp: *PANIC* got a invalid length of a fid\n"); return EINVAL; } - /* XXX: Should see if we is exported to this client */ -#if 0 - np = vfs_export_lookup(mp, &ump->um_export, nam); - if (np == NULL) - return EACCES; -#endif - memcpy(&handle, fhp->fid_data, sizeof(handle)); - XFSDEB(XDEBVFOPS, ("xfs_fhtovp: fid: %d.%d.%d.%d\n", + NNPFSDEB(XDEBVFOPS, ("xfs_fhtovp: fid: %d.%d.%d.%d\n", handle.a, handle.d, handle.c, handle.d)); - XFSDEB(XDEBVFOPS, ("xfs_fhtovp: xfs_vnode_find\n")); - xn = xfs_node_find(&xfs[0], &handle); /* XXX: 0 */ + NNPFSDEB(XDEBVFOPS, ("xfs_fhtovp: xfs_vnode_find\n")); + xn = xfs_node_find(&xfs[0].nodehead, &handle); if (xn == NULL) { struct xfs_message_getattr msg; @@ -197,33 +179,72 @@ xfs_fhtovp(struct mount * mp, error = 0; } - if (error == 0) { - fhtovpcred.cr_uid = 0; - fhtovpcred.cr_gid = 0; - fhtovpcred.cr_ngroups = 0; - - *vpp = vp; -#ifdef MNT_EXPUBLIC - *exflagsp = MNT_EXPUBLIC; -#else - *exflagsp = 0; -#endif - *credanonp = &fhtovpcred; + *vpp = vp; - XFSDEB(XDEBVFOPS, ("xfs_fhtovp done\n")); + if (error == 0) { + NNPFSDEB(XDEBVFOPS, ("xfs_fhtovp done\n")); /* * XXX tell arla about this node is hold by nfsd. * There need to be code in xfs_write too. */ } else - XFSDEB(XDEBVFOPS, ("xfs_fhtovp failed (%d)\n", error)); + NNPFSDEB(XDEBVFOPS, ("xfs_fhtovp failed (%d)\n", error)); return error; -#else +#else /* !ARLA_KNFS */ return EOPNOTSUPP; +#endif /* !ARLA_KNFS */ +} + +/* new style fhtovp */ + +#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP +int +xfs_fhtovp(struct mount * mp, + struct fid * fhp, + struct vnode ** vpp) +{ + return common_fhtovp (mp, fhp, vpp); +} + +#else /* !HAVE_STRUCT_VFSOPS_VFS_CHECKEXP */ + +/* old style fhtovp */ + +int +xfs_fhtovp(struct mount * mp, + struct fid * fhp, + struct mbuf * nam, + struct vnode ** vpp, + int *exflagsp, + struct ucred ** credanonp) +{ + static struct ucred fhtovpcred; + int error; + + /* XXX: Should see if we is exported to this client */ +#if 0 + np = vfs_export_lookup(mp, &ump->um_export, nam); + if (np == NULL) + return EACCES; #endif + error = common_fhtovp(mp, fhp, vpp); + if (error == 0) { + fhtovpcred.cr_uid = 0; + fhtovpcred.cr_gid = 0; + fhtovpcred.cr_ngroups = 0; + +#ifdef MNT_EXPUBLIC + *exflagsp = MNT_EXPUBLIC; +#else + *exflagsp = 0; +#endif + *credanonp = &fhtovpcred; + } + return error; } +#endif /* !HAVE_STRUCT_VFSOPS_VFS_CHECKEXP */ int xfs_checkexp (struct mount *mp, @@ -235,8 +256,16 @@ xfs_checkexp (struct mount *mp, int *exflagsp, struct ucred **credanonp) { - XFSDEB(XDEBVFOPS, ("xfs_checkexp\n")); - return EOPNOTSUPP; + struct netcred *np; + + NNPFSDEB(XDEBVFOPS, ("xfs_checkexp\n")); + +#if 0 + np = vfs_export_lookup(mp, &ump->um_export, nam); + if (np == NULL) + return EACCES; +#endif + return 0; } int @@ -245,7 +274,7 @@ xfs_vptofh(struct vnode * vp, { #ifdef ARLA_KNFS struct xfs_node *xn; - XFSDEB(XDEBVFOPS, ("xfs_vptofh\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_vptofh\n")); if (MAXFIDSZ < 16) return EOPNOTSUPP; @@ -260,7 +289,7 @@ xfs_vptofh(struct vnode * vp, return 0; #else - XFSDEB(XDEBVFOPS, ("xfs_vptofh\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_vptofh\n")); return EOPNOTSUPP; #endif } @@ -293,7 +322,7 @@ xfs_dead_lookup(struct vop_lookup_args * ap) */ int -xfs_fhlookup (struct proc *proc, +xfs_fhlookup (d_thread_t *proc, struct xfs_fhandle_t *fhp, struct vnode **vpp) { @@ -305,7 +334,7 @@ xfs_fhlookup (struct proc *proc, fsid_t fsid; struct xfs_fh_args *fh_args = (struct xfs_fh_args *)fhp->fhdata; - XFSDEB(XDEBVFOPS, ("xfs_fhlookup (xfs)\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_fhlookup (xfs)\n")); error = xfs_suser (proc); if (error) @@ -322,7 +351,7 @@ xfs_fhlookup (struct proc *proc, #ifdef __APPLE__ { - u_int32_t ino = SCARG(fh_args, fileid); + uint32_t ino = SCARG(fh_args, fileid); error = VFS_VGET(mp, &ino, vpp); } #else @@ -349,7 +378,7 @@ xfs_fhlookup (struct proc *proc, { fhandle_t *fh = (fhandle_t *) fhp; - XFSDEB(XDEBVFOPS, ("xfs_fhlookup (native)\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_fhlookup (native)\n")); mp = xfs_vfs_getvfs (&fh->fh_fsid); if (mp == NULL) @@ -364,7 +393,11 @@ xfs_fhlookup (struct proc *proc, #ifdef HAVE_KERNEL_VFS_OBJECT_CREATE if ((*vpp)->v_type == VREG && (*vpp)->v_object == NULL) +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_object_create (*vpp, proc, proc->td_proc->p_ucred); +#else xfs_vfs_object_create (*vpp, proc, proc->p_ucred); +#endif #elif __APPLE__ if ((*vpp)->v_type == VREG && (!UBCINFOEXISTS(*vpp))) { ubc_info_init(*vpp); @@ -385,30 +418,32 @@ xfs_fhlookup (struct proc *proc, extern struct fileops vnops; /* sometimes declared in <file.h> */ int -xfs_fhopen (struct proc *proc, +xfs_fhopen (d_thread_t *proc, struct xfs_fhandle_t *fhp, int user_flags, register_t *retval) { int error; struct vnode *vp; +#ifdef HAVE_FREEBSD_THREAD + struct ucred *cred = proc->td_proc->p_ucred; +#else struct ucred *cred = proc->p_ucred; +#endif int flags = FFLAGS(user_flags); int index; struct file *fp; int mode; struct xfs_fhandle_t fh; - XFSDEB(XDEBVFOPS, ("xfs_fhopen: flags = %d\n", user_flags)); - - panic("Pjäxa"); + NNPFSDEB(XDEBVFOPS, ("xfs_fhopen: flags = %d\n", user_flags)); error = copyin (fhp, &fh, sizeof(fh)); if (error) return error; error = xfs_fhlookup (proc, &fh, &vp); - XFSDEB(XDEBVFOPS, ("xfs_fhlookup returned %d\n", error)); + NNPFSDEB(XDEBVFOPS, ("xfs_fhlookup returned %d\n", error)); if (error) return error; @@ -421,7 +456,7 @@ xfs_fhopen (struct proc *proc, goto out; default : error = EOPNOTSUPP; - break; + goto out; } mode = 0; @@ -434,7 +469,7 @@ xfs_fhopen (struct proc *proc, goto out; default : error = EOPNOTSUPP; - break; + goto out; } error = vn_writechk (vp); @@ -465,7 +500,11 @@ xfs_fhopen (struct proc *proc, #if defined(__FreeBSD_version) && __FreeBSD_version >= 300000 if (vp->v_type == VREG) { - error = xfs_vfs_object_create(vp, proc, proc->p_cred->pc_ucred); +#ifdef HAVE_FREEBSD_THREAD + error = xfs_vfs_object_create(vp, proc, proc->td_proc->p_ucred); +#else + error = xfs_vfs_object_create(vp, proc, proc->p_ucred); +#endif if (error) goto out; } @@ -485,7 +524,7 @@ xfs_fhopen (struct proc *proc, #endif return 0; out: - XFSDEB(XDEBVFOPS, ("xfs_fhopen: error = %d\n", error)); + NNPFSDEB(XDEBVFOPS, ("xfs_fhopen: error = %d\n", error)); vput(vp); return error; } diff --git a/sys/xfs/xfs_vfsops-bsd.h b/sys/xfs/xfs_vfsops-bsd.h index 7166cdfd3a5..dfaa225df87 100644 --- a/sys/xfs/xfs_vfsops-bsd.h +++ b/sys/xfs/xfs_vfsops-bsd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,39 +31,32 @@ * SUCH DAMAGE. */ -/* $Id: xfs_vfsops-bsd.h,v 1.6 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_vfsops-bsd.h,v 1.14 2002/09/07 10:46:09 lha Exp $ */ #ifndef _xfs_vfsops_bsd_h #define _xfs_vfsops_bsd_h int -xfs_mount(struct mount * mp, - const char *user_path, -#ifdef __OpenBSD__ - void *user_data, -#else - caddr_t user_data, -#endif - struct nameidata * ndp, - struct proc * p); +xfs_mount_caddr(struct mount *mp, const char *user_path, caddr_t user_data, + struct nameidata *ndp, d_thread_t *p); int -xfs_start(struct mount * mp, int flags, struct proc * p); +xfs_start(struct mount * mp, int flags, d_thread_t * p); int -xfs_unmount(struct mount * mp, int mntflags, struct proc *p); +xfs_unmount(struct mount * mp, int mntflags, d_thread_t *p); int xfs_root(struct mount *mp, struct vnode **vpp); int -xfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct proc *p); +xfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p); int -xfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p); +xfs_statfs(struct mount *mp, struct statfs *sbp, d_thread_t *p); int -xfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct proc *p); +xfs_sync(struct mount *mp, int waitfor, struct ucred *cred, d_thread_t *p); int xfs_vget(struct mount * mp, diff --git a/sys/xfs/xfs_vfsops-common.c b/sys/xfs/xfs_vfsops-common.c index bc4516116e0..91e30e90ac6 100644 --- a/sys/xfs/xfs_vfsops-common.c +++ b/sys/xfs/xfs_vfsops-common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,10 +33,10 @@ #include <xfs/xfs_locl.h> -RCSID("$Id: xfs_vfsops-common.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_vfsops-common.c,v 1.40 2003/06/02 18:26:40 lha Exp $"); /* - * XFS vfs operations. + * NNPFS vfs operations. */ #include <xfs/xfs_common.h> @@ -54,37 +54,30 @@ RCSID("$Id: xfs_vfsops-common.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); #endif -struct xfs xfs[NXFS]; +struct xfs xfs[NNNPFS]; + +/* + * path and data is in system memory + */ int -xfs_mount_common(struct mount *mp, - const char *user_path, - caddr_t user_data, - struct nameidata *ndp, - struct proc *p) +xfs_mount_common_sys(struct mount *mp, + const char *path, + void *data, + struct nameidata *ndp, + d_thread_t *p) { struct vnode *devvp; dev_t dev; int error; struct vattr vat; - char path[MAXPATHLEN]; - char data[MAXPATHLEN]; - size_t count; - error = copyinstr(user_path, path, MAXPATHLEN, &count); - if (error) - return error; - - error = copyinstr(user_data, data, MAXPATHLEN, &count); - if (error) - return error; - - XFSDEB(XDEBVFOPS, ("xfs_mount: " + NNPFSDEB(XDEBVFOPS, ("xfs_mount: " "struct mount mp = %lx path = '%s' data = '%s'\n", - (unsigned long)mp, path, data)); + (unsigned long)mp, path, (char *)data)); #ifdef ARLA_KNFS - XFSDEB(XDEBVFOPS, ("xfs_mount: mount flags = %x\n", mp->mnt_flag)); + NNPFSDEB(XDEBVFOPS, ("xfs_mount: mount flags = %x\n", mp->mnt_flag)); /* * mountd(8) flushes all export entries when it starts @@ -94,7 +87,7 @@ xfs_mount_common(struct mount *mp, if (mp->mnt_flag & MNT_UPDATE || mp->mnt_flag & MNT_DELEXPORT) { - XFSDEB(XDEBVFOPS, + NNPFSDEB(XDEBVFOPS, ("xfs_mount: ignoreing MNT_UPDATE or MNT_DELEXPORT\n")); return 0; } @@ -103,7 +96,7 @@ xfs_mount_common(struct mount *mp, NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, data, p); error = namei(ndp); if (error) { - XFSDEB(XDEBVFOPS, ("namei failed, errno = %d\n", error)); + NNPFSDEB(XDEBVFOPS, ("namei failed, errno = %d\n", error)); return error; } @@ -111,47 +104,50 @@ xfs_mount_common(struct mount *mp, if (devvp->v_type != VCHR) { vput(devvp); - XFSDEB(XDEBVFOPS, ("not VCHR (%d)\n", devvp->v_type)); + NNPFSDEB(XDEBVFOPS, ("not VCHR (%d)\n", devvp->v_type)); return ENXIO; } -#ifdef __osf__ +#if defined(__osf__) VOP_GETATTR(devvp, &vat, ndp->ni_cred, error); +#elif defined(HAVE_FREEBSD_THREAD) + error = VOP_GETATTR(devvp, &vat, p->td_proc->p_ucred, p); #else error = VOP_GETATTR(devvp, &vat, p->p_ucred, p); #endif vput(devvp); if (error) { - XFSDEB(XDEBVFOPS, ("VOP_GETATTR failed, error = %d\n", error)); + NNPFSDEB(XDEBVFOPS, ("VOP_GETATTR failed, error = %d\n", error)); return error; } dev = VA_RDEV_TO_DEV(vat.va_rdev); - XFSDEB(XDEBVFOPS, ("dev = %d.%d\n", major(dev), minor(dev))); + NNPFSDEB(XDEBVFOPS, ("dev = %d.%d\n", major(dev), minor(dev))); if (!xfs_is_xfs_dev (dev)) { - XFSDEB(XDEBVFOPS, ("%s is not a xfs device\n", - data)); + NNPFSDEB(XDEBVFOPS, ("%s is not a xfs device\n", (char *)data)); return ENXIO; } - if (xfs[minor(dev)].status & XFS_MOUNTED) + if (xfs[minor(dev)].status & NNPFS_MOUNTED) return EBUSY; - xfs[minor(dev)].status = XFS_MOUNTED; + xfs[minor(dev)].status = NNPFS_MOUNTED; xfs[minor(dev)].mp = mp; xfs[minor(dev)].root = 0; xfs[minor(dev)].nnodes = 0; xfs[minor(dev)].fd = minor(dev); - VFS_TO_XFS(mp) = &xfs[minor(dev)]; + nnfs_init_head(&xfs[minor(dev)].nodehead); + + VFS_TO_NNPFS(mp) = &xfs[minor(dev)]; #if defined(HAVE_KERNEL_VFS_GETNEWFSID) #if defined(HAVE_TWO_ARGUMENT_VFS_GETNEWFSID) vfs_getnewfsid(mp, MOUNT_AFS); #else vfs_getnewfsid(mp); -#endif HAVE_TWO_ARGUMENT_VFS_GETNEWFSID -#endif HAVE_KERNEL_VFS_GETNEWFSID +#endif /* HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */ +#endif /* HAVE_KERNEL_VFS_GETNEWFSID */ mp->mnt_stat.f_bsize = DEV_BSIZE; #ifndef __osf__ @@ -167,7 +163,7 @@ xfs_mount_common(struct mount *mp, #ifdef __osf__ mp->mnt_stat.f_fsid.val[0] = dev; - mp->mnt_stat.f_fsid.val[1] = MOUNT_XFS; + mp->mnt_stat.f_fsid.val[1] = MOUNT_NNPFS; MALLOC(mp->m_stat.f_mntonname, char *, strlen(path) + 1, M_PATHNAME, M_WAITOK); @@ -193,6 +189,28 @@ xfs_mount_common(struct mount *mp, return 0; } +int +xfs_mount_common(struct mount *mp, + const char *user_path, + void *user_data, + struct nameidata *ndp, + d_thread_t *p) +{ + char path[MAXPATHLEN]; + char data[MAXPATHLEN]; + size_t count; + int error; + + error = copyinstr(user_path, path, MAXPATHLEN, &count); + if (error) + return error; + + error = copyinstr(user_data, data, MAXPATHLEN, &count); + if (error) + return error; + return xfs_mount_common_sys (mp, path, data, ndp, p); +} + #ifdef HAVE_KERNEL_DOFORCE extern int doforce; #endif @@ -200,7 +218,7 @@ extern int doforce; int xfs_unmount_common(struct mount *mp, int mntflags) { - struct xfs *xfsp = VFS_TO_XFS(mp); + struct xfs *xfsp = VFS_TO_NNPFS(mp); int flags = 0; int error; @@ -217,15 +235,15 @@ xfs_unmount_common(struct mount *mp, int mntflags) return error; xfsp->status = 0; - XFS_TO_VFS(xfsp) = NULL; + NNPFS_TO_VFS(xfsp) = NULL; return 0; } int xfs_root_common(struct mount *mp, struct vnode **vpp, - struct proc *proc, struct ucred *cred) + d_thread_t *proc, struct ucred *cred) { - struct xfs *xfsp = VFS_TO_XFS(mp); + struct xfs *xfsp = VFS_TO_NNPFS(mp); struct xfs_message_getroot msg; int error; @@ -235,7 +253,7 @@ xfs_root_common(struct mount *mp, struct vnode **vpp, xfs_do_vget(*vpp, LK_EXCLUSIVE, proc); return 0; } - msg.header.opcode = XFS_MSG_GETROOT; + msg.header.opcode = NNPFS_MSG_GETROOT; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), proc); @@ -247,9 +265,9 @@ xfs_root_common(struct mount *mp, struct vnode **vpp, * and return a fake dead vnode to be able to unmount. */ - if ((error = make_dead_vnode(mp, vpp))) + if ((error = xfs_make_dead_vnode(mp, vpp))) return error; - (*vpp)->v_flag |= VROOT; + NNPFS_MAKE_VROOT(*vpp); return 0; } diff --git a/sys/xfs/xfs_vfsops-openbsd.c b/sys/xfs/xfs_vfsops-openbsd.c index eee8c93637b..87ff61f0595 100644 --- a/sys/xfs/xfs_vfsops-openbsd.c +++ b/sys/xfs/xfs_vfsops-openbsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <xfs/xfs_locl.h> -RCSID("$Id: xfs_vfsops-openbsd.c,v 1.5 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_vfsops-openbsd.c,v 1.16 2003/06/02 18:26:50 lha Exp $"); #include <xfs/xfs_common.h> #include <xfs/xfs_message.h> @@ -47,9 +47,9 @@ RCSID("$Id: xfs_vfsops-openbsd.c,v 1.5 2002/06/07 04:10:32 hin Exp $"); static vop_t **xfs_dead_vnodeop_p; int -make_dead_vnode(struct mount *mp, struct vnode **vpp) +xfs_make_dead_vnode(struct mount *mp, struct vnode **vpp) { - XFSDEB(XDEBNODE, ("make_dead_vnode mp = %lx\n", + NNPFSDEB(XDEBNODE, ("make_dead_vnode mp = %lx\n", (unsigned long)mp)); return getnewvnode(VT_NON, mp, xfs_dead_vnodeop_p, vpp); @@ -72,7 +72,7 @@ extern struct vnodeopv_desc xfs_vnodeop_opv_desc; static int xfs_init(struct vfsconf *vfs) { - XFSDEB(XDEBVFOPS, ("xfs_init\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_init\n")); vfs_opv_init_explicit(&xfs_vnodeop_opv_desc); vfs_opv_init_default(&xfs_vnodeop_opv_desc); vfs_opv_init_explicit(&xfs_dead_vnodeop_opv_desc); @@ -81,7 +81,11 @@ xfs_init(struct vfsconf *vfs) } struct vfsops xfs_vfsops = { - xfs_mount, +#ifdef HAVE_STRUCT_VFSOPS_VFS_MOUNT + xfs_mount_common, +#else + xfs_mount_caddr, +#endif xfs_start, xfs_unmount, xfs_root, @@ -131,7 +135,7 @@ vfs_register (struct vfsconf *vfs) vfs->vfc_next = NULL; /* Call vfs_init() */ - XFSDEB(XDEBVFOPS, ("calling vfs_init\n")); + NNPFSDEB(XDEBVFOPS, ("calling vfs_init\n")); (*(vfs->vfc_vfsops->vfs_init)) (vfs); /* done! */ diff --git a/sys/xfs/xfs_vfsops.h b/sys/xfs/xfs_vfsops.h index d81924ef1dd..feb057ef145 100644 --- a/sys/xfs/xfs_vfsops.h +++ b/sys/xfs/xfs_vfsops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_vfsops.h,v 1.4 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_vfsops.h,v 1.17 2003/06/02 18:27:10 lha Exp $ */ #ifndef _xfs_vfsops_h #define _xfs_vfsops_h @@ -39,9 +39,16 @@ int xfs_mount_common(struct mount *mp, const char *user_path, - caddr_t user_data, + void *user_data, struct nameidata *ndp, - struct proc *p); + d_thread_t *p); + +int +xfs_mount_common_sys(struct mount *mp, + const char *path, + void *data, + struct nameidata *ndp, + d_thread_t *p); int xfs_unmount_common(struct mount *mp, int mntflags); @@ -49,20 +56,20 @@ xfs_unmount_common(struct mount *mp, int mntflags); int xfs_root_common(struct mount *mp, struct vnode **vpp, - struct proc *proc, + d_thread_t *proc, struct ucred *cred); int -xfs_fhlookup (struct proc *proc, +xfs_fhlookup (d_thread_t *proc, struct xfs_fhandle_t *fhp, struct vnode **vpp); int -xfs_fhopen (struct proc *proc, +xfs_fhopen (d_thread_t *proc, struct xfs_fhandle_t *fhp, int flags, register_t *retval); -int make_dead_vnode(struct mount *mp, struct vnode **vpp); +int xfs_make_dead_vnode(struct mount *mp, struct vnode **vpp); #endif /* _xfs_vfsops_h */ diff --git a/sys/xfs/xfs_vnodeops-bsd.c b/sys/xfs/xfs_vnodeops-bsd.c index dd7f66af355..8c8e9c4c0c4 100644 --- a/sys/xfs/xfs_vnodeops-bsd.c +++ b/sys/xfs/xfs_vnodeops-bsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,7 +32,7 @@ */ /* - * XFS operations. + * NNPFS operations. */ #ifdef __APPLE__ @@ -51,14 +51,14 @@ #include <vm/vnode_pager.h> #endif -RCSID("$Id: xfs_vnodeops-bsd.c,v 1.4 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_vnodeops-bsd.c,v 1.123 2003/02/15 16:40:36 lha Exp $"); /* * vnode functions */ #ifdef HAVE_VOP_OPEN -static int +int xfs_open(struct vop_open_args * ap) /* struct vop_open { @@ -68,12 +68,16 @@ xfs_open(struct vop_open_args * ap) struct proc *p; }; */ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_open_common (ap->a_vp, ap->a_mode, ap->a_cred, ap->a_td); +#else return xfs_open_common (ap->a_vp, ap->a_mode, ap->a_cred, ap->a_p); +#endif } #endif /* HAVE_VOP_OPEN */ #ifdef HAVE_VOP_FSYNC -static int +int xfs_fsync(struct vop_fsync_args * ap) /* vop_fsync { @@ -86,13 +90,17 @@ xfs_fsync(struct vop_fsync_args * ap) #ifdef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS return xfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_flags, ap->a_p); #else +#ifdef HAVE_FREEBSD_THREAD + return xfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td); +#else return xfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_p); #endif +#endif } #endif /* HAVE_VOP_FSYNC */ #ifdef HAVE_VOP_CLOSE -static int +int xfs_close(struct vop_close_args * ap) /* vop_close { IN struct vnode *vp; @@ -101,12 +109,16 @@ xfs_close(struct vop_close_args * ap) IN struct proc *p; }; */ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_close_common(ap->a_vp, ap->a_fflag, ap->a_td, ap->a_cred); +#else return xfs_close_common(ap->a_vp, ap->a_fflag, ap->a_p, ap->a_cred); +#endif } #endif /* HAVE_VOP_CLOSE */ #ifdef HAVE_VOP_READ -static int +int xfs_read(struct vop_read_args * ap) /* vop_read { IN struct vnode *vp; @@ -120,7 +132,7 @@ xfs_read(struct vop_read_args * ap) #endif /* HAVE_VOP_READ */ #ifdef HAVE_VOP_WRITE -static int +int xfs_write(struct vop_write_args * ap) /* vop_write { IN struct vnode *vp; @@ -134,7 +146,7 @@ xfs_write(struct vop_write_args * ap) #endif /* HAVE_VOP_WRITE */ #ifdef HAVE_VOP_IOCTL -static int +int xfs_ioctl(struct vop_ioctl_args * ap) /* struct vnode *vp, int com, @@ -142,27 +154,27 @@ xfs_ioctl(struct vop_ioctl_args * ap) int flag, struct ucred *cred) */ { - XFSDEB(XDEBVNOPS, ("xfs_ioctl\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_ioctl\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_IOCTL */ #ifdef HAVE_VOP_SELECT -static int +int xfs_select(struct vop_select_args * ap) /* struct vnode *vp, int which, struct ucred *cred ) */ { - XFSDEB(XDEBVNOPS, ("xfs_select\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_select\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_SELECT */ #ifdef HAVE_VOP_SEEK -static int +int xfs_seek(struct vop_seek_args * ap) /* struct vop_seek_args { @@ -174,13 +186,13 @@ struct vop_seek_args { }; */ { - XFSDEB(XDEBVNOPS, ("xfs_seek\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_seek\n")); return 0; } #endif /* HAVE_VOP_SEEK */ #ifdef HAVE_VOP_POLL -static int +int xfs_poll(struct vop_poll_args * ap) /* vop_poll { IN struct vnode *vp; @@ -188,25 +200,29 @@ xfs_poll(struct vop_poll_args * ap) IN struct proc *p; }; */ { - XFSDEB(XDEBVNOPS, ("xfs_poll\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_poll\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_POLL */ #ifdef HAVE_VOP_GETATTR -static int +int xfs_getattr(struct vop_getattr_args * ap) /* struct vnode *vp, struct vattr *vap, struct ucred *cred, struct proc *p) */ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_getattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_td); +#else return xfs_getattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_p); +#endif } #endif /* HAVE_VOP_GETATTR */ #ifdef HAVE_VOP_SETATTR -static int +int xfs_setattr(struct vop_setattr_args * ap) /* struct vnode *vp, struct vattr *vap, @@ -214,12 +230,16 @@ xfs_setattr(struct vop_setattr_args * ap) struct proc *p) */ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_setattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_td); +#else return xfs_setattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_p); +#endif } #endif /* HAVE_VOP_SETATTR */ #ifdef HAVE_VOP_ACCESS -static int +int xfs_access(struct vop_access_args * ap) /* struct vnode *vp, @@ -228,12 +248,16 @@ struct vnode *vp, struct proc *p) */ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_access_common(ap->a_vp, ap->a_mode, ap->a_cred, ap->a_td); +#else return xfs_access_common(ap->a_vp, ap->a_mode, ap->a_cred, ap->a_p); +#endif } #endif /* HAVE_VOP_ACCESS */ #ifdef HAVE_VOP_LOOKUP -static int +int xfs_lookup(struct vop_lookup_args * ap) /* struct vop_lookup_args { struct vnodeop_desc *a_desc; @@ -247,7 +271,7 @@ xfs_lookup(struct vop_lookup_args * ap) int lockparent = (cnp->cn_flags & (LOCKPARENT | ISLASTCN)) == (LOCKPARENT | ISLASTCN); - XFSDEB(XDEBVNOPS, ("xfs_lookup: (%s, %ld), nameiop = %lu, flags = %lu\n", + NNPFSDEB(XDEBVNOPS, ("xfs_lookup: (%s, %ld), nameiop = %lu, flags = %lu\n", cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_nameiop, @@ -274,7 +298,11 @@ xfs_lookup(struct vop_lookup_args * ap) } else if (!(cnp->cn_flags & ISLASTCN) || !lockparent) { /* if we isn't last component and is isn't requested, * return parent unlocked */ +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_unlock (ap->a_dvp, xfs_cnp_to_thread(cnp)); +#else xfs_vfs_unlock (ap->a_dvp, xfs_cnp_to_proc(cnp)); +#endif #ifdef PDIRUNLOCK cnp->cn_flags |= PDIRUNLOCK; #endif @@ -283,14 +311,14 @@ xfs_lookup(struct vop_lookup_args * ap) /* in case of a error do nothing */ } - XFSDEB(XDEBVNOPS, ("xfs_lookup: error = %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_lookup: error = %d\n", error)); return error; } #endif /* HAVE_VOP_LOOKUP */ #ifdef HAVE_VOP_CACHEDLOOKUP -static int +int xfs_cachedlookup(struct vop_cachedlookup_args * ap) /* struct vop_cachedlookup_args { struct vnodeop_desc *a_desc; @@ -311,11 +339,17 @@ static void cleanup_cnp (struct componentname *cnp, int error) { if (error != 0 || (cnp->cn_flags & SAVESTART) == 0) { -#ifdef HAVE_KERNEL_ZFREEI +#if defined(HAVE_KERNEL_ZFREEI) zfreei(namei_zone, cnp->cn_pnbuf); cnp->cn_flags &= ~HASBUF; +#elif defined(HAVE_KERNEL_UMA_ZFREE_ARG) + uma_zfree_arg(namei_zone, cnp->cn_pnbuf, NULL); + cnp->cn_flags &= ~HASBUF; #elif defined(FREE_ZONE) FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI); +#elif defined(HAVE_KERNEL_ZFREE) + zfree(namei_zone, cnp->cn_pnbuf); + cnp->cn_flags &= ~HASBUF; #elif defined(PNBUF_PUT) PNBUF_PUT(cnp->cn_pnbuf); #else @@ -325,14 +359,18 @@ cleanup_cnp (struct componentname *cnp, int error) } #ifdef HAVE_VOP_CREATE -static int +int xfs_create(struct vop_create_args *ap) { struct vnode *dvp = ap->a_dvp; struct componentname *cnp = ap->a_cnp; const char *name = cnp->cn_nameptr; struct ucred *cred = cnp->cn_cred; - struct proc *p = xfs_cnp_to_proc(cnp); +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *p = xfs_cnp_to_thread(cnp); +#else + d_thread_t *p = xfs_cnp_to_proc(cnp); +#endif int error; error = xfs_create_common(dvp, name, ap->a_vap, cred, p); @@ -347,14 +385,14 @@ xfs_create(struct vop_create_args *ap) vput (dvp); #endif - XFSDEB(XDEBVNOPS, ("xfs_create: error = %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_create: error = %d\n", error)); return error; } #endif /* HAVE_VOP_CREATE */ #ifdef HAVE_VOP_REMOVE -static int +int xfs_remove(struct vop_remove_args * ap) /* struct vnode *dvp, struct vnode *vp, @@ -364,8 +402,13 @@ xfs_remove(struct vop_remove_args * ap) struct vnode *dvp = ap->a_dvp; struct vnode *vp = ap->a_vp; +#ifdef HAVE_FREEBSD_THREAD + int error = xfs_remove_common(dvp, vp, cnp->cn_nameptr, + cnp->cn_cred, xfs_cnp_to_thread(cnp)); +#else int error = xfs_remove_common(dvp, vp, cnp->cn_nameptr, cnp->cn_cred, xfs_cnp_to_proc(cnp)); +#endif cleanup_cnp (cnp, error); @@ -392,7 +435,7 @@ xfs_remove(struct vop_remove_args * ap) #endif /* HAVE_VOP_REMOVE */ #ifdef HAVE_VOP_RENAME -static int +int xfs_rename(struct vop_rename_args * ap) /* vop_rename { IN WILLRELE struct vnode *fdvp; @@ -415,7 +458,11 @@ xfs_rename(struct vop_rename_args * ap) tvp, ap->a_tcnp->cn_nameptr, ap->a_tcnp->cn_cred, +#ifdef HAVE_FREEBSD_THREAD + xfs_cnp_to_thread (ap->a_fcnp)); +#else xfs_cnp_to_proc (ap->a_fcnp)); +#endif if(tdvp == tvp) vrele(tdvp); else @@ -429,7 +476,7 @@ xfs_rename(struct vop_rename_args * ap) #endif /* HAVE_VOP_RENAME */ #ifdef HAVE_VOP_MKDIR -static int +int xfs_mkdir(struct vop_mkdir_args * ap) /* struct vnode *dvp, char *nm, @@ -441,7 +488,11 @@ xfs_mkdir(struct vop_mkdir_args * ap) struct componentname *cnp = ap->a_cnp; const char *name = cnp->cn_nameptr; struct ucred *cred = cnp->cn_cred; - struct proc *p = xfs_cnp_to_proc(cnp); +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *p = xfs_cnp_to_thread(cnp); +#else + d_thread_t *p = xfs_cnp_to_proc(cnp); +#endif int error; error = xfs_mkdir_common(dvp, name, ap->a_vap, cred, p); @@ -455,14 +506,14 @@ xfs_mkdir(struct vop_mkdir_args * ap) vput(dvp); #endif - XFSDEB(XDEBVNOPS, ("xfs_mkdir: error = %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_mkdir: error = %d\n", error)); return error; } #endif /* HAVE_VOP_MKDIR */ #ifdef HAVE_VOP_RMDIR -static int +int xfs_rmdir(struct vop_rmdir_args * ap) /* struct vnode *dvp, struct vnode *vp, @@ -474,7 +525,11 @@ xfs_rmdir(struct vop_rmdir_args * ap) int error = xfs_rmdir_common(ap->a_dvp, ap->a_vp, cnp->cn_nameptr, cnp->cn_cred, +#ifdef HAVE_FREEBSD_THREAD + xfs_cnp_to_thread(cnp)); +#else xfs_cnp_to_proc(cnp)); +#endif cleanup_cnp (cnp, error); #if !defined(__FreeBSD__) || __FreeBSD_version < 300000 @@ -499,7 +554,7 @@ typedef off_t xfs_cookie_t; #error dunno want kind of cookies you have #endif -static int +int xfs_readdir(struct vop_readdir_args * ap) /* struct vnode *vp, struct uio *uiop, @@ -511,7 +566,11 @@ xfs_readdir(struct vop_readdir_args * ap) off = ap->a_uio->uio_offset; error = xfs_readdir_common(ap->a_vp, ap->a_uio, ap->a_cred, +#ifdef HAVE_FREEBSD_THREAD + xfs_uio_to_thread (ap->a_uio), +#else xfs_uio_to_proc (ap->a_uio), +#endif ap->a_eofflag); if (!error && ap->a_ncookies != NULL) { @@ -552,7 +611,7 @@ xfs_readdir(struct vop_readdir_args * ap) #endif /* HAVE_VOP_READDIR */ #ifdef HAVE_VOP_LINK -static int +int xfs_link(struct vop_link_args * ap) /* WILLRELE struct vnode *tdvp; @@ -563,7 +622,11 @@ xfs_link(struct vop_link_args * ap) struct componentname *cnp = ap->a_cnp; struct vnode *vp = ap->a_vp; struct vnode *dvp; - struct proc *p = cnp->cn_proc; +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *p = cnp->cn_thread; +#else + d_thread_t *p = cnp->cn_proc; +#endif int error; #if defined (__OpenBSD__) || defined(__NetBSD__) @@ -588,19 +651,27 @@ xfs_link(struct vop_link_args * ap) error = EXDEV; goto out; } + /* FreeBSD 5.0 doesn't need to lock the vnode in VOP_LINK */ +#if !defined(__FreeBSD_version) || __FreeBSD_version < 500043 + if (dvp != vp && (error = xfs_vfs_writelock(vp, p))) { #ifdef HAVE_VOP_ABORTOP VOP_ABORTOP(dvp, cnp); #endif goto out; } +#endif /* defined(__FreeBSD_version) || __FreeBSD_version < 500043 */ error = xfs_link_common( dvp, vp, cnp->cn_nameptr, cnp->cn_cred, +#ifdef HAVE_FREEBSD_THREAD + xfs_cnp_to_thread (cnp)); +#else xfs_cnp_to_proc (cnp)); +#endif cleanup_cnp (cnp, error); @@ -617,7 +688,7 @@ out: #endif /* HAVE_VOP_LINK */ #ifdef HAVE_VOP_SYMLINK -static int +int xfs_symlink(struct vop_symlink_args * ap) /* IN WILLRELE struct vnode *dvp; @@ -639,7 +710,7 @@ xfs_symlink(struct vop_symlink_args * ap) if (error == 0) { error = xfs_lookup_common(dvp, cnp, vpp); -#if (!defined(__FreeBSD__) || __FreeBSD_version < 400012) && (!defined(__NetBSD__) || __NetBSD_Version__ < 105240000) && (!defined(__OpenBSD__) || OpenBSD < 200107) +#if (!defined(__FreeBSD__) || __FreeBSD_version < 400012) && (!defined(__NetBSD__) || __NetBSD_Version__ < 105240000) && (!defined(__OpenBSD__) || OpenBSD <= 200211) if (error == 0) vput (*vpp); #endif @@ -654,7 +725,7 @@ xfs_symlink(struct vop_symlink_args * ap) #ifdef HAVE_VOP_READLINK -static int +int xfs_readlink(struct vop_readlink_args * ap) /* struct vnode *vp, struct uio *uiop, @@ -665,17 +736,21 @@ xfs_readlink(struct vop_readlink_args * ap) #endif /* HAVE_VOP_READLINK */ #ifdef HAVE_VOP_INACTIVE -static int +int xfs_inactive(struct vop_inactive_args * ap) /*struct vnode *vp, struct ucred *cred)*/ { +#ifdef HAVE_FREEBSD_THREAD + return xfs_inactive_common(ap->a_vp, xfs_curthread()); +#else return xfs_inactive_common(ap->a_vp, xfs_curproc()); +#endif } #endif /* HAVE_VOP_INACTICE */ #ifdef HAVE_VOP_RECLAIM -static int +int xfs_reclaim(struct vop_reclaim_args * ap) /*struct vop_reclaim_args { struct vnodeop_desc *a_desc; @@ -698,7 +773,7 @@ xfs_reclaim(struct vop_reclaim_args * ap) #if defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR) #ifdef HAVE_VOP_LOCK -static int +int xfs_lock(struct vop_lock_args * ap) { struct vnode *vp = ap->a_vp; @@ -707,37 +782,50 @@ xfs_lock(struct vop_lock_args * ap) int flags = ap->a_flags; int ret; - XFSDEB(XDEBVNOPS, ("xfs_lock: %lx, flags 0x%x\n", + NNPFSDEB(XDEBVNOPS, ("xfs_lock: %lx, flags 0x%x\n", (unsigned long)vp, flags)); if (l == NULL) panic("xfs_lock: lock NULL"); - XFSDEB(XDEBVNOPS, ("xfs_lock before: lk flags: %d share: %d " - "wait: %d excl: %d holder: %d\n", - l->lk_flags, l->lk_sharecount, l->lk_waitcount, - l->lk_exclusivecount, l->lk_lockholder)); + NNPFSDEB(XDEBVNOPS, ("xfs_lock before: lk flags: %d share: %d " + "wait: %d excl: %d holder: 0x%llx\n", + l->lk_flags, l->lk_sharecount, l->lk_waitcount, + l->lk_exclusivecount, + (unsigned long long) + (xfs_uintptr_t)l->lk_lockholder)); #ifndef DEBUG_LOCKS #ifdef HAVE_FOUR_ARGUMENT_LOCKMGR +#ifdef HAVE_FREEBSD_THREAD + ret = lockmgr(l, flags, &vp->v_interlock, ap->a_td); +#else ret = lockmgr(l, flags, &vp->v_interlock, ap->a_p); +#endif #else ret = lockmgr(l, flags, &vp->v_interlock); #endif #else +#ifdef HAVE_FREEBSD_THREAD + ret = debuglockmgr(l, flags, &vp->v_interlock, ap->a_td, + "xfs_lock", ap->a_vp->filename, ap->a_vp->line); +#else ret = debuglockmgr(l, flags, &vp->v_interlock, ap->a_p, "xfs_lock", ap->a_vp->filename, ap->a_vp->line); #endif - XFSDEB(XDEBVNOPS, ("xfs_lock: lk flags: %d share: %d " - "wait: %d excl: %d holder: %d\n", - l->lk_flags, l->lk_sharecount, l->lk_waitcount, - l->lk_exclusivecount, l->lk_lockholder)); +#endif + NNPFSDEB(XDEBVNOPS, ("xfs_lock: lk flags: %d share: %d " + "wait: %d excl: %d holder: 0x%llx\n", + l->lk_flags, l->lk_sharecount, l->lk_waitcount, + l->lk_exclusivecount, + (unsigned long long) + (xfs_uintptr_t)l->lk_lockholder)); return ret; } #endif /* HAVE_VOP_LOCK */ #ifdef HAVE_VOP_UNLOCK -static int +int xfs_unlock(struct vop_unlock_args * ap) { struct vnode *vp = ap->a_vp; @@ -749,44 +837,59 @@ xfs_unlock(struct vop_unlock_args * ap) if (l == NULL) panic("xfs_unlock: lock NULL"); - XFSDEB(XDEBVNOPS, + NNPFSDEB(XDEBVNOPS, ("xfs_unlock: %lx, flags 0x%x, l %lx, ap %lx\n", (unsigned long)vp, flags, (unsigned long)l, (unsigned long)ap)); - XFSDEB(XDEBVNOPS, ("xfs_unlock: lk flags: %d share: %d " - "wait: %d excl: %d holder: %d\n", - l->lk_flags, l->lk_sharecount, l->lk_waitcount, - l->lk_exclusivecount, l->lk_lockholder)); + NNPFSDEB(XDEBVNOPS, ("xfs_unlock: lk flags: %d share: %d " + "wait: %d excl: %d holder: 0x%lld\n", + l->lk_flags, l->lk_sharecount, l->lk_waitcount, + l->lk_exclusivecount, + (unsigned long long) + (xfs_uintptr_t)l->lk_lockholder)); #ifndef DEBUG_LOCKS #ifdef HAVE_FOUR_ARGUMENT_LOCKMGR +#ifdef HAVE_FREEBSD_THREAD + ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_td); +#else ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_p); +#endif #else ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock); #endif #else +#ifdef HAVE_FREEBSD_THREAD + ret = debuglockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_td, + "xfs_lock", ap->a_vp->filename, ap->a_vp->line); +#else ret = debuglockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_p, "xfs_lock", ap->a_vp->filename, ap->a_vp->line); #endif - XFSDEB(XDEBVNOPS, ("xfs_unlock: return %d\n", ret)); +#endif + NNPFSDEB(XDEBVNOPS, ("xfs_unlock: return %d\n", ret)); return ret; } #endif /* HAVE_VOP_UNLOCK */ #ifdef HAVE_VOP_ISLOCKED -static int +int xfs_islocked (struct vop_islocked_args *ap) { struct vnode *vp = ap->a_vp; struct xfs_node *xn = VNODE_TO_XNODE(vp); xfs_vnode_lock *l = &xn->lock; - XFSDEB(XDEBVNOPS, ("xfs_islocked: %lx\n", + NNPFSDEB(XDEBVNOPS, ("xfs_islocked: %lx\n", (unsigned long)vp)); #if defined(HAVE_TWO_ARGUMENT_LOCKSTATUS) +#ifdef HAVE_FREEBSD_THREAD + return lockstatus (l, ap->a_td); +#else return lockstatus (l, ap->a_p); +#endif #elif defined(HAVE_ONE_ARGUMENT_LOCKSTATUS) return lockstatus (l); #else @@ -798,13 +901,13 @@ xfs_islocked (struct vop_islocked_args *ap) #else /* !HAVE_KERNEL_LOCKMGR && !HAVE_KERNEL_DEBUGLOCKMGR */ #ifdef HAVE_VOP_LOCK -static int +int xfs_lock(struct vop_lock_args * ap) { struct vnode *vp = ap->a_vp; struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_lock: %lx, %d\n", + NNPFSDEB(XDEBVNOPS, ("xfs_lock: %lx, %d\n", (unsigned long)vp, xn->vnlocks)); while (vp->v_flag & VXLOCK) { @@ -819,12 +922,12 @@ xfs_lock(struct vop_lock_args * ap) #endif /* HAVE_VOP_LOCK */ #ifdef HAVE_VOP_UNLOCK -static int +int xfs_unlock(struct vop_unlock_args * ap) { struct vnode *vp = ap->a_vp; struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_unlock: %lx, %d\n", + NNPFSDEB(XDEBVNOPS, ("xfs_unlock: %lx, %d\n", (unsigned long)vp, xn->vnlocks)); --xn->vnlocks; @@ -832,20 +935,20 @@ xfs_unlock(struct vop_unlock_args * ap) printf ("PANIC: xfs_unlock: unlocking unlocked\n"); xn->vnlocks = 0; } - XFSDEB(XDEBVNOPS, ("xfs_unlock: return\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_unlock: return\n")); return 0; } #endif /* HAVE_VOP_UNLOCK */ #ifdef HAVE_VOP_ISLOCKED -static int +int xfs_islocked (struct vop_islocked_args *ap) { struct vnode *vp = ap->a_vp; struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_islocked: %lx, %d\n", + NNPFSDEB(XDEBVNOPS, ("xfs_islocked: %lx, %d\n", (unsigned long)vp, xn->vnlocks)); return xn->vnlocks; @@ -854,7 +957,7 @@ xfs_islocked (struct vop_islocked_args *ap) #endif /* !HAVE_KERNEL_LOCKMGR */ #ifdef HAVE_VOP_ABORTOP -static int +int xfs_abortop (struct vop_abortop_args *ap) /* struct vnode *dvp; struct componentname *cnp; */ @@ -862,11 +965,17 @@ xfs_abortop (struct vop_abortop_args *ap) struct componentname *cnp = ap->a_cnp; if ((cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) -#ifdef HAVE_KERNEL_ZFREEI +#if defined(HAVE_KERNEL_ZFREEI) zfreei(namei_zone, cnp->cn_pnbuf); ap->a_cnp->cn_flags &= ~HASBUF; +#elif defined(HAVE_KERNEL_UMA_ZFREE_ARG) + uma_zfree_arg(namei_zone, cnp->cn_pnbuf, NULL); + cnp->cn_flags &= ~HASBUF; #elif defined(FREE_ZONE) FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI); +#elif defined(HAVE_KERNEL_ZFREE) + zfree(namei_zone, cnp->cn_pnbuf); + ap->a_cnp->cn_flags &= ~HASBUF; #elif defined(PNBUF_PUT) PNBUF_PUT(cnp->cn_pnbuf); #else @@ -877,7 +986,7 @@ xfs_abortop (struct vop_abortop_args *ap) #endif /* HAVE_VOP_ABORTOP */ #ifdef HAVE_VOP_MMAP -static int +int xfs_mmap(struct vop_mmap_args *ap) /* IN struct vnode *vp; @@ -886,13 +995,17 @@ xfs_mmap(struct vop_mmap_args *ap) IN struct proc *p; */ { - XFSDEB(XDEBVNOPS, ("xfs_mmap\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_mmap\n")); +#ifdef HAVE_KERNEL_GENFS_MMAP + return genfs_mmap(ap); +#else return EOPNOTSUPP; +#endif } #endif /* HAVE_VOP_MMAP */ #ifdef HAVE_VOP_BMAP -static int +int xfs_bmap(struct vop_bmap_args *ap) /* IN struct vnode *vp; IN daddr_t bn; @@ -902,13 +1015,25 @@ xfs_bmap(struct vop_bmap_args *ap) OUT int *runb; */ { - XFSDEB(XDEBVNOPS, ("xfs_bmap\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_bmap\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_BMAP */ #ifdef HAVE_VOP_GETPAGES -static int + +static size_t +get_pages_endlength (struct vop_getpages_args *ap) +{ +#ifdef HAVE_STRUCT_VOP_GETPAGES_ARGS_A_OFFSET + /* NetBSD ubc */ + return (ap->a_offset << PAGE_SHIFT) + *ap->a_count * PAGE_SIZE; +#else + return (ap->a_reqpage << PAGE_SHIFT) + ap->a_count * PAGE_SIZE; +#endif +} + +int xfs_getpages (struct vop_getpages_args *ap) /* Old BSD IN struct vnode *vp; @@ -930,27 +1055,28 @@ xfs_getpages (struct vop_getpages_args *ap) { int error; - XFSDEB(XDEBVNOPS, ("xfs_getpages\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_getpages\n")); #if HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES error = vnode_pager_generic_getpages (ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage); #else - error = xfs_data_valid (ap->a_vp, VNODE_TO_XNODE(ap->a_vp)->cred, - xfs_curproc(), XFS_DATA_R); + error = xfs_data_valid (ap->a_vp, VNODE_TO_XNODE(ap->a_vp)->rd_cred, + xfs_curproc(), NNPFS_DATA_R, + get_pages_endlength(ap)); if (error == 0) error = VOP_GETPAGES(DATA_FROM_VNODE(ap->a_vp), ap->a_offset, ap->a_m, ap->a_count, ap->a_centeridx, ap->a_access_type, ap->a_advice, ap->a_flags); #endif - XFSDEB(XDEBVNOPS, ("xfs_getpages = %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_getpages = %d\n", error)); return error; } #endif /* HAVE_VOP_GETPAGES */ #ifdef HAVE_VOP_PUTPAGES -static int +int xfs_putpages (struct vop_putpages_args *ap) /* Old BSD IN struct vnode *vp; @@ -972,17 +1098,38 @@ xfs_putpages (struct vop_putpages_args *ap) struct vnode *t = DATA_FROM_XNODE(xn); int error; - XFSDEB(XDEBVNOPS, ("xfs_putpages\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_putpages\n")); - xn->flags |= XFS_DATA_DIRTY; + if (t == NULL) + return 0; #ifdef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC /* FreeBSD-style */ + xn->flags |= NNPFS_DATA_DIRTY; + return VOP_PUTPAGES(t, ap->a_m, ap->a_count, ap->a_sync, ap->a_rtvals, ap->a_offset); #else /* NetBSD-style */ #if defined(__NetBSD__) && __NetBSD_Version__ >= 105250000 + /* XXX should only walk over those pages that is requested */ + if (vp->v_type == VREG && ap->a_flags & PGO_CLEANIT) { + struct uvm_object *uobj = &t->v_uobj; + struct vm_page *pg; + int dirty = 0; + + pg = TAILQ_FIRST(&uobj->memq); + + while (pg && !dirty) { + dirty = pmap_is_modified(pg) || (pg->flags & PG_CLEAN) == 0; + pg = TAILQ_NEXT(pg, listq); + } + + if (dirty) + xn->flags |= NNPFS_DATA_DIRTY; + } + return VOP_PUTPAGES(t, ap->a_offlo, ap->a_offhi, ap->a_flags); #else + xn->flags |= NNPFS_DATA_DIRTY; return VOP_PUTPAGES(t, ap->a_m, ap->a_count, ap->a_flags, ap->a_rtvals); #endif #endif /* HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC */ @@ -990,26 +1137,26 @@ xfs_putpages (struct vop_putpages_args *ap) #endif /* HAVE_VOP_PUTPAGES */ #ifdef HAVE_VOP_CMP -static int +int xfs_cmp(struct vnode * vp1, struct vnode * vp2) { - XFSDEB(XDEBVNOPS, ("xfs_cmp\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_cmp\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_CMP */ #ifdef HAVE_VOP_REALVP -static int +int xfs_realvp(struct vnode * vp, struct vnode ** vpp) { - XFSDEB(XDEBVNOPS, ("xfs_realvp\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_realvp\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_REALVP */ #ifdef HAVE_VOP_CNTL -static int +int xfs_cntl(struct vnode * vp, int cmd, caddr_t idata, @@ -1017,24 +1164,26 @@ xfs_cntl(struct vnode * vp, int iflag, int oflag) { - XFSDEB(XDEBVNOPS, ("xfs_cntl\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_cntl\n")); return EOPNOTSUPP; } #endif /* HAVE_VOP_CNTL */ #ifdef HAVE_VOP_PRINT -static int -xfs_print (struct vnode *vp) +int +xfs_print (struct vop_print_args *v) { - xfs_printnode_common (vp); + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap = v; + xfs_printnode_common (ap->a_vp); return 0; } #endif -#if 0 #ifdef HAVE_VOP_ADVLOCK -static int -xfs_advlock(void *v) +int +xfs_advlock(struct vop_advlock_args *v) { struct vop_advlock_args /* { struct vnode *a_vp; @@ -1043,36 +1192,38 @@ xfs_advlock(void *v) struct flock *a_fl; int a_flags; } */ *ap = v; - +#if 0 struct xfs_node *xn = VNODE_TO_XNODE(ap->a_vp); int ret; xfs_locktype_t locktype; -/* if (XFS_TOKEN_GOT(xn, */ +/* if (NNPFS_TOKEN_GOT(xn, */ -#if 0 if (ap->a_fl.l_start != 0 || ap->a_fl.l_end != 0) printf ("WARN: someone is trying byte-range locking\n"); switch (ap->a_op) { case F_SETLCK: - locktype = XFS_READLOCK; + locktype = NNPFS_READLOCK; break; ret = xfs_advlock_common (xn, ); return ret; -#else - return 0; -#endif +#elif defined(HAVE_KERNEL_LF_ADVLOCK) && !defined(__OpenBSD__) && !defined(__APPLE__) + struct xfs_node *xn = VNODE_TO_XNODE(ap->a_vp); + + return lf_advlock(ap, &xn->lockf, xn->attr.va_size); + #else + return EOPNOTSUPP; +#endif } #endif /* HAVE_VOP_ADVOCK */ -#endif #ifdef HAVE_VOP_REVOKE -static int -xfs_revoke(void *v) +int +xfs_revoke(struct vop_revoke_args *v) { #if defined(HAVE_KERNEL_GENFS_REVOKE) return genfs_revoke (v); @@ -1085,7 +1236,7 @@ xfs_revoke(void *v) #endif /* HAVE_VOP_REVOKE */ #ifdef HAVE_VOP_PAGEIN -static int +int xfs_pagein(struct vop_pagein_args *ap) { #ifdef __APPLE__ @@ -1107,6 +1258,10 @@ xfs_pagein(struct vop_pagein_args *ap) ret = VOP_READ(ap->a_vp, &uio, 0, ap->a_cred); + /* Zero out rest of last page if there wasn't enough data in the file */ + if (ret == 0 && uio.uio_resid > 0) + bzero(iov.iov_base, uio.uio_resid); + kernel_upl_unmap(kernel_map, ap->a_pl); if (ret) { @@ -1120,14 +1275,14 @@ xfs_pagein(struct vop_pagein_args *ap) return ret; #else - return (VOP_READ(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred)); +#error pagein on non apple ? #endif } #endif #ifdef HAVE_VOP_PAGEOUT -static int +int xfs_pageout(struct vop_pageout_args *ap) { #ifdef __APPLE__ @@ -1162,13 +1317,13 @@ xfs_pageout(struct vop_pageout_args *ap) return ret; #else - return (VOP_WRITE(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred)); +#error pageout on non apple ? #endif } #endif #ifdef HAVE_VOP_CREATEVOBJECT -static int +int xfs_createvobject(struct vop_createvobject_args *ap) /* struct vop_createvobject_args { @@ -1178,14 +1333,14 @@ struct vop_createvobject_args { }; */ { - XFSDEB(XDEBVNOPS, ("xfs_createvobject\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_createvobject\n")); return vop_stdcreatevobject (ap); } #endif /* HAVE_VOP_CREATEVOBJECT */ #ifdef HAVE_VOP_DESTROYVOBJECT -static int +int xfs_destroyvobject(struct vop_destroyvobject_args *ap) /* struct vop_destroyvobject_args { @@ -1193,14 +1348,14 @@ struct vop_destroyvobject_args { }; */ { - XFSDEB(XDEBVNOPS, ("xfs_destroyvobject\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_destroyvobject\n")); return vop_stddestroyvobject (ap); } #endif /* HAVE_VOP_DESTROYVOBJECT */ #ifdef HAVE_VOP_GETVOBJECT -static int +int xfs_getvobject(struct vop_getvobject_args *ap) /* struct vop_getvobject_args { @@ -1209,28 +1364,63 @@ struct vop_getvobject_args { }; */ { - XFSDEB(XDEBVNOPS, ("xfs_getvobject\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_getvobject\n")); return vop_stdgetvobject (ap); } #endif /* HAVE_VOP_GETVOBJECT */ +#ifdef HAVE_VOP_PATHCONF +int +xfs_pathconf(struct vop_pathconf_args *ap) +/* +struct vop_pathconf_args { + struct vnodeop_desc *a_desc; + struct vnode *a_vp; + int a_name; +}; +*/ +{ + NNPFSDEB(XDEBVNOPS, ("xfs_pathconf\n")); + +#ifdef HAVE_KERNEL_VOP_STDPATHCONF + return vop_stdpathconf(ap); +#else + return EOPNOTSUPP; +#endif +} +#endif + + + vop_t **xfs_vnodeop_p; int xfs_eopnotsupp (struct vop_generic_args *ap) { - XFSDEB(XDEBVNOPS, ("xfs_eopnotsupp %s\n", ap->a_desc->vdesc_name)); + NNPFSDEB(XDEBVNOPS, ("xfs_eopnotsupp %s\n", ap->a_desc->vdesc_name)); return EOPNOTSUPP; } int xfs_returnzero (struct vop_generic_args *ap) { - XFSDEB(XDEBVNOPS, ("xfs_returnzero %s\n", ap->a_desc->vdesc_name)); + NNPFSDEB(XDEBVNOPS, ("xfs_returnzero %s\n", ap->a_desc->vdesc_name)); return 0; } +void +xfs_pushdirty(struct vnode *vp, struct ucred *cred, d_thread_t *p) +{ +#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000 + VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES|PGO_SYNCIO|PGO_CLEANIT); +#elif defined(__APPLE__) + ubc_pushdirty(vp); +#endif +} + + + static struct vnodeopv_entry_desc xfs_vnodeop_entries[] = { {&vop_default_desc, (vop_t *) xfs_eopnotsupp}, #ifdef HAVE_VOP_LOOKUP @@ -1342,11 +1532,9 @@ static struct vnodeopv_entry_desc xfs_vnodeop_entries[] = { #ifdef HAVE_VOP_PRINT {&vop_print_desc, (vop_t *) xfs_print}, #endif -#if 0 #ifdef HAVE_VOP_ADVLOCK {&vop_advlock_desc, (vop_t *) xfs_advlock }, #endif -#endif #ifdef HAVE_VOP_PAGEIN {&vop_pagein_desc, (vop_t *) xfs_pagein }, #endif @@ -1362,6 +1550,9 @@ static struct vnodeopv_entry_desc xfs_vnodeop_entries[] = { #ifdef HAVE_VOP_GETVOBJECT {&vop_getvobject_desc, (vop_t *) xfs_getvobject }, #endif +#ifdef HAVE_VOP_PATHCONF + {&vop_pathconf_desc, (vop_t *) xfs_pathconf }, +#endif {(struct vnodeop_desc *) NULL, (int (*) (void *)) NULL} }; diff --git a/sys/xfs/xfs_vnodeops-common.c b/sys/xfs/xfs_vnodeops-common.c index cf2623bee3b..5117970b56b 100644 --- a/sys/xfs/xfs_vnodeops-common.c +++ b/sys/xfs/xfs_vnodeops-common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,7 +32,7 @@ */ /* - * XFS operations. + * NNPFS operations. */ #include <xfs/xfs_locl.h> @@ -44,45 +44,44 @@ #include <xfs/xfs_syscalls.h> #include <xfs/xfs_vnodeops.h> -RCSID("$Id: xfs_vnodeops-common.c,v 1.6 2002/06/07 04:10:32 hin Exp $"); +RCSID("$arla: xfs_vnodeops-common.c,v 1.94 2003/01/27 11:58:50 lha Exp $"); static void xfs_handle_stale(struct xfs_node *xn) { -#ifndef __OpenBSD__ struct vnode *vp = XNODE_TO_VNODE(xn); -#endif - if ((xn->flags & XFS_STALE) == 0) + if ((xn->flags & NNPFS_STALE) == 0) return; #if __APPLE__ if (UBCISVALID(vp) && !ubc_isinuse(vp, 1)) { - xn->flags &= ~XFS_STALE; - XFS_TOKEN_CLEAR(xn, ~0, - XFS_OPEN_MASK | XFS_ATTR_MASK | - XFS_DATA_MASK | XFS_LOCK_MASK); + xn->flags &= ~NNPFS_STALE; + ubc_setsize(vp, 0); + NNPFS_TOKEN_CLEAR(xn, ~0, + NNPFS_OPEN_MASK | NNPFS_ATTR_MASK | + NNPFS_DATA_MASK | NNPFS_LOCK_MASK); } #endif } int -xfs_open_valid(struct vnode *vp, struct ucred *cred, struct proc *p, +xfs_open_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, u_int tok) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - XFSDEB(XDEBVFOPS, ("xfs_open_valid\n")); + NNPFSDEB(XDEBVFOPS, ("xfs_open_valid\n")); xfs_handle_stale(xn); do { - if (!XFS_TOKEN_GOT(xn, tok)) { + if (!NNPFS_TOKEN_GOT(xn, tok)) { struct xfs_message_open msg; - msg.header.opcode = XFS_MSG_OPEN; + msg.header.opcode = NNPFS_MSG_OPEN; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); msg.handle = xn->handle; @@ -98,25 +97,25 @@ xfs_open_valid(struct vnode *vp, struct ucred *cred, struct proc *p, } while (error == 0); done: - XFSDEB(XDEBVFOPS, ("xfs_open_valid: error = %d\n", error)); + NNPFSDEB(XDEBVFOPS, ("xfs_open_valid: error = %d\n", error)); return error; } int -xfs_attr_valid(struct vnode *vp, struct ucred *cred, struct proc *p, +xfs_attr_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, u_int tok) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; xfs_pag_t pag = xfs_get_pag(cred); do { - if (!XFS_TOKEN_GOT(xn, tok)) { + if (!NNPFS_TOKEN_GOT(xn, tok) || !xfs_has_pag(xn, pag)) { struct xfs_message_getattr msg; - msg.header.opcode = XFS_MSG_GETATTR; + msg.header.opcode = NNPFS_MSG_GETATTR; msg.cred.uid = cred->cr_uid; msg.cred.pag = pag; msg.handle = xn->handle; @@ -133,63 +132,47 @@ done: } int -xfs_fetch_rights(struct vnode *vp, struct ucred *cred, struct proc *p) +xfs_data_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, + u_int tok, uint32_t want_offset) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - - xfs_pag_t pag = xfs_get_pag(cred); + uint32_t offset; + struct xfs_message_getdata msg; do { - if (!xfs_has_pag(xn, pag)) { - struct xfs_message_getattr msg; - - msg.header.opcode = XFS_MSG_GETATTR; - msg.cred.uid = cred->cr_uid; - msg.cred.pag = pag; - msg.handle = xn->handle; - error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); - if (error == 0) - error = ((struct xfs_message_wakeup *) & msg)->error; - } else { - goto done; + offset = want_offset; + if (NNPFS_TOKEN_GOT(xn, tok|NNPFS_ATTR_R) && offset > xn->attr.va_size) { + offset = xn->attr.va_size; } - } while (error == 0); - -done: - - return error; -} - -int -xfs_data_valid(struct vnode *vp, struct ucred *cred, struct proc *p, - u_int tok) -{ - struct xfs *xfsp = XFS_FROM_VNODE(vp); - struct xfs_node *xn = VNODE_TO_XNODE(vp); - int error = 0; - - do { - if (!XFS_TOKEN_GOT(xn, tok)) { - struct xfs_message_getdata msg; - - msg.header.opcode = XFS_MSG_GETDATA; - msg.cred.uid = cred->cr_uid; - msg.cred.pag = xfs_get_pag(cred); - msg.handle = xn->handle; - msg.tokens = tok; - - error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); - - if (error == 0) - error = ((struct xfs_message_wakeup *) & msg)->error; - } else { - goto done; + + NNPFSDEB(XDEBVNOPS, ("xfs_data_valid: offset: want %ld has %ld, " + "tokens: want %lx has %lx length: %ld\n", + (long) offset, (long) xn->offset, + (long) tok, (long) xn->tokens, + (long) xn->attr.va_size)); + + if (NNPFS_TOKEN_GOT(xn, tok)) { + if (offset <= xn->offset || xn->attr.va_type == VDIR) { + break; + } } + + msg.header.opcode = NNPFS_MSG_GETDATA; + msg.cred.uid = cred->cr_uid; + msg.cred.pag = xfs_get_pag(cred); + msg.handle = xn->handle; + msg.tokens = tok; + msg.offset = offset; + + error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); + + if (error == 0) + error = ((struct xfs_message_wakeup *) & msg)->error; + } while (error == 0); -done: return error; } @@ -197,50 +180,45 @@ int xfs_open_common(struct vnode *vp, int mode, struct ucred *cred, - struct proc *p) + d_thread_t *p) { struct xfs_node *xn = VNODE_TO_XNODE(vp); + int ret; - XFSDEB(XDEBVNOPS, ("xfs_open\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_open\n")); if (mode & FWRITE) { - if (xn->cred) - crfree (xn->cred); - crhold (cred); - xn->cred = cred; - return xfs_open_valid(vp, cred, p, XFS_OPEN_NW); + ret = xfs_open_valid(vp, cred, p, NNPFS_OPEN_NW); } else { - return xfs_open_valid(vp, cred, p, XFS_OPEN_NR); + ret = xfs_open_valid(vp, cred, p, NNPFS_OPEN_NR); } + + /* always update the read cred */ + + if (mode & FWRITE) + xfs_update_write_cred(xn, cred); + xfs_update_read_cred(xn, cred); + + return ret; } static int do_fsync(struct xfs *xfsp, struct xfs_node *xn, struct ucred *cred, - struct proc *p, + d_thread_t *p, u_int flag) { int error; struct xfs_message_putdata msg; -#if 0 - struct vnode *vp = XNODE_TO_VNODE(xn); - struct vnode *t = DATA_FROM_XNODE(xn); - vinvalbuf (vp, V_SAVE, cred, p, 0, 0); - - xfs_vfs_writelock(t, p); - vinvalbuf(t, V_SAVE, cred, p, 0, 0); - xfs_vfs_unlock(t, p); -#endif - - msg.header.opcode = XFS_MSG_PUTDATA; + msg.header.opcode = NNPFS_MSG_PUTDATA; if (cred != NOCRED) { msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } msg.handle = xn->handle; vattr2xfs_attr(&xn->attr, &msg.attr); @@ -252,20 +230,20 @@ do_fsync(struct xfs *xfsp, error = ((struct xfs_message_wakeup *) & msg)->error; if (error == 0) - xn->flags &= ~XFS_DATA_DIRTY; + xn->flags &= ~NNPFS_DATA_DIRTY; return error; } int xfs_fsync_common(struct vnode *vp, struct ucred *cred, - int waitfor, struct proc *proc) + int waitfor, d_thread_t *proc) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_fsync: %lx\n", (unsigned long)vp)); + NNPFSDEB(XDEBVNOPS, ("xfs_fsync: %lx\n", (unsigned long)vp)); /* * It seems that fsync is sometimes called after reclaiming a node. @@ -273,23 +251,22 @@ xfs_fsync_common(struct vnode *vp, struct ucred *cred, */ if (xn == NULL) { - printf("XFS PANIC WARNING! xfs_fsync called after reclaiming!\n"); + printf("NNPFS PANIC WARNING! xfs_fsync called after reclaiming!\n"); return 0; } -#ifdef __APPLE__ - ubc_pushdirty(vp); -#endif - if (xn->flags & XFS_DATA_DIRTY) { + xfs_pushdirty(vp, cred, proc); + + if (xn->flags & NNPFS_DATA_DIRTY) { #ifdef FSYNC_RECLAIM /* writing back the data from this vnode failed */ if (waitfor & FSYNC_RECLAIM) { printf("xfs_fsync: data lost, failed to write back\n"); - xn->flags &= ~XFS_DATA_DIRTY; + xn->flags &= ~NNPFS_DATA_DIRTY; return 0; } #endif - error = do_fsync(xfsp, xn, cred, proc, XFS_WRITE | XFS_FSYNC); + error = do_fsync(xfsp, xn, cred, proc, NNPFS_WRITE | NNPFS_FSYNC); } return error; @@ -297,22 +274,41 @@ xfs_fsync_common(struct vnode *vp, struct ucred *cred, int xfs_close_common(struct vnode *vp, int fflag, - struct proc *proc, struct ucred *cred) + d_thread_t *proc, struct ucred *cred) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - XFSDEB(XDEBVNOPS, + NNPFSDEB(XDEBVNOPS, ("xfs_close cred = %lx, fflag = %x, xn->flags = %x\n", (unsigned long)cred, fflag, xn->flags)); - if (fflag & FWRITE && xn->flags & XFS_DATA_DIRTY) - error = do_fsync(xfsp, xn, cred, proc, XFS_WRITE); + if (vp->v_type == VREG) + xfs_pushdirty(vp, cred, proc); + + if (fflag & FWRITE && xn->flags & NNPFS_DATA_DIRTY) + error = do_fsync(xfsp, xn, cred, proc, NNPFS_WRITE); return error; } +size_t +xfs_uio_end_length (struct uio *uio) +{ +#if DIAGNOSTIC + size_t sz = 0; + int i; + + for (i = 0; i < uio->uio_iovcnt; i++) + sz += uio->uio_iov[i].iov_len; + if (sz != uio->uio_resid) + panic("xfs_uio_end_length"); +#endif + return uio->uio_offset + uio->uio_resid; +} + + int xfs_read_common(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) @@ -320,28 +316,42 @@ xfs_read_common(struct vnode *vp, struct uio *uio, int ioflag, int error = 0; int i; - XFSDEB(XDEBVNOPS, ("xfs_read\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_read\n")); - error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uio), XFS_DATA_R); + xfs_update_read_cred(VNODE_TO_XNODE(vp), cred); - XFSDEB(XDEBVNOPS, ("xfs_read: iovcnt: %d\n", uio->uio_iovcnt)); +#ifdef HAVE_FREEBSD_THREAD + error = xfs_data_valid(vp, cred, xfs_uio_to_thread(uio), NNPFS_DATA_R, + xfs_uio_end_length(uio)); +#else + error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uio), NNPFS_DATA_R, + xfs_uio_end_length(uio)); +#endif + + NNPFSDEB(XDEBVNOPS, ("xfs_read: iovcnt: %d\n", uio->uio_iovcnt)); for (i = 0; i < uio->uio_iovcnt; i++) - XFSDEB(XDEBVNOPS, (" base: %lx len: %d\n", - (unsigned long)uio->uio_iov[i].iov_base, - uio->uio_iov[i].iov_len)); + NNPFSDEB(XDEBVNOPS, (" base: %lx len: %lu\n", + (unsigned long)uio->uio_iov[i].iov_base, + (unsigned long)uio->uio_iov[i].iov_len)); if (error == 0) { struct vnode *t = DATA_FROM_VNODE(vp); +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_readlock(t, xfs_uio_to_thread(uio)); + xfs_vop_read(t, uio, ioflag, cred, error); + xfs_vfs_unlock(t, xfs_uio_to_thread(uio)); +#else xfs_vfs_readlock(t, xfs_uio_to_proc(uio)); xfs_vop_read(t, uio, ioflag, cred, error); xfs_vfs_unlock(t, xfs_uio_to_proc(uio)); +#endif } - XFSDEB(XDEBVNOPS, ("xfs_read offset: %lu resid: %d\n", + NNPFSDEB(XDEBVNOPS, ("xfs_read offset: %lu resid: %lu\n", (unsigned long)uio->uio_offset, - uio->uio_resid)); - XFSDEB(XDEBVNOPS, ("xfs_read error: %d\n", error)); + (unsigned long)uio->uio_resid)); + NNPFSDEB(XDEBVNOPS, ("xfs_read error: %d\n", error)); return error; } @@ -350,29 +360,50 @@ int xfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag, struct ucred *cred) { + struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_write\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_write\n")); - error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), XFS_DATA_W); + xfs_update_write_cred(xn, cred); + +#ifdef HAVE_FREEBSD_THREAD + error = xfs_data_valid(vp, cred, xfs_uio_to_thread(uiop), NNPFS_DATA_W, + VNODE_TO_XNODE(vp)->attr.va_size); +#else + error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), NNPFS_DATA_W, + VNODE_TO_XNODE(vp)->attr.va_size); +#endif if (error == 0) { - struct xfs_node *xn = VNODE_TO_XNODE(vp); struct vnode *t = DATA_FROM_XNODE(xn); struct vattr sub_attr; int error2 = 0; + #ifdef HAVE_FREEBSD_THREAD + xfs_vfs_writelock(t, xfs_uio_to_thread(uiop)); + xfs_vop_write(t, uiop, ioflag, cred, error); + VNODE_TO_XNODE(vp)->flags |= NNPFS_DATA_DIRTY; + xfs_vop_getattr(t, &sub_attr, cred, xfs_uio_to_thread(uiop), error2); + #else xfs_vfs_writelock(t, xfs_uio_to_proc(uiop)); xfs_vop_write(t, uiop, ioflag, cred, error); - VNODE_TO_XNODE(vp)->flags |= XFS_DATA_DIRTY; + VNODE_TO_XNODE(vp)->flags |= NNPFS_DATA_DIRTY; xfs_vop_getattr(t, &sub_attr, cred, xfs_uio_to_proc(uiop), error2); + #endif if (error2 == 0) { xn->attr.va_size = sub_attr.va_size; + xn->attr.va_bytes = sub_attr.va_size; xn->attr.va_mtime = sub_attr.va_mtime; xfs_set_vp_size(vp, sub_attr.va_size); + xn->offset = sub_attr.va_size; } +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_unlock(t, xfs_uio_to_thread(uiop)); +#else xfs_vfs_unlock(t, xfs_uio_to_proc(uiop)); +#endif } return error; @@ -380,15 +411,15 @@ xfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag, int xfs_getattr_common(struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct proc *p) + struct ucred *cred, d_thread_t *p) { int error = 0; struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_getattr\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_getattr\n")); - error = xfs_attr_valid(vp, cred, p, XFS_ATTR_R); + error = xfs_attr_valid(vp, cred, p, NNPFS_ATTR_R); if (error == 0) *vap = xn->attr; return error; @@ -396,51 +427,52 @@ xfs_getattr_common(struct vnode *vp, struct vattr *vap, int xfs_setattr_common(struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct proc *p) + struct ucred *cred, d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_setattr\n")); - -#define CHECK_XFSATTR(A, cast) (vap->A == cast VNOVAL || vap->A == xn->attr.A) - if (CHECK_XFSATTR(va_mode,(mode_t)) && - CHECK_XFSATTR(va_nlink,(short)) && - CHECK_XFSATTR(va_size,(va_size_t)) && - CHECK_XFSATTR(va_uid,(uid_t)) && - CHECK_XFSATTR(va_gid,(gid_t)) && - CHECK_XFSATTR(va_mtime.tv_sec,(unsigned int)) && - CHECK_XFSATTR(va_fileid,(long)) && - CHECK_XFSATTR(va_type,(enum vtype))) + NNPFSDEB(XDEBVNOPS, ("xfs_setattr\n")); + +#define CHECK_NNPFSATTR(A, cast) (vap->A == cast VNOVAL || vap->A == xn->attr.A) + if (CHECK_NNPFSATTR(va_mode,(mode_t)) && + CHECK_NNPFSATTR(va_nlink,(short)) && + CHECK_NNPFSATTR(va_size,(va_size_t)) && + CHECK_NNPFSATTR(va_uid,(uid_t)) && + CHECK_NNPFSATTR(va_gid,(gid_t)) && + CHECK_NNPFSATTR(va_mtime.tv_sec,(unsigned int)) && + CHECK_NNPFSATTR(va_fileid,(long)) && + CHECK_NNPFSATTR(va_type,(enum vtype))) return 0; /* Nothing to do */ -#undef CHECK_XFSATTR +#undef CHECK_NNPFSATTR - if (XFS_TOKEN_GOT(xn, XFS_ATTR_W)) { + if (NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_W)) { /* Update attributes and mark them dirty. */ - VNODE_TO_XNODE(vp)->flags |= XFS_ATTR_DIRTY; + VNODE_TO_XNODE(vp)->flags |= NNPFS_ATTR_DIRTY; error = EINVAL; /* XXX not yet implemented */ goto done; } else { struct xfs_message_putattr msg; - msg.header.opcode = XFS_MSG_PUTATTR; + msg.header.opcode = NNPFS_MSG_PUTATTR; if (cred != NOCRED) { msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } msg.handle = xn->handle; vattr2xfs_attr(vap, &msg.attr); - if (XFS_TOKEN_GOT(xn, XFS_DATA_R)) { + if (NNPFS_TOKEN_GOT(xn, NNPFS_DATA_R)) { if (vp->v_type == VREG) { if (vap->va_size != (va_size_t)VNOVAL) XA_SET_SIZE(&msg.attr, vap->va_size); else XA_SET_SIZE(&msg.attr, xn->attr.va_size); #ifdef __APPLE__ + /* XXX needed ? */ if (UBCINFOEXISTS(vp)) ubc_setsize(vp, msg.attr.xa_size); #endif @@ -451,7 +483,7 @@ xfs_setattr_common(struct vnode *vp, struct vattr *vap, XA_SET_MTIME(&msg.attr, xn->attr.va_mtime.tv_sec); } - XFS_TOKEN_CLEAR(xn, XFS_ATTR_VALID, XFS_ATTR_MASK); + NNPFS_TOKEN_CLEAR(xn, NNPFS_ATTR_VALID, NNPFS_ATTR_MASK); error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); if (error == 0) error = ((struct xfs_message_wakeup *) & msg)->error; @@ -467,27 +499,27 @@ check_rights (u_char rights, int mode) int error = 0; if (mode & VREAD) - if ((rights & XFS_RIGHT_R) == 0) + if ((rights & NNPFS_RIGHT_R) == 0) error = EACCES; if (mode & VWRITE) - if ((rights & XFS_RIGHT_W) == 0) + if ((rights & NNPFS_RIGHT_W) == 0) error = EACCES; if (mode & VEXEC) - if ((rights & XFS_RIGHT_X) == 0) + if ((rights & NNPFS_RIGHT_X) == 0) error = EACCES; return error; } int xfs_access_common(struct vnode *vp, int mode, struct ucred *cred, - struct proc *p) + d_thread_t *p) { int error = 0; xfs_pag_t pag = xfs_get_pag(cred); - XFSDEB(XDEBVNOPS, ("xfs_access mode = 0%o\n", mode)); + NNPFSDEB(XDEBVNOPS, ("xfs_access mode = 0%o\n", mode)); - error = xfs_attr_valid(vp, cred, p, XFS_ATTR_R); + error = xfs_attr_valid(vp, cred, p, NNPFS_ATTR_R); if (error == 0) { struct xfs_node *xn = VNODE_TO_XNODE(vp); int i; @@ -497,9 +529,7 @@ xfs_access_common(struct vnode *vp, int mode, struct ucred *cred, if (error == 0) goto done; - XFSDEB(XDEBVNOPS, ("xfs_access anonaccess failed\n")); - - xfs_fetch_rights(vp, cred, p); /* ignore error */ + NNPFSDEB(XDEBVNOPS, ("xfs_access anonaccess failed\n")); error = EACCES; /* default to EACCES if pag isn't in xn->id */ @@ -511,7 +541,7 @@ xfs_access_common(struct vnode *vp, int mode, struct ucred *cred, } done: - XFSDEB(XDEBVNOPS, ("xfs_access(0%o) = %d\n", mode, error)); + NNPFSDEB(XDEBVNOPS, ("xfs_access(0%o) = %d\n", mode, error)); return error; } @@ -522,17 +552,22 @@ xfs_lookup_common(struct vnode *dvp, struct vnode **vpp) { struct xfs_message_getnode msg; - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *d = VNODE_TO_XNODE(dvp); int error = 0; - struct proc *proc = xfs_cnp_to_proc(cnp); +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *proc = xfs_cnp_to_thread(cnp); + struct ucred *cred = xfs_thread_to_cred(proc); +#else + d_thread_t *proc = xfs_cnp_to_proc(cnp); struct ucred *cred = xfs_proc_to_cred(proc); +#endif - XFSDEB(XDEBVNOPS, ("xfs_lookup_common: enter\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_lookup_common: enter\n")); *vpp = NULL; - if (cnp->cn_namelen >= XFS_MAX_NAME) + if (cnp->cn_namelen >= NNPFS_MAX_NAME) return ENAMETOOLONG; if (dvp->v_type != VDIR) @@ -549,7 +584,11 @@ xfs_lookup_common(struct vnode *dvp, if (error != 0) goto done; - XFSDEB(XDEBVNOPS, ("xfs_lookup_common: dvp = %lx\n", (unsigned long) dvp)); + NNPFSDEB(XDEBVNOPS, ("xfs_lookup_common: dvp = %lx\n", + (unsigned long) dvp)); + NNPFSDEB(XDEBVNOPS, ("xfs_lookup_common: cnp = %lx, " + "cnp->cn_nameiop = %d\n", + (unsigned long) cnp, (int)cnp->cn_nameiop)); error = xfs_dnlc_lookup(dvp, cnp, vpp); @@ -567,13 +606,13 @@ xfs_lookup_common(struct vnode *dvp, } #endif - msg.header.opcode = XFS_MSG_GETNODE; + msg.header.opcode = NNPFS_MSG_GETNODE; if (cnp->cn_cred != NOCRED) { msg.cred.uid = cnp->cn_cred->cr_uid; msg.cred.pag = xfs_get_pag(cnp->cn_cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } msg.parent_handle = d->handle; memcpy(msg.name, cnp->cn_nameptr, cnp->cn_namelen); @@ -583,7 +622,7 @@ xfs_lookup_common(struct vnode *dvp, if (error == 0) error = ((struct xfs_message_wakeup *) & msg)->error; if(error == ENOENT && cnp->cn_nameiop != CREATE) { - XFSDEB(XDEBVNOPS, ("xfs_lookup: neg cache %lx (%s, %ld)\n", + NNPFSDEB(XDEBVNOPS, ("xfs_lookup: neg cache %lx (%s, %ld)\n", (unsigned long)dvp, cnp->cn_nameptr, cnp->cn_namelen)); xfs_dnlc_enter (dvp, cnp, NULL); @@ -595,7 +634,7 @@ xfs_lookup_common(struct vnode *dvp, } while (error == 0); done: - XFSDEB(XDEBVNOPS, ("xfs_lookup_common: return\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_lookup_common: return error = %d\n", error)); return error; } @@ -604,20 +643,20 @@ xfs_create_common(struct vnode *dvp, const char *name, struct vattr *vap, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_create: (%lx, %s)\n", + NNPFSDEB(XDEBVNOPS, ("xfs_create: (%lx, %s)\n", (unsigned long)dvp, name)); { struct xfs_message_create msg; - msg.header.opcode = XFS_MSG_CREATE; + msg.header.opcode = NNPFS_MSG_CREATE; msg.parent_handle = xn->handle; - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) return ENAMETOOLONG; vattr2xfs_attr(vap, &msg.attr); @@ -627,7 +666,7 @@ xfs_create_common(struct vnode *dvp, msg.cred.pag = xfs_get_pag(cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } @@ -650,21 +689,21 @@ xfs_remove_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); struct xfs_message_remove msg; int error; - XFSDEB(XDEBVNOPS, ("xfs_remove: %s\n", name)); + NNPFSDEB(XDEBVNOPS, ("xfs_remove: %s\n", name)); - msg.header.opcode = XFS_MSG_REMOVE; + msg.header.opcode = NNPFS_MSG_REMOVE; msg.parent_handle = xn->handle; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) error = ENAMETOOLONG; else error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); @@ -685,12 +724,12 @@ xfs_rename_common(struct vnode *fdvp, struct vnode *tvp, const char *tname, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(fdvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(fdvp); int error; - XFSDEB(XDEBVNOPS, ("xfs_rename: %s %s\n", fname, tname)); + NNPFSDEB(XDEBVNOPS, ("xfs_rename: %s %s\n", fname, tname)); if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -700,12 +739,12 @@ xfs_rename_common(struct vnode *fdvp, { struct xfs_message_rename msg; - msg.header.opcode = XFS_MSG_RENAME; + msg.header.opcode = NNPFS_MSG_RENAME; msg.old_parent_handle = VNODE_TO_XNODE(fdvp)->handle; - if (strlcpy(msg.old_name, fname, sizeof(msg.old_name)) >= XFS_MAX_NAME) + if (strlcpy(msg.old_name, fname, sizeof(msg.old_name)) >= NNPFS_MAX_NAME) return ENAMETOOLONG; msg.new_parent_handle = VNODE_TO_XNODE(tdvp)->handle; - if (strlcpy(msg.new_name, tname, sizeof(msg.new_name)) >= XFS_MAX_NAME) + if (strlcpy(msg.new_name, tname, sizeof(msg.new_name)) >= NNPFS_MAX_NAME) return ENAMETOOLONG; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); @@ -715,7 +754,7 @@ xfs_rename_common(struct vnode *fdvp, } - XFSDEB(XDEBVNOPS, ("xfs_rename: error = %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_rename: error = %d\n", error)); return error; } @@ -725,19 +764,19 @@ xfs_mkdir_common(struct vnode *dvp, const char *name, struct vattr *vap, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_mkdir: %s\n", name)); + NNPFSDEB(XDEBVNOPS, ("xfs_mkdir: %s\n", name)); { struct xfs_message_mkdir msg; - msg.header.opcode = XFS_MSG_MKDIR; + msg.header.opcode = NNPFS_MSG_MKDIR; msg.parent_handle = xn->handle; - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) return ENAMETOOLONG; vattr2xfs_attr(vap, &msg.attr); if (cred != NOCRED) { @@ -745,7 +784,7 @@ xfs_mkdir_common(struct vnode *dvp, msg.cred.pag = xfs_get_pag(cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); if (error == 0) @@ -760,20 +799,20 @@ xfs_rmdir_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); struct xfs_message_rmdir msg; int error; - XFSDEB(XDEBVNOPS, ("xfs_rmdir: %s\n", name)); + NNPFSDEB(XDEBVNOPS, ("xfs_rmdir: %s\n", name)); - msg.header.opcode = XFS_MSG_RMDIR; + msg.header.opcode = NNPFS_MSG_RMDIR; msg.parent_handle = xn->handle; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) error = ENAMETOOLONG; else error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); @@ -783,7 +822,7 @@ xfs_rmdir_common(struct vnode *dvp, if (error == 0) xfs_dnlc_purge (vp); - XFSDEB(XDEBVNOPS, ("xfs_rmdir error: %d\n", error)); + NNPFSDEB(XDEBVNOPS, ("xfs_rmdir error: %d\n", error)); return error; } @@ -792,30 +831,48 @@ int xfs_readdir_common(struct vnode *vp, struct uio *uiop, struct ucred *cred, - struct proc *p, + d_thread_t *p, int *eofflag) { int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_readdir\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_readdir\n")); if(eofflag) *eofflag = 0; - error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), XFS_DATA_R); +#ifdef HAVE_FREEBSD_THREAD + error = xfs_data_valid(vp, cred, xfs_uio_to_thread(uiop), NNPFS_DATA_R, + xfs_uio_end_length(uiop)); +#else + error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), NNPFS_DATA_R, + xfs_uio_end_length(uiop)); +#endif if (error == 0) { struct vnode *t = DATA_FROM_VNODE(vp); +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_readlock(t, xfs_uio_to_thread(uiop)); +#else xfs_vfs_readlock(t, xfs_uio_to_proc(uiop)); +#endif xfs_vop_read(t, uiop, 0, cred, error); if (eofflag) { struct vattr t_attr; int error2; +#ifdef HAVE_FREEBSD_THREAD + xfs_vop_getattr(t, &t_attr, cred, xfs_uio_to_thread(uiop), error2); +#else xfs_vop_getattr(t, &t_attr, cred, xfs_uio_to_proc(uiop), error2); +#endif if (error2 == 0) *eofflag = t_attr.va_size <= uiop->uio_offset; } +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_unlock(t, xfs_uio_to_thread(uiop)); +#else xfs_vfs_unlock(t, xfs_uio_to_proc(uiop)); +#endif } return error; } @@ -825,20 +882,20 @@ xfs_link_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p) + d_thread_t *p) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); struct xfs_node *xn2 = VNODE_TO_XNODE(vp); struct xfs_message_link msg; int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_link: %s\n", name)); + NNPFSDEB(XDEBVNOPS, ("xfs_link: %s\n", name)); - msg.header.opcode = XFS_MSG_LINK; + msg.header.opcode = NNPFS_MSG_LINK; msg.parent_handle = xn->handle; msg.from_handle = xn2->handle; - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) return ENAMETOOLONG; msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); @@ -857,26 +914,31 @@ xfs_symlink_common(struct vnode *dvp, struct vattr *vap, char *target) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); - struct proc *proc = xfs_cnp_to_proc(cnp); +#ifdef HAVE_FREEBSD_THREAD + d_thread_t *proc = xfs_cnp_to_thread(cnp); + struct ucred *cred = xfs_thread_to_cred(proc); +#else + d_thread_t *proc = xfs_cnp_to_proc(cnp); struct ucred *cred = xfs_proc_to_cred(proc); +#endif struct xfs_message_symlink msg; const char *name = cnp->cn_nameptr; int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_symlink: %s\n", name)); + NNPFSDEB(XDEBVNOPS, ("xfs_symlink: %s\n", name)); - msg.header.opcode = XFS_MSG_SYMLINK; + msg.header.opcode = NNPFS_MSG_SYMLINK; msg.parent_handle = xn->handle; vattr2xfs_attr(vap, &msg.attr); msg.cred.uid = cred->cr_uid; msg.cred.pag = xfs_get_pag(cred); - if (strlcpy (msg.contents, target, sizeof(msg.contents)) >= XFS_MAX_SYMLINK_CONTENT) { + if (strlcpy (msg.contents, target, sizeof(msg.contents)) >= NNPFS_MAX_SYMLINK_CONTENT) { error = ENAMETOOLONG; goto done; } - if (strlcpy(msg.name, name, sizeof(msg.name)) >= XFS_MAX_NAME) { + if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) { error = ENAMETOOLONG; goto done; } @@ -893,26 +955,38 @@ xfs_readlink_common(struct vnode *vp, struct uio *uiop, struct ucred *cred) { int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_readlink\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_readlink\n")); - error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), XFS_DATA_R); +#ifdef HAVE_FREEBSD_THREAD + error = xfs_data_valid(vp, cred, xfs_uio_to_thread(uiop), NNPFS_DATA_R, + xfs_uio_end_length(uiop)); +#else + error = xfs_data_valid(vp, cred, xfs_uio_to_proc(uiop), NNPFS_DATA_R, + xfs_uio_end_length(uiop)); +#endif if (error == 0) { struct vnode *t = DATA_FROM_VNODE(vp); +#ifdef HAVE_FREEBSD_THREAD + xfs_vfs_readlock(t, xfs_uio_to_thread(uiop)); + xfs_vop_read(t, uiop, 0, cred, error); + xfs_vfs_unlock(t, xfs_uio_to_thread(uiop)); +#else xfs_vfs_readlock(t, xfs_uio_to_proc(uiop)); xfs_vop_read(t, uiop, 0, cred, error); xfs_vfs_unlock(t, xfs_uio_to_proc(uiop)); +#endif } return error; } int -xfs_inactive_common(struct vnode *vp, struct proc *p) +xfs_inactive_common(struct vnode *vp, d_thread_t *p) { int error; struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_inactive, %lx\n", + NNPFSDEB(XDEBVNOPS, ("xfs_inactive, %lx\n", (unsigned long)vp)); /* @@ -921,34 +995,41 @@ xfs_inactive_common(struct vnode *vp, struct proc *p) */ if (xn == NULL) { - XFSDEB(XDEBVNOPS, ("xfs_inactive: clean node\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_inactive: clean node\n")); return 0; } - /* xn->cred not set -> NOCRED */ + /* xn->wr_cred not set -> NOCRED */ + + if (vp->v_type == VREG) + xfs_pushdirty(vp, xn->wr_cred, p); - error = xfs_fsync_common(vp, xn->cred, /* XXX */ 0, p); + error = xfs_fsync_common(vp, xn->wr_cred, /* XXX */ 0, p); if (error) { printf ("xfs_inactive: failed writing back data: %d\n", error); - xn->flags &= ~XFS_DATA_DIRTY; + xn->flags &= ~NNPFS_DATA_DIRTY; } -#ifndef __osf__ - xfs_vfs_unlock(vp, p); /* If this node is no longer valid, recycle immediately. */ - if (!XFS_TOKEN_GOT(xn, XFS_ATTR_R | XFS_ATTR_W) - || (xn->flags & XFS_STALE) == XFS_STALE) { - XFSDEB(XDEBVNOPS, ("xfs_inactive: vrecycle\n")); + if (!NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_R | NNPFS_ATTR_W) + || (xn->flags & NNPFS_STALE) == NNPFS_STALE) + { +#ifndef __osf__ + xfs_vfs_unlock(vp, p); + NNPFSDEB(XDEBVNOPS, ("xfs_inactive: vrecycle\n")); vrecycle(vp, 0, p); - } -#else - - XFSDEB(XDEBVNOPS, ("xfs_inactive: vp = %lx vp->v_usecount= %d\n", - (unsigned long)vp, vp?vp->v_usecount:0)); +#else /* __osf__ */ + NNPFSDEB(XDEBVNOPS, ("xfs_inactive: vp = %lx vp->v_usecount= %d\n", + (unsigned long)vp, vp?vp->v_usecount:0)); +#endif /* __osf__ */ + } else { +#ifndef __osf__ + xfs_vfs_unlock(vp, p); #endif - xn->flags &= ~XFS_STALE; + xn->flags &= ~NNPFS_STALE; + } - XFSDEB(XDEBVNOPS, ("return: xfs_inactive\n")); + NNPFSDEB(XDEBVNOPS, ("return: xfs_inactive\n")); return 0; } @@ -957,25 +1038,27 @@ int xfs_reclaim_common(struct vnode *vp) { struct xfs_message_inactivenode msg; - struct xfs *xfsp = XFS_FROM_VNODE(vp); + struct xfs *xfsp = NNPFS_FROM_VNODE(vp); struct xfs_node *xn = VNODE_TO_XNODE(vp); - XFSDEB(XDEBVNOPS, ("xfs_reclaim: %lx\n", + NNPFSDEB(XDEBVNOPS, ("xfs_reclaim: %lx\n", (unsigned long)vp)); - XFS_TOKEN_CLEAR(xn, + NNPFS_TOKEN_CLEAR(xn, ~0, - XFS_OPEN_MASK | XFS_ATTR_MASK | - XFS_DATA_MASK | XFS_LOCK_MASK); + NNPFS_OPEN_MASK | NNPFS_ATTR_MASK | + NNPFS_DATA_MASK | NNPFS_LOCK_MASK); /* Release, data if we still have it. */ if (DATA_FROM_XNODE(xn) != 0) { vrele(DATA_FROM_XNODE(xn)); DATA_FROM_XNODE(xn) = 0; } - msg.header.opcode = XFS_MSG_INACTIVENODE; + xfs_remove_node(&xfsp->nodehead, xn); + + msg.header.opcode = NNPFS_MSG_INACTIVENODE; msg.handle = xn->handle; - msg.flag = XFS_NOREFS | XFS_DELETE; + msg.flag = NNPFS_NOREFS | NNPFS_DELETE; xfs_message_send(xfsp->fd, &msg.header, sizeof(msg)); xfs_dnlc_purge(vp); @@ -995,15 +1078,15 @@ xfs_advlock_common(struct vnode *dvp, unsigned long lockid, /* XXX this good ? */ struct ucred *cred) { - struct xfs *xfsp = XFS_FROM_VNODE(dvp); + struct xfs *xfsp = NNPFS_FROM_VNODE(dvp); struct xfs_node *xn = VNODE_TO_XNODE(dvp); int error = 0; - XFSDEB(XDEBVNOPS, ("xfs_advlock\n")); + NNPFSDEB(XDEBVNOPS, ("xfs_advlock\n")); { struct xfs_message_advlock msg; - msg.header.opcode = XFS_MSG_ADVLOCK; + msg.header.opcode = NNPFS_MSG_ADVLOCK; msg.handle = xn->handle; msg.locktype = locktype; msg.lockid = lockid; @@ -1013,7 +1096,7 @@ xfs_advlock_common(struct vnode *dvp, msg.cred.pag = xfs_get_pag(cred); } else { msg.cred.uid = 0; - msg.cred.pag = XFS_ANONYMOUSID; + msg.cred.pag = NNPFS_ANONYMOUSID; } error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p); if (error == 0) @@ -1046,8 +1129,9 @@ xfs_printnode_common (struct vnode *vp) printf ("xnode: fid: %d.%d.%d.%d\n", xn->handle.a, xn->handle.b, xn->handle.c, xn->handle.d); printf ("\tattr: %svalid\n", - XFS_TOKEN_GOT(xn, XFS_ATTR_VALID) ? "": "in"); + NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_VALID) ? "": "in"); printf ("\tdata: %svalid\n", - XFS_TOKEN_GOT(xn, XFS_DATA_VALID) ? "": "in"); + NNPFS_TOKEN_GOT(xn, NNPFS_DATA_VALID) ? "": "in"); printf ("\tflags: 0x%x\n", xn->flags); + printf ("\toffset: %d\n", xn->offset); } diff --git a/sys/xfs/xfs_vnodeops.h b/sys/xfs/xfs_vnodeops.h index 84261ab6341..de344ad0758 100644 --- a/sys/xfs/xfs_vnodeops.h +++ b/sys/xfs/xfs_vnodeops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: xfs_vnodeops.h,v 1.4 2002/06/07 04:10:32 hin Exp $ */ +/* $arla: xfs_vnodeops.h,v 1.25 2002/09/07 10:46:12 lha Exp $ */ #ifndef _xfs_vnodeops_h #define _xfs_vnodeops_h @@ -83,33 +83,33 @@ #endif int -xfs_open_valid(struct vnode *vp, struct ucred *cred, struct proc *p, +xfs_open_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, u_int tok); int -xfs_attr_valid(struct vnode *vp, struct ucred *cred, struct proc *p, +xfs_attr_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, u_int tok); int -xfs_fetch_rights(struct vnode *vp, struct ucred *cred, struct proc *p); +xfs_fetch_rights(struct vnode *vp, struct ucred *cred, d_thread_t *p); int -xfs_data_valid(struct vnode *vp, struct ucred *cred, struct proc *p, - u_int tok); +xfs_data_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p, + u_int tok, uint32_t offset); int xfs_open_common(struct vnode *vp, int mode, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_fsync_common(struct vnode *vp, struct ucred *cred, - int waitfor, struct proc *proc); + int waitfor, d_thread_t *proc); int xfs_close_common(struct vnode *vp, int fflag, - struct proc *proc, struct ucred *cred); + d_thread_t *proc, struct ucred *cred); int xfs_read_common(struct vnode *vp, struct uio *uio, int ioflag, @@ -121,15 +121,15 @@ xfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag, int xfs_getattr_common(struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct proc *p); + struct ucred *cred, d_thread_t *p); int xfs_setattr_common(struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct proc *p); + struct ucred *cred, d_thread_t *p); int xfs_access_common(struct vnode *vp, int mode, - struct ucred *cred, struct proc *p); + struct ucred *cred, d_thread_t *p); int xfs_lookup_common(struct vnode *dvp, @@ -141,14 +141,14 @@ xfs_create_common(struct vnode *dvp, const char *name, struct vattr *vap, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_remove_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_rename_common(struct vnode *fdvp, @@ -158,27 +158,27 @@ xfs_rename_common(struct vnode *fdvp, struct vnode *tvp, const char *tname, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_mkdir_common(struct vnode *dvp, const char *name, struct vattr *vap, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_rmdir_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_readdir_common(struct vnode *vp, struct uio *uiop, struct ucred *cred, - struct proc *p, + d_thread_t *p, int *eofflag); int @@ -186,7 +186,7 @@ xfs_link_common(struct vnode *dvp, struct vnode *vp, const char *name, struct ucred *cred, - struct proc *p); + d_thread_t *p); int xfs_symlink_common(struct vnode *dvp, @@ -199,7 +199,7 @@ int xfs_readlink_common(struct vnode *vp, struct uio *uiop, struct ucred *cred); int -xfs_inactive_common(struct vnode *vp, struct proc *p); +xfs_inactive_common(struct vnode *vp, d_thread_t *p); int xfs_reclaim_common(struct vnode *vp); @@ -213,4 +213,8 @@ xfs_returnzero (struct vop_generic_args *ap); void xfs_printnode_common (struct vnode *vp); +size_t +xfs_uio_end_length (struct uio *uio); + + #endif /* _xfs_vnodeops_h */ diff --git a/sys/xfs/xfs_vopdefs.h b/sys/xfs/xfs_vopdefs.h index b31fa1ac4d3..c3220589e1d 100644 --- a/sys/xfs/xfs_vopdefs.h +++ b/sys/xfs/xfs_vopdefs.h @@ -1,40 +1,80 @@ #define HAVE_VOP_ISLOCKED 1 +NNPFS_VOP_DEF(islocked); #define HAVE_VOP_LOOKUP 1 +NNPFS_VOP_DEF(lookup); #define HAVE_VOP_CREATE 1 +NNPFS_VOP_DEF(create); #define HAVE_VOP_MKNOD 1 +NNPFS_VOP_DEF(mknod); #define HAVE_VOP_OPEN 1 +NNPFS_VOP_DEF(open); #define HAVE_VOP_CLOSE 1 +NNPFS_VOP_DEF(close); #define HAVE_VOP_ACCESS 1 +NNPFS_VOP_DEF(access); #define HAVE_VOP_GETATTR 1 +NNPFS_VOP_DEF(getattr); #define HAVE_VOP_SETATTR 1 +NNPFS_VOP_DEF(setattr); #define HAVE_VOP_READ 1 +NNPFS_VOP_DEF(read); #define HAVE_VOP_WRITE 1 +NNPFS_VOP_DEF(write); #define HAVE_VOP_LEASE 1 +NNPFS_VOP_DEF(lease); #define HAVE_VOP_IOCTL 1 +NNPFS_VOP_DEF(ioctl); #define HAVE_VOP_SELECT 1 +NNPFS_VOP_DEF(select); #define HAVE_VOP_KQFILTER 1 +NNPFS_VOP_DEF(kqfilter); #define HAVE_VOP_REVOKE 1 +NNPFS_VOP_DEF(revoke); #define HAVE_VOP_FSYNC 1 +NNPFS_VOP_DEF(fsync); #define HAVE_VOP_REMOVE 1 +NNPFS_VOP_DEF(remove); #define HAVE_VOP_LINK 1 +NNPFS_VOP_DEF(link); #define HAVE_VOP_RENAME 1 +NNPFS_VOP_DEF(rename); #define HAVE_VOP_MKDIR 1 +NNPFS_VOP_DEF(mkdir); #define HAVE_VOP_RMDIR 1 +NNPFS_VOP_DEF(rmdir); #define HAVE_VOP_SYMLINK 1 +NNPFS_VOP_DEF(symlink); #define HAVE_VOP_READDIR 1 +NNPFS_VOP_DEF(readdir); #define HAVE_VOP_READLINK 1 +NNPFS_VOP_DEF(readlink); #define HAVE_VOP_ABORTOP 1 +NNPFS_VOP_DEF(abortop); #define HAVE_VOP_INACTIVE 1 +NNPFS_VOP_DEF(inactive); #define HAVE_VOP_RECLAIM 1 +NNPFS_VOP_DEF(reclaim); #define HAVE_VOP_LOCK 1 +NNPFS_VOP_DEF(lock); #define HAVE_VOP_UNLOCK 1 +NNPFS_VOP_DEF(unlock); #define HAVE_VOP_BMAP 1 +NNPFS_VOP_DEF(bmap); #define HAVE_VOP_PRINT 1 +NNPFS_VOP_DEF(print); #define HAVE_VOP_PATHCONF 1 +NNPFS_VOP_DEF(pathconf); #define HAVE_VOP_ADVLOCK 1 +NNPFS_VOP_DEF(advlock); #define HAVE_VOP_REALLOCBLKS 1 +NNPFS_VOP_DEF(reallocblks); #define HAVE_VOP_WHITEOUT 1 +NNPFS_VOP_DEF(whiteout); #define HAVE_VOP_GETEXTATTR 1 +NNPFS_VOP_DEF(getextattr); #define HAVE_VOP_SETEXTATTR 1 +NNPFS_VOP_DEF(setextattr); #define HAVE_VOP_STRATEGY 1 +NNPFS_VOP_DEF(strategy); #define HAVE_VOP_BWRITE 1 +NNPFS_VOP_DEF(bwrite); |