LINUX_KMEM_CACHE_INIT
LINUX_HAVE_KMEM_CACHE_T
LINUX_KMEM_CACHE_CREATE_TAKES_DTOR
+ LINUX_D_PATH_TAKES_STRUCT_PATH
+ LINUX_NEW_EXPORT_OPS
LINUX_CONFIG_H_EXISTS
LINUX_COMPLETION_H_EXISTS
LINUX_EXPORTFS_H_EXISTS
/* #define OSI_EXPORT_DEBUG */
extern struct dentry_operations afs_dentry_operations;
+#if defined(NEW_EXPORT_OPS)
+static struct dentry *afs_export_get_dentry(struct super_block *sb,
+ void *inump);
+#endif
struct get_name_data {
char *name;
return AFSFH_NET_CELLFID;
}
+#if defined(NEW_EXPORT_OPS)
+static struct dentry *afs_fh_to_dentry(struct super_block *sb, struct fid *fh_fid,
+ int fh_len, int fh_type)
+#else
static struct dentry *afs_decode_fh(struct super_block *sb, __u32 *fh,
int fh_len, int fh_type,
int (*acceptable)(void *, struct dentry *),
void *context)
+#endif
{
struct VenusFid fid;
struct cell *tc;
struct dentry *result;
+#if defined(NEW_EXPORT_OPS)
+ __u32 *fh = (__u32 *)fh_fid->raw;
+#endif
+
switch (fh_type) {
case AFSFH_VENUSFID:
break;
case AFSFH_NET_VENUSFID:
- if (fh_len != 4)
- return NULL;
fid.Cell = ntohl(fh[0]);
fid.Fid.Volume = ntohl(fh[1]);
fid.Fid.Vnode = ntohl(fh[2]);
return NULL;
}
+#if defined(NEW_EXPORT_OPS)
+ result = afs_export_get_dentry(sb, &fid);
+#else
result = sb->s_export_op->find_exported_dentry(sb, &fid, 0,
acceptable, context);
+
+#endif
+
#ifdef OSI_EXPORT_DEBUG
if (!result) {
printk("afs: decode_fh(0x%08x/%d/%d.%d): no dentry\n",
struct export_operations afs_export_ops = {
.encode_fh = afs_encode_fh,
+#if defined(NEW_EXPORT_OPS)
+ .fh_to_dentry = afs_fh_to_dentry,
+#else
.decode_fh = afs_decode_fh,
.get_dentry = afs_export_get_dentry,
+#endif
.get_name = afs_export_get_name,
.get_parent = afs_export_get_parent,
};
int followlink, char **pathp)
{
struct dentry *dp = NULL;
- struct vfsmnt *mnt = NULL;
+ struct vfsmount *mnt = NULL;
char *tname, *path;
int code;
return -PTR_ERR(tname);
code = osi_lookupname_internal(tname, followlink, &mnt, &dp);
if (!code) {
+#if defined(D_PATH_TAKES_STRUCT_PATH)
+ struct path p = { mnt, dp };
+ path = d_path(&p, buf, buflen);
+#else
path = d_path(dp, mnt, buf, buflen);
+#endif
if (IS_ERR(path)) {
code = -PTR_ERR(path);
nfssrv_list = 0;
RWLOCK_INIT(&afs_xnfssrv, "afs_xnfssrv");
- if (authtab) afs_authtab = authtab;
+ if (authtab && !IS_ERR(authtab))
+ afs_authtab = authtab;
else if (authtab_addr) afs_authtab = (struct auth_ops **)authtab_addr;
else {
printk("Warning: Unable to find the address of authtab\n");
char path[64];
#endif
+ remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs);
+#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+ remove_proc_entry("unixusers", openafs_procfs);
+#endif
#if defined(EXPORTED_PROC_ROOT_FS)
remove_proc_entry(PROC_FSDIRNAME, proc_root_fs);
#else
sprintf(path, "fs/%s", PROC_FSDIRNAME);
remove_proc_entry(path, NULL);
#endif
- remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs);
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
- remove_proc_entry("unixusers", openafs_procfs);
-#endif
}
int afs_was_mounted = 0; /* Used to force reload if mount/unmount/mount */
extern struct super_operations afs_sops;
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX26_ENV) && !defined(AFS_NONFSTRANS)
extern struct export_operations afs_export_ops;
#endif
extern afs_rwlock_t afs_xvcache;
sb->s_blocksize_bits = 10;
sb->s_magic = AFS_VFSMAGIC;
sb->s_op = &afs_sops; /* Super block (vfs) ops */
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX26_ENV) && !defined(AFS_NONFSTRANS)
sb->s_export_op = &afs_export_ops;
#endif
#if defined(MAX_NON_LFS)
char *afs_sysnamelist[MAXNUMSYSNAMES];
int afs_sysnamecount = 0;
int afs_sysnamegen = 0;
+afs_int32 afs_showflags = GAGUSER | GAGCONSOLE; /* show all messages */
void afs_Daemon(void)
-/* * * * * * *
- * this code badly needs to be cleaned up... too many ugly ifdefs.
- * XXX
- */
-#if 0
-void
-afs_warn(char *a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j)
-#else
-void
-afs_warn(a, b, c, d, e, f, g, h, i, j)
- char *a;
-#if defined( AFS_USE_VOID_PTR)
- void *b, *c, *d, *e, *f, *g, *h, *i, *j;
-#else
- long b, c, d, e, f, g, h, i, j;
-#endif
-#endif
-{
- AFS_STATCNT(afs_warn);
-
- if (afs_showflags & GAGCONSOLE) {
-#if defined(AFS_AIX_ENV)
- struct file *fd;
-
- /* cf. console_printf() in oncplus/kernext/nfs/serv/shared.c */
- if (fp_open
- ("/dev/console", O_WRONLY | O_NOCTTY | O_NDELAY, 0666, 0, FP_SYS,
- &fd) == 0) {
- char buf[1024];
- ssize_t len;
- ssize_t count;
-
- sprintf(buf, a, b, c, d, e, f, g, h, i, j);
- len = strlen(buf);
- fp_write(fd, buf, len, 0, UIO_SYSSPACE, &count);
- fp_close(fd);
- }
-#else
- printf(a, b, c, d, e, f, g, h, i, j);
-#endif
- }
-}
-
-#if 0
-void
-afs_warnuser(char *a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j)
-#else
-void
-afs_warnuser(a, b, c, d, e, f, g, h, i, j)
- char *a;
- long b, c, d, e, f, g, h, i, j;
-#endif
-{
- AFS_STATCNT(afs_warnuser);
- if (afs_showflags & GAGUSER) {
-#ifdef AFS_GLOBAL_SUNLOCK
- int haveGlock = ISAFS_GLOCK();
- if (haveGlock)
- AFS_GUNLOCK();
-#endif /* AFS_GLOBAL_SUNLOCK */
-
- uprintf(a, b, c, d, e, f, g, h, i, j);
-
-#ifdef AFS_GLOBAL_SUNLOCK
- if (haveGlock)
- AFS_GLOCK();
-#endif /* AFS_GLOBAL_SUNLOCK */
- }
-}
-
-
/* run everywhere, checking locks */
void
afs_CheckLocks(void)
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/*
+ * afs_warn.c - afs_warn
+ *
+ * Implements: afs_warn, afs_warnuser
+ */
+#include <afsconfig.h>
+#include "afs/param.h"
+
+RCSID
+ ("$Header$");
+
+#include "afs/stds.h"
+#include "afs/sysincludes.h" /* Standard vendor system headers */
+
+#if !defined(UKERNEL)
+#if !defined(AFS_LINUX20_ENV)
+#include <net/if.h>
+#endif
+#include <netinet/in.h>
+
+#ifdef AFS_SGI62_ENV
+#include "h/hashing.h"
+#endif
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
+#include <netinet/in_var.h>
+#endif /* ! AFS_HPUX110_ENV */
+#endif /* !defined(UKERNEL) */
+
+#include "afsincludes.h" /* Afs-based standard headers */
+#include "afs/afs_stats.h" /* afs statistics */
+
+#if defined(AFS_SUN56_ENV)
+#include <inet/led.h>
+#include <inet/common.h>
+#if defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
+#include <inet/ip.h>
+#endif
+
+#if defined(AFS_AIX_ENV)
+#include <sys/fp_io.h>
+#endif
+
+
+
+/* * * * * * *
+ * this code badly needs to be cleaned up... too many ugly ifdefs.
+ * XXX
+ */
+#if 0
+void
+afs_warn(char *a, long b, long c, long d, long e, long f, long g, long h,
+ long i, long j)
+#else
+void
+afs_warn(a, b, c, d, e, f, g, h, i, j)
+ char *a;
+#if defined( AFS_USE_VOID_PTR)
+ void *b, *c, *d, *e, *f, *g, *h, *i, *j;
+#else
+ long b, c, d, e, f, g, h, i, j;
+#endif
+#endif
+{
+ AFS_STATCNT(afs_warn);
+
+ if (afs_showflags & GAGCONSOLE) {
+#if defined(AFS_AIX_ENV)
+ struct file *fd;
+
+ /* cf. console_printf() in oncplus/kernext/nfs/serv/shared.c */
+ if (fp_open
+ ("/dev/console", O_WRONLY | O_NOCTTY | O_NDELAY, 0666, 0, FP_SYS,
+ &fd) == 0) {
+ char buf[1024];
+ ssize_t len;
+ ssize_t count;
+
+ sprintf(buf, a, b, c, d, e, f, g, h, i, j);
+ len = strlen(buf);
+ fp_write(fd, buf, len, 0, UIO_SYSSPACE, &count);
+ fp_close(fd);
+ }
+#else
+ printf(a, b, c, d, e, f, g, h, i, j);
+#endif
+ }
+}
+
+#if 0
+void
+afs_warnuser(char *a, long b, long c, long d, long e, long f, long g, long h,
+ long i, long j)
+#else
+void
+afs_warnuser(a, b, c, d, e, f, g, h, i, j)
+ char *a;
+ long b, c, d, e, f, g, h, i, j;
+#endif
+{
+ AFS_STATCNT(afs_warnuser);
+ if (afs_showflags & GAGUSER) {
+#ifdef AFS_GLOBAL_SUNLOCK
+ int haveGlock = ISAFS_GLOCK();
+ if (haveGlock)
+ AFS_GUNLOCK();
+#endif /* AFS_GLOBAL_SUNLOCK */
+
+ uprintf(a, b, c, d, e, f, g, h, i, j);
+
+#ifdef AFS_GLOBAL_SUNLOCK
+ if (haveGlock)
+ AFS_GLOCK();
+#endif /* AFS_GLOBAL_SUNLOCK */
+ }
+}
AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
fi])
+AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
+ AC_MSG_CHECKING([if d_path() takes a struct path argument])
+ AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
+ AC_TRY_KBUILD(
+[#include <linux/dcache.h>],
+[struct path *p;
+d_path(p, NULL, 0);],
+ ac_cv_linux_d_path_takes_struct_path=yes,
+ ac_cv_linux_d_path_takes_struct_path=no)])
+ AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
+ if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
+ AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
+ fi])
+
+AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
+ AC_MSG_CHECKING([if kernel uses new export ops])
+ AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
+ AC_TRY_KBUILD(
+[#include <linux/exportfs.h>],
+[struct export_operations _eops;
+_eops.fh_to_parent(NULL, NULL, 0, 0);],
+ ac_cv_linux_new_export_ops=yes,
+ ac_cv_linux_new_export_ops=no)])
+ AC_MSG_RESULT($ac_cv_linux_new_export_ops)
+ if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
+ AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
+ fi])
+
afs_vnop_symlink.o \
afs_vnop_write.o \
afs_volume.o \
+ afs_warn.o \
afsaux.o \
Kvice.xdr.o \
xdr_arrayn.o \
afs_pag_user.o \
afs_stat.o \
afs_syscall.o \
+ afs_warn.o \
afsaux.o \
xdr_arrayn.o \
xdr_array.o \
$(CRULE_OPT)
afs_util.o: $(TOP_SRC_AFS)/afs_util.c
$(CRULE_OPT)
+afs_warn.o: $(TOP_SRC_AFS)/afs_warn.c
+ $(CRULE_OPT)
afs_vcache.o: $(TOP_SRC_AFS)/afs_vcache.c
$(CRULE_OPT)
afs_vnop_access.o: $(TOP_SRC_VNOPS)/afs_vnop_access.c