aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1998-03-27 06:23:32 +0000
committerH. Peter Anvin <hpa@zytor.com>1998-03-27 06:23:32 +0000
commitb8e3086fcd7c7e8bfa202a6da4215a871c268fa0 (patch)
treedc1bfa1391205eeaf1a0ae7662c014c36cfa1d45
parentf5888e2e45e3170f0003fee359f35f839ba468ea (diff)
downloadautofs3-b8e3086fcd7c7e8bfa202a6da4215a871c268fa0.tar.gz
autofs3-b8e3086fcd7c7e8bfa202a6da4215a871c268fa0.tar.xz
autofs3-b8e3086fcd7c7e8bfa202a6da4215a871c268fa0.zip
No more kernel diffs.
-rw-r--r--Makefile.rules2
-rw-r--r--kernel-2.0.30.diff1816
2 files changed, 1 insertions, 1817 deletions
diff --git a/Makefile.rules b/Makefile.rules
index e1618d8..8d73e26 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -29,7 +29,7 @@
SUBDIRS = daemon modules man
INCDIRS = include samples
INCFILES = COPYING COPYRIGHT NEWS README TODO Makefile Makefile.rules \
- .version *.diff
+ .version
# Compilers, linkers and flags
# The STRIP defined here *must not* remove any dynamic-loading symbols
diff --git a/kernel-2.0.30.diff b/kernel-2.0.30.diff
deleted file mode 100644
index 4cbb04f..0000000
--- a/kernel-2.0.30.diff
+++ /dev/null
@@ -1,1816 +0,0 @@
-diff -urN 2.0.30/linux/Documentation/Configure.help linux/Documentation/Configure.help
---- 2.0.30/linux/Documentation/Configure.help Tue Apr 8 08:47:45 1997
-+++ linux/Documentation/Configure.help Thu May 1 12:35:18 1997
-@@ -3112,6 +3112,17 @@
- Documentation/modules.txt. If you haven't heard about all of this
- before, it's safe to say N.
-
-+Kernel automounter support (experimental)
-+CONFIG_AUTOFS_FS
-+ The automounter is a tool to automatically mount remote filesystems
-+ on demand. This implementation is partially kernel-based to reduce
-+ overhead in the already-mounted case; this is unlike the BSD
-+ automounter (amd), which is only in user space. To use the
-+ automounter you also need the user-space tools from
-+ ftp.kernel.org:/pub/linux/daemons/autofs. If you are not a part of
-+ a fairly large, distributed network, you probably do not need an
-+ automounter, and can say N here.
-+
- BSD UFS filesystem support (read only)
- CONFIG_UFS_FS
- BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD
-diff -urN 2.0.30/linux/MAINTAINERS linux/MAINTAINERS
---- 2.0.30/linux/MAINTAINERS Tue Apr 8 08:47:45 1997
-+++ linux/MAINTAINERS Thu May 1 12:35:18 1997
-@@ -363,6 +363,18 @@
- M: jam@acm.org
- S: Maintained
-
-+KERNEL AUTOMOUNTER (AUTOFS)
-+P: H. Peter Anvin
-+M: hpa@zytor.com
-+L: autofs@linux.kernel.org
-+S: Maintained
-+
-+DEVICE NUMBER REGISTRY
-+P: H. Peter Anvin
-+M: hpa@zytor.com
-+L: linux-kernel@vger.rutgers.edu
-+S: Maintained
-+
- REST:
- P: Linus Torvalds
- S: Buried alive in email
-diff -urN 2.0.30/linux/arch/alpha/defconfig linux/arch/alpha/defconfig
---- 2.0.30/linux/arch/alpha/defconfig Tue Oct 29 17:42:40 1996
-+++ linux/arch/alpha/defconfig Thu May 1 12:35:18 1997
-@@ -196,6 +196,7 @@
- # CONFIG_HPFS_FS is not set
- # CONFIG_SYSV_FS is not set
- # CONFIG_UFS_FS is not set
-+# CONFIG_AUTOFS_FS is not set
-
- #
- # Character devices
-diff -urN 2.0.30/linux/arch/i386/defconfig linux/arch/i386/defconfig
---- 2.0.30/linux/arch/i386/defconfig Tue Oct 29 17:42:40 1996
-+++ linux/arch/i386/defconfig Thu May 1 12:35:18 1997
-@@ -146,6 +146,7 @@
- # CONFIG_HPFS_FS is not set
- # CONFIG_SYSV_FS is not set
- # CONFIG_UFS_FS is not set
-+# CONFIG_AUTOFS_FS is not set
-
- #
- # Character devices
-diff -urN 2.0.30/linux/arch/m68k/defconfig linux/arch/m68k/defconfig
---- 2.0.30/linux/arch/m68k/defconfig Mon May 6 02:44:30 1996
-+++ linux/arch/m68k/defconfig Thu May 1 12:35:18 1997
-@@ -122,6 +122,7 @@
- # CONFIG_ISO9660_FS is not set
- # CONFIG_HPFS_FS is not set
- # CONFIG_SYSV_FS is not set
-+# CONFIG_AUTOFS_FS is not set
- # CONFIG_AFFS_FS is not set
- # CONFIG_UFS_FS is not set
-
-diff -urN 2.0.30/linux/arch/mips/defconfig linux/arch/mips/defconfig
---- 2.0.30/linux/arch/mips/defconfig Wed Feb 7 19:41:50 1996
-+++ linux/arch/mips/defconfig Thu May 1 12:35:18 1997
-@@ -61,6 +61,7 @@
- # CONFIG_ISO9660_FS is not set
- # CONFIG_HPFS_FS is not set
- # CONFIG_SYSV_FS is not set
-+# CONFIG_AUTOFS_FS is not set
- # CONFIG_SMB_FS is not set
-
- #
-diff -urN 2.0.30/linux/arch/sparc/defconfig linux/arch/sparc/defconfig
---- 2.0.30/linux/arch/sparc/defconfig Thu Apr 25 03:22:05 1996
-+++ linux/arch/sparc/defconfig Thu May 1 12:35:18 1997
-@@ -114,6 +114,7 @@
- # CONFIG_HPFS_FS is not set
- # CONFIG_SYSV_FS is not set
- # CONFIG_AFFS_FS is not set
-+# CONFIG_AUTOFS_FS is not set
- CONFIG_UFS_FS=y
-
- #
-diff -urN 2.0.30/linux/drivers/sound/Config.in linux/drivers/sound/Config.in
---- 2.0.30/linux/drivers/sound/Config.in Wed Jul 10 04:34:03 1996
-+++ linux/drivers/sound/Config.in Fri May 2 11:33:47 1997
-@@ -2,10 +2,10 @@
- # Sound driver configuration
- #
- #--------
--# There is another confic script which is compatible with rest of
-+# There is another config script which is compatible with rest of
- # the kernel. It can be activated by running 'make mkscript' in this
- # directory. Please note that this is an _experimental_ feature which
--# doesn't work with all cards (PSS, SM Wave, AudioTriX Pro, Maui).
-+# doesn't work with all cards (PSS, SM Wave, AudioTrix Pro, Maui).
- #--------
- #
- $MAKE -C drivers/sound config || exit 1
-diff -urN 2.0.30/linux/fs/Config.in linux/fs/Config.in
---- 2.0.30/linux/fs/Config.in Sun Dec 1 05:58:05 1996
-+++ linux/fs/Config.in Thu May 1 12:35:18 1997
-@@ -39,6 +39,9 @@
- tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
- tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-+ tristate 'Kernel automounter support (experimental)' CONFIG_AUTOFS_FS
-+fi
-+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- tristate 'Amiga FFS filesystem support (EXPERIMENTAL)' CONFIG_AFFS_FS
- if [ "$CONFIG_AFFS_FS" != "n" ]; then
- define_bool CONFIG_AMIGA_PARTITION y
-diff -urN 2.0.30/linux/fs/Makefile linux/fs/Makefile
---- 2.0.30/linux/fs/Makefile Wed May 8 08:28:01 1996
-+++ linux/fs/Makefile Thu May 1 12:35:18 1997
-@@ -17,7 +17,7 @@
-
- MOD_LIST_NAME := FS_MODULES
- ALL_SUB_DIRS = minix ext ext2 fat msdos vfat proc isofs nfs xiafs umsdos \
-- hpfs sysv smbfs ncpfs ufs affs
-+ hpfs sysv smbfs ncpfs ufs affs autofs
-
- ifeq ($(CONFIG_QUOTA),y)
- O_OBJS += dquot.o
-@@ -154,6 +154,14 @@
- else
- ifeq ($(CONFIG_AFFS_FS),m)
- MOD_SUB_DIRS += affs
-+ endif
-+endif
-+
-+ifeq ($(CONFIG_AUTOFS_FS),y)
-+SUB_DIRS += autofs
-+else
-+ ifeq ($(CONFIG_AUTOFS_FS),m)
-+ MOD_SUB_DIRS += autofs
- endif
- endif
-
-diff -urN 2.0.30/linux/fs/autofs/Makefile linux/fs/autofs/Makefile
---- 2.0.30/linux/fs/autofs/Makefile Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/Makefile Wed May 28 21:38:35 1997
-@@ -0,0 +1,35 @@
-+#
-+# Makefile for the linux autofs-filesystem routines.
-+#
-+# We can build this either out of the kernel tree or the autofs tools tree.
-+#
-+
-+O_TARGET := autofs.o
-+O_OBJS := dir.o dirhash.o init.o inode.o root.o symlink.o waitq.o
-+
-+M_OBJS := $(O_TARGET)
-+
-+ifdef TOPDIR
-+#
-+# Part of the kernel code
-+#
-+include $(TOPDIR)/Rules.make
-+else
-+#
-+# Standalone (handy for development)
-+#
-+include ../Makefile.rules
-+
-+CFLAGS += -D__KERNEL__ -DMODULE $(KFLAGS) -I../include -I$(KINCLUDE) $(MODFLAGS)
-+
-+all: $(O_TARGET)
-+
-+$(O_TARGET): $(O_OBJS)
-+ $(LD) -r -o $(O_TARGET) $(O_OBJS)
-+
-+install: $(O_TARGET)
-+ install -c $(O_TARGET) /lib/modules/`uname -r`/fs
-+
-+clean:
-+ rm -f *.o *.s
-+endif
-diff -urN 2.0.30/linux/fs/autofs/autofs_i.h linux/fs/autofs/autofs_i.h
---- 2.0.30/linux/fs/autofs/autofs_i.h Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/autofs_i.h Wed May 28 21:38:35 1997
-@@ -0,0 +1,187 @@
-+/* -*- linux-c -*- ------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/autofs_i.h
-+ *
-+ * Copyright 1997 Transmeta Corporation - All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ----------------------------------------------------------------------- */
-+
-+/* Internal header file for autofs */
-+
-+#include <linux/auto_fs.h>
-+
-+/* This is the range of ioctl() numbers we claim as ours */
-+#define AUTOFS_IOC_FIRST AUTOFS_IOC_READY
-+#define AUTOFS_IOC_COUNT 32
-+
-+#include <linux/kernel.h>
-+#include <linux/malloc.h>
-+#include <linux/sched.h>
-+#include <linux/string.h>
-+#include <linux/wait.h>
-+
-+#define kver(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-+
-+#if LINUX_VERSION_CODE < kver(2,1,0)
-+
-+/* Segmentation stuff for pre-2.1 kernels */
-+#include <asm/segment.h>
-+
-+static inline int copy_to_user(void *dst, void *src, unsigned long len)
-+{
-+ int rv = verify_area(VERIFY_WRITE, dst, len);
-+ if ( rv )
-+ return -1;
-+ memcpy_tofs(dst,src,len);
-+ return 0;
-+}
-+
-+static inline int copy_from_user(void *dst, void *src, unsigned long len)
-+{
-+ int rv = verify_area(VERIFY_READ, src, len);
-+ if ( rv )
-+ return -1;
-+ memcpy_fromfs(dst,src,len);
-+ return 0;
-+}
-+
-+#else
-+
-+/* Segmentation stuff for post-2.1 kernels */
-+#include <asm/uaccess.h>
-+#define register_symtab(x) ((void)0)
-+
-+#endif
-+
-+#ifdef DEBUG
-+#define DPRINTK(D) printk D;
-+#else
-+#define DPRINTK(D)
-+#endif
-+
-+#define AUTOFS_SUPER_MAGIC 0x0187
-+
-+/* Structures associated with the root directory hash */
-+
-+#define AUTOFS_HASH_SIZE 67
-+
-+typedef u32 autofs_hash_t; /* Type returned by autofs_hash() */
-+
-+struct autofs_dir_ent {
-+ autofs_hash_t hash;
-+ struct autofs_dir_ent *next;
-+ struct autofs_dir_ent **back;
-+ char *name;
-+ int len;
-+ ino_t ino;
-+ /* The following entries are for the expiry system */
-+ unsigned long last_usage;
-+ struct autofs_dir_ent *exp_next;
-+ struct autofs_dir_ent *exp_prev;
-+};
-+
-+struct autofs_dirhash {
-+ struct autofs_dir_ent *h[AUTOFS_HASH_SIZE];
-+ struct autofs_dir_ent expiry_head;
-+};
-+
-+struct autofs_wait_queue {
-+ unsigned long wait_queue_token;
-+ struct wait_queue *queue;
-+ struct autofs_wait_queue *next;
-+ /* We use the following to see what we are waiting for */
-+ autofs_hash_t hash;
-+ int len;
-+ char *name;
-+ /* This is for status reporting upon return */
-+ int status;
-+ int wait_ctr;
-+};
-+
-+struct autofs_symlink {
-+ int len;
-+ char *data;
-+ time_t mtime;
-+};
-+
-+#define AUTOFS_MAX_SYMLINKS 256
-+
-+#define AUTOFS_ROOT_INO 1
-+#define AUTOFS_FIRST_SYMLINK 2
-+#define AUTOFS_FIRST_DIR_INO (AUTOFS_FIRST_SYMLINK+AUTOFS_MAX_SYMLINKS)
-+
-+#define AUTOFS_SYMLINK_BITMAP_LEN ((AUTOFS_MAX_SYMLINKS+31)/32)
-+
-+#ifndef END_OF_TIME
-+#define END_OF_TIME ((time_t)((unsigned long)((time_t)(~0UL)) >> 1))
-+#endif
-+
-+#define AUTOFS_SBI_MAGIC 0x6d4a556d
-+
-+struct autofs_sb_info {
-+ u32 magic;
-+ struct file *pipe;
-+ pid_t oz_pgrp;
-+ int catatonic;
-+ unsigned long exp_timeout;
-+ ino_t next_dir_ino;
-+ struct autofs_wait_queue *queues; /* Wait queue pointer */
-+ struct autofs_dirhash dirhash; /* Root directory hash */
-+ struct autofs_symlink symlink[AUTOFS_MAX_SYMLINKS];
-+ u32 symlink_bitmap[AUTOFS_SYMLINK_BITMAP_LEN];
-+};
-+
-+/* autofs_oz_mode(): do we see the man behind the curtain? */
-+static inline int autofs_oz_mode(struct autofs_sb_info *sbi) {
-+ return sbi->catatonic || current->pgrp == sbi->oz_pgrp;
-+}
-+
-+/* Debug the mysteriously disappearing wait list */
-+
-+#ifdef DEBUG_WAITLIST
-+#define CHECK_WAITLIST(S,O) autofs_check_waitlist_integrity(S,O)
-+void autofs_check_waitlist_integrity(struct autofs_sb_info *,char *);
-+#else
-+#define CHECK_WAITLIST(S,O)
-+#endif
-+
-+/* Hash operations */
-+
-+autofs_hash_t autofs_hash(const char *,int);
-+void autofs_initialize_hash(struct autofs_dirhash *);
-+struct autofs_dir_ent *autofs_hash_lookup(const struct autofs_dirhash *,autofs_hash_t,const char *,int);
-+void autofs_hash_insert(struct autofs_dirhash *,struct autofs_dir_ent *);
-+void autofs_hash_delete(struct autofs_dir_ent *);
-+struct autofs_dir_ent *autofs_hash_enum(const struct autofs_dirhash *,off_t *);
-+void autofs_hash_nuke(struct autofs_dirhash *);
-+
-+/* Expiration-handling functions */
-+
-+void autofs_update_usage(struct autofs_dirhash *,struct autofs_dir_ent *);
-+struct autofs_dir_ent *autofs_expire(struct autofs_dirhash *,unsigned long);
-+
-+/* Operations structures */
-+
-+extern struct inode_operations autofs_root_inode_operations;
-+extern struct inode_operations autofs_symlink_inode_operations;
-+extern struct inode_operations autofs_dir_inode_operations;
-+
-+/* Initializing function */
-+
-+struct super_block *autofs_read_super(struct super_block *, void *,int);
-+
-+/* Queue management functions */
-+
-+int autofs_wait(struct autofs_sb_info *,autofs_hash_t,const char *,int);
-+int autofs_wait_release(struct autofs_sb_info *,unsigned long,int);
-+void autofs_catatonic_mode(struct autofs_sb_info *);
-+
-+#ifdef DEBUG
-+void autofs_say(const char *name, int len);
-+#else
-+#define autofs_say(n,l)
-+#endif
-diff -urN 2.0.30/linux/fs/autofs/dir.c linux/fs/autofs/dir.c
---- 2.0.30/linux/fs/autofs/dir.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/dir.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,90 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/dir.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include "autofs_i.h"
-+
-+static int autofs_dir_readdir(struct inode *inode, struct file *filp,
-+ void *dirent, filldir_t filldir)
-+{
-+ if (!inode || !S_ISDIR(inode->i_mode))
-+ return -ENOTDIR;
-+
-+ switch((unsigned long) filp->f_pos)
-+ {
-+ case 0:
-+ if (filldir(dirent, ".", 1, 0, inode->i_ino) < 0)
-+ return 0;
-+ filp->f_pos++;
-+ /* fall through */
-+ case 1:
-+ if (filldir(dirent, "..", 2, 1, AUTOFS_ROOT_INO) < 0)
-+ return 0;
-+ filp->f_pos++;
-+ /* fall through */
-+ }
-+ return 1;
-+}
-+
-+static int autofs_dir_lookup(struct inode *dir, const char *name, int len,
-+ struct inode **result)
-+{
-+ *result = dir;
-+ if (!len)
-+ return 0;
-+ if (name[0] == '.') {
-+ if (len == 1)
-+ return 0;
-+ if (name[1] == '.' && len == 2) {
-+ /* Return the root directory */
-+ *result = iget(dir->i_sb,AUTOFS_ROOT_INO);
-+ iput(dir);
-+ return 0;
-+ }
-+ }
-+ *result = NULL;
-+ iput(dir);
-+ return -ENOENT; /* No other entries */
-+}
-+
-+static struct file_operations autofs_dir_operations = {
-+ NULL, /* lseek */
-+ NULL, /* read */
-+ NULL, /* write */
-+ autofs_dir_readdir, /* readdir */
-+ NULL, /* select */
-+ NULL, /* ioctl */
-+ NULL, /* mmap */
-+ NULL, /* open */
-+ NULL, /* release */
-+ NULL /* fsync */
-+};
-+
-+struct inode_operations autofs_dir_inode_operations = {
-+ &autofs_dir_operations, /* file operations */
-+ NULL, /* create */
-+ autofs_dir_lookup, /* lookup */
-+ NULL, /* link */
-+ NULL, /* unlink */
-+ NULL, /* symlink */
-+ NULL, /* mkdir */
-+ NULL, /* rmdir */
-+ NULL, /* mknod */
-+ NULL, /* rename */
-+ NULL, /* readlink */
-+ NULL, /* follow_link */
-+ NULL, /* read_page */
-+ NULL, /* writepage */
-+ NULL, /* bmap */
-+ NULL, /* truncate */
-+ NULL /* permission */
-+};
-+
-diff -urN 2.0.30/linux/fs/autofs/dirhash.c linux/fs/autofs/dirhash.c
---- 2.0.30/linux/fs/autofs/dirhash.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/dirhash.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,172 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/dirhash.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include "autofs_i.h"
-+
-+/* Functions for maintenance of expiry queue */
-+
-+static void autofs_init_usage(struct autofs_dirhash *dh,
-+ struct autofs_dir_ent *ent)
-+{
-+ ent->exp_next = &dh->expiry_head;
-+ ent->exp_prev = dh->expiry_head.exp_prev;
-+ dh->expiry_head.exp_prev->exp_next = ent;
-+ dh->expiry_head.exp_prev = ent;
-+ ent->last_usage = jiffies;
-+}
-+
-+static void autofs_delete_usage(struct autofs_dir_ent *ent)
-+{
-+ ent->exp_prev->exp_next = ent->exp_next;
-+ ent->exp_next->exp_prev = ent->exp_prev;
-+}
-+
-+void autofs_update_usage(struct autofs_dirhash *dh,
-+ struct autofs_dir_ent *ent)
-+{
-+ autofs_delete_usage(ent); /* Unlink from current position */
-+ autofs_init_usage(dh,ent); /* Relink at queue tail */
-+}
-+
-+struct autofs_dir_ent *autofs_expire(struct autofs_dirhash *dh,
-+ unsigned long timeout)
-+{
-+ struct autofs_dir_ent *ent;
-+
-+ ent = dh->expiry_head.exp_next;
-+
-+ if ( ent == &(dh->expiry_head) ) return NULL;
-+ return (jiffies - ent->last_usage >= timeout) ? ent : NULL;
-+}
-+
-+/* Adapted from the Dragon Book, page 436 */
-+/* This particular hashing algorithm requires autofs_hash_t == u32 */
-+autofs_hash_t autofs_hash(const char *name, int len)
-+{
-+ autofs_hash_t h = 0;
-+ while ( len-- ) {
-+ h = (h << 4) + (unsigned char) (*name++);
-+ h ^= ((h & 0xf0000000) >> 24);
-+ }
-+ return h;
-+}
-+
-+void autofs_initialize_hash(struct autofs_dirhash *dh) {
-+ memset(&dh->h, 0, AUTOFS_HASH_SIZE*sizeof(struct autofs_dir_ent *));
-+ dh->expiry_head.exp_next = dh->expiry_head.exp_prev =
-+ &dh->expiry_head;
-+}
-+
-+struct autofs_dir_ent *autofs_hash_lookup(const struct autofs_dirhash *dh, autofs_hash_t hash, const char *name, int len)
-+{
-+ struct autofs_dir_ent *dhn;
-+
-+ DPRINTK(("autofs_hash_lookup: hash = 0x%08x, name = ", hash));
-+ autofs_say(name,len);
-+
-+ for ( dhn = dh->h[hash % AUTOFS_HASH_SIZE] ; dhn ; dhn = dhn->next ) {
-+ if ( hash == dhn->hash &&
-+ len == dhn->len &&
-+ !memcmp(name, dhn->name, len) )
-+ break;
-+ }
-+
-+ return dhn;
-+}
-+
-+void autofs_hash_insert(struct autofs_dirhash *dh, struct autofs_dir_ent *ent)
-+{
-+ struct autofs_dir_ent **dhnp;
-+
-+ DPRINTK(("autofs_hash_insert: hash = 0x%08x, name = ", ent->hash));
-+ autofs_say(ent->name,ent->len);
-+
-+ autofs_init_usage(dh,ent);
-+
-+ dhnp = &dh->h[ent->hash % AUTOFS_HASH_SIZE];
-+ ent->next = *dhnp;
-+ ent->back = dhnp;
-+ *dhnp = ent;
-+}
-+
-+void autofs_hash_delete(struct autofs_dir_ent *ent)
-+{
-+ *(ent->back) = ent->next;
-+
-+ autofs_delete_usage(ent);
-+
-+ kfree(ent->name);
-+ kfree(ent);
-+}
-+
-+/*
-+ * Used by readdir(). We must validate "ptr", so we can't simply make it
-+ * a pointer. Values below 0xffff are reserved; calling with any value
-+ * <= 0x10000 will return the first entry found.
-+ */
-+struct autofs_dir_ent *autofs_hash_enum(const struct autofs_dirhash *dh, off_t *ptr)
-+{
-+ int bucket, ecount, i;
-+ struct autofs_dir_ent *ent;
-+
-+ bucket = (*ptr >> 16) - 1;
-+ ecount = *ptr & 0xffff;
-+
-+ if ( bucket < 0 ) {
-+ bucket = ecount = 0;
-+ }
-+
-+ DPRINTK(("autofs_hash_enum: bucket %d, entry %d\n", bucket, ecount));
-+
-+ ent = NULL;
-+
-+ while ( bucket < AUTOFS_HASH_SIZE ) {
-+ ent = dh->h[bucket];
-+ for ( i = ecount ; ent && i ; i-- )
-+ ent = ent->next;
-+
-+ if (ent) {
-+ ecount++; /* Point to *next* entry */
-+ break;
-+ }
-+
-+ bucket++; ecount = 0;
-+ }
-+
-+#ifdef DEBUG
-+ if ( !ent )
-+ printk("autofs_hash_enum: nothing found\n");
-+ else {
-+ printk("autofs_hash_enum: found hash %08x, name", ent->hash);
-+ autofs_say(ent->name,ent->len);
-+ }
-+#endif
-+
-+ *ptr = ((bucket+1) << 16) + ecount;
-+ return ent;
-+}
-+
-+/* Delete everything. This is used on filesystem destruction, so we
-+ make no attempt to keep the pointers valid */
-+void autofs_hash_nuke(struct autofs_dirhash *dh)
-+{
-+ int i;
-+ struct autofs_dir_ent *ent, *nent;
-+
-+ for ( i = 0 ; i < AUTOFS_HASH_SIZE ; i++ ) {
-+ for ( ent = dh->h[i] ; ent ; ent = nent ) {
-+ nent = ent->next;
-+ kfree(ent->name);
-+ kfree(ent);
-+ }
-+ }
-+}
-diff -urN 2.0.30/linux/fs/autofs/init.c linux/fs/autofs/init.c
---- 2.0.30/linux/fs/autofs/init.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/init.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,58 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/init.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include <linux/module.h>
-+#include "autofs_i.h"
-+
-+#if LINUX_VERSION_CODE < kver(2,1,36)
-+#define __initfunc(X) X
-+#else
-+#include <linux/init.h>
-+#endif
-+
-+static struct file_system_type autofs_fs_type = {
-+ autofs_read_super, "autofs", 0, NULL
-+};
-+
-+#ifdef MODULE
-+int init_module(void)
-+{
-+ int status;
-+
-+ if ((status = register_filesystem(&autofs_fs_type)) == 0)
-+ register_symtab(0);
-+ return status;
-+}
-+
-+void cleanup_module(void)
-+{
-+ unregister_filesystem(&autofs_fs_type);
-+}
-+
-+#else /* MODULE */
-+
-+__initfunc(int init_autofs_fs(void))
-+{
-+ return register_filesystem(&autofs_fs_type);
-+}
-+
-+#endif /* !MODULE */
-+
-+#ifdef DEBUG
-+void autofs_say(const char *name, int len)
-+{
-+ printk("(%d: ", len);
-+ while ( len-- )
-+ printk("%c", *name++);
-+ printk(")\n");
-+}
-+#endif
-diff -urN 2.0.30/linux/fs/autofs/inode.c linux/fs/autofs/inode.c
---- 2.0.30/linux/fs/autofs/inode.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/inode.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,277 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/inode.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include <linux/kernel.h>
-+#include <linux/malloc.h>
-+#include <linux/file.h>
-+#include <linux/locks.h>
-+#include <asm/bitops.h>
-+#include "autofs_i.h"
-+#define __NO_VERSION__
-+#include <linux/module.h>
-+
-+static void autofs_put_inode(struct inode *inode)
-+{
-+ if (inode->i_nlink)
-+ return;
-+ inode->i_size = 0;
-+}
-+
-+static void autofs_put_super(struct super_block *sb)
-+{
-+ struct autofs_sb_info *sbi =
-+ (struct autofs_sb_info *) sb->u.generic_sbp;
-+ unsigned int n;
-+
-+ if ( !sbi->catatonic )
-+ autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
-+
-+ lock_super(sb);
-+ autofs_hash_nuke(&sbi->dirhash);
-+ for ( n = 0 ; n < AUTOFS_MAX_SYMLINKS ; n++ ) {
-+ if ( test_bit(n, sbi->symlink_bitmap) )
-+ kfree(sbi->symlink[n].data);
-+ }
-+
-+ sb->s_dev = 0;
-+ kfree(sb->u.generic_sbp);
-+ unlock_super(sb);
-+
-+ DPRINTK(("autofs: shutting down\n"));
-+
-+#ifdef MODULE
-+ MOD_DEC_USE_COUNT;
-+#endif
-+}
-+
-+static void autofs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
-+static void autofs_read_inode(struct inode *inode);
-+static void autofs_write_inode(struct inode *inode);
-+
-+static struct super_operations autofs_sops = {
-+ autofs_read_inode,
-+ NULL,
-+ autofs_write_inode,
-+ autofs_put_inode,
-+ autofs_put_super,
-+ NULL,
-+ autofs_statfs,
-+ NULL
-+};
-+
-+static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto)
-+{
-+ char *this_char, *value;
-+
-+ *uid = current->uid;
-+ *gid = current->gid;
-+ *pgrp = current->pgrp;
-+
-+ *minproto = *maxproto = AUTOFS_PROTO_VERSION;
-+
-+ *pipefd = -1;
-+
-+ if ( !options ) return 1;
-+ for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
-+ if ((value = strchr(this_char,'=')) != NULL)
-+ *value++ = 0;
-+ if (!strcmp(this_char,"fd")) {
-+ if (!value || !*value)
-+ return 1;
-+ *pipefd = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else if (!strcmp(this_char,"uid")) {
-+ if (!value || !*value)
-+ return 1;
-+ *uid = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else if (!strcmp(this_char,"gid")) {
-+ if (!value || !*value)
-+ return 1;
-+ *gid = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else if (!strcmp(this_char,"pgrp")) {
-+ if (!value || !*value)
-+ return 1;
-+ *pgrp = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else if (!strcmp(this_char,"minproto")) {
-+ if (!value || !*value)
-+ return 1;
-+ *minproto = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else if (!strcmp(this_char,"maxproto")) {
-+ if (!value || !*value)
-+ return 1;
-+ *maxproto = simple_strtoul(value,&value,0);
-+ if (*value)
-+ return 1;
-+ }
-+ else break;
-+ }
-+ return (*pipefd < 0);
-+}
-+
-+struct super_block *autofs_read_super(struct super_block *s, void *data,
-+ int silent)
-+{
-+ int pipefd;
-+ struct autofs_sb_info *sbi;
-+ int minproto, maxproto;
-+
-+ MOD_INC_USE_COUNT;
-+
-+ lock_super(s);
-+ sbi = (struct autofs_sb_info *) kmalloc(sizeof(struct autofs_sb_info), GFP_KERNEL);
-+ if ( !sbi ) {
-+ s->s_dev = 0;
-+ MOD_DEC_USE_COUNT;
-+ return NULL;
-+ }
-+ DPRINTK(("autofs: starting up, sbi = %p\n",sbi));
-+
-+ s->u.generic_sbp = sbi;
-+ sbi->magic = AUTOFS_SBI_MAGIC;
-+ sbi->catatonic = 0;
-+ sbi->exp_timeout = 0;
-+ sbi->oz_pgrp = current->pgrp;
-+ autofs_initialize_hash(&sbi->dirhash);
-+ sbi->queues = NULL;
-+ memset(sbi->symlink_bitmap, 0, sizeof(u32)*AUTOFS_SYMLINK_BITMAP_LEN);
-+ sbi->next_dir_ino = AUTOFS_FIRST_DIR_INO;
-+ s->s_blocksize = 1024;
-+ s->s_blocksize_bits = 10;
-+ s->s_magic = AUTOFS_SUPER_MAGIC;
-+ s->s_op = &autofs_sops;
-+ unlock_super(s);
-+ if (!(s->s_mounted = iget(s, AUTOFS_ROOT_INO))) {
-+ s->s_dev = 0;
-+ kfree(sbi);
-+ printk("autofs: get root inode failed\n");
-+ MOD_DEC_USE_COUNT;
-+ return NULL;
-+ }
-+
-+ if ( parse_options(data,&pipefd,&s->s_mounted->i_uid,&s->s_mounted->i_gid,&sbi->oz_pgrp,&minproto,&maxproto) ) {
-+ iput(s->s_mounted);
-+ s->s_dev = 0;
-+ kfree(sbi);
-+ printk("autofs: called with bogus options\n");
-+ MOD_DEC_USE_COUNT;
-+ return NULL;
-+ }
-+
-+ if ( minproto > AUTOFS_PROTO_VERSION || maxproto < AUTOFS_PROTO_VERSION ) {
-+ iput(s->s_mounted);
-+ s->s_dev = 0;
-+ kfree(sbi);
-+ printk("autofs: kernel does not match daemon version\n");
-+ MOD_DEC_USE_COUNT;
-+ return NULL;
-+ }
-+
-+ DPRINTK(("autofs: pipe fd = %d, pgrp = %u\n", pipefd, sbi->oz_pgrp));
-+ sbi->pipe = fget(pipefd);
-+ if ( !sbi->pipe || !sbi->pipe->f_op || !sbi->pipe->f_op->write ) {
-+ if ( sbi->pipe ) {
-+ fput(sbi->pipe, sbi->pipe->f_inode);
-+ printk("autofs: pipe file descriptor does not contain proper ops\n");
-+ } else {
-+ printk("autofs: could not open pipe file descriptor\n");
-+ }
-+ iput(s->s_mounted);
-+ s->s_dev = 0;
-+ kfree(sbi);
-+ MOD_DEC_USE_COUNT;
-+ return NULL;
-+ }
-+ return s;
-+}
-+
-+static void autofs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
-+{
-+ struct statfs tmp;
-+
-+ tmp.f_type = AUTOFS_SUPER_MAGIC;
-+ tmp.f_bsize = 1024;
-+ tmp.f_blocks = 0;
-+ tmp.f_bfree = 0;
-+ tmp.f_bavail = 0;
-+ tmp.f_files = 0;
-+ tmp.f_ffree = 0;
-+ tmp.f_namelen = NAME_MAX;
-+ copy_to_user(buf, &tmp, bufsiz);
-+}
-+
-+static void autofs_read_inode(struct inode *inode)
-+{
-+ ino_t ino = inode->i_ino;
-+ unsigned int n;
-+ struct autofs_sb_info *sbi =
-+ (struct autofs_sb_info *) inode->i_sb->u.generic_sbp;
-+
-+ inode->i_op = NULL;
-+ inode->i_mode = 0;
-+ inode->i_nlink = 2;
-+ inode->i_size = 0;
-+ inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-+ inode->i_blocks = 0;
-+ inode->i_blksize = 1024;
-+
-+ if ( ino == AUTOFS_ROOT_INO ) {
-+ inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
-+ inode->i_op = &autofs_root_inode_operations;
-+ inode->i_uid = inode->i_gid = 0; /* Changed in read_super */
-+ return;
-+ }
-+
-+ inode->i_uid = inode->i_sb->s_mounted->i_uid;
-+ inode->i_gid = inode->i_sb->s_mounted->i_gid;
-+
-+ if ( ino >= AUTOFS_FIRST_SYMLINK && ino < AUTOFS_FIRST_DIR_INO ) {
-+ /* Symlink inode - should be in symlink list */
-+ struct autofs_symlink *sl;
-+
-+ n = ino - AUTOFS_FIRST_SYMLINK;
-+ if ( n >= AUTOFS_MAX_SYMLINKS || !test_bit(n,sbi->symlink_bitmap)) {
-+ printk("autofs: Looking for bad symlink inode 0x%08x\n", (unsigned int) ino);
-+ return;
-+ }
-+
-+ inode->i_op = &autofs_symlink_inode_operations;
-+ sl = &sbi->symlink[n];
-+ inode->u.generic_ip = sl;
-+ inode->i_mode = S_IFLNK | S_IRWXUGO;
-+ inode->i_mtime = inode->i_ctime = sl->mtime;
-+ inode->i_size = sl->len;
-+ inode->i_nlink = 1;
-+ } else {
-+ /* All non-root directory inodes look the same */
-+ inode->i_op = &autofs_dir_inode_operations;
-+ inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
-+ }
-+}
-+
-+static void autofs_write_inode(struct inode *inode)
-+{
-+ inode->i_dirt = 0;
-+}
-diff -urN 2.0.30/linux/fs/autofs/root.c linux/fs/autofs/root.c
---- 2.0.30/linux/fs/autofs/root.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/root.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,445 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/root.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include <linux/errno.h>
-+#include <linux/stat.h>
-+#include <linux/param.h>
-+#include "autofs_i.h"
-+
-+static int autofs_root_readdir(struct inode *,struct file *,void *,filldir_t);
-+static int autofs_root_lookup(struct inode *,const char *,int,struct inode **);
-+static int autofs_root_symlink(struct inode *,const char *,int,const char *);
-+static int autofs_root_unlink(struct inode *,const char *,int);
-+static int autofs_root_rmdir(struct inode *,const char *,int);
-+static int autofs_root_mkdir(struct inode *,const char *,int,int);
-+static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
-+
-+static struct file_operations autofs_root_operations = {
-+ NULL, /* lseek */
-+ NULL, /* read */
-+ NULL, /* write */
-+ autofs_root_readdir, /* readdir */
-+ NULL, /* select */
-+ autofs_root_ioctl, /* ioctl */
-+ NULL, /* mmap */
-+ NULL, /* open */
-+ NULL, /* release */
-+ NULL /* fsync */
-+};
-+
-+struct inode_operations autofs_root_inode_operations = {
-+ &autofs_root_operations, /* file operations */
-+ NULL, /* create */
-+ autofs_root_lookup, /* lookup */
-+ NULL, /* link */
-+ autofs_root_unlink, /* unlink */
-+ autofs_root_symlink, /* symlink */
-+ autofs_root_mkdir, /* mkdir */
-+ autofs_root_rmdir, /* rmdir */
-+ NULL, /* mknod */
-+ NULL, /* rename */
-+ NULL, /* readlink */
-+ NULL, /* follow_link */
-+ NULL, /* readpage */
-+ NULL, /* writepage */
-+ NULL, /* bmap */
-+ NULL, /* truncate */
-+ NULL /* permission */
-+};
-+
-+static int autofs_root_readdir(struct inode *inode, struct file *filp,
-+ void *dirent, filldir_t filldir)
-+{
-+ struct autofs_dir_ent *ent;
-+ struct autofs_dirhash *dirhash;
-+ off_t onr, nr;
-+
-+ if (!inode || !S_ISDIR(inode->i_mode))
-+ return -ENOTDIR;
-+
-+ dirhash = &((struct autofs_sb_info *)inode->i_sb->u.generic_sbp)->dirhash;
-+ nr = filp->f_pos;
-+
-+ switch(nr)
-+ {
-+ case 0:
-+ if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
-+ return 0;
-+ filp->f_pos = ++nr;
-+ /* fall through */
-+ case 1:
-+ if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
-+ return 0;
-+ filp->f_pos = ++nr;
-+ /* fall through */
-+ default:
-+ while ( onr = nr, ent = autofs_hash_enum(dirhash,&nr) ) {
-+ if (filldir(dirent,ent->name,ent->len,onr,ent->ino) < 0)
-+ return 0;
-+ filp->f_pos = nr;
-+ }
-+ break;
-+ }
-+
-+ return 0;
-+}
-+
-+static int autofs_root_lookup(struct inode *dir, const char *name, int len,
-+ struct inode **result)
-+{
-+ struct autofs_sb_info *sbi;
-+ struct autofs_dir_ent *ent;
-+ struct inode *res;
-+ autofs_hash_t hash;
-+ int status, oz_mode;
-+
-+ DPRINTK(("autofs_root_lookup: name = "));
-+ autofs_say(name,len);
-+
-+ *result = NULL;
-+ if (!dir)
-+ return -ENOENT;
-+ if (!S_ISDIR(dir->i_mode)) {
-+ iput(dir);
-+ return -ENOTDIR;
-+ }
-+
-+ /* Handle special cases: . and ..; since this is a root directory,
-+ they both point to the inode itself */
-+ *result = dir;
-+ if (!len)
-+ return 0;
-+ if (name[0] == '.') {
-+ if (len == 1)
-+ return 0;
-+ if (name[1] == '.' && len == 2)
-+ return 0;
-+ }
-+
-+ *result = res = NULL;
-+ sbi = (struct autofs_sb_info *) dir->i_sb->u.generic_sbp;
-+
-+ hash = autofs_hash(name,len);
-+
-+ oz_mode = autofs_oz_mode(sbi);
-+ DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n", current->pid, current->pgrp, sbi->catatonic, oz_mode));
-+
-+ do {
-+ while ( !(ent = autofs_hash_lookup(&sbi->dirhash,hash,name,len)) ) {
-+ DPRINTK(("lookup failed, pid = %u, pgrp = %u\n", current->pid, current->pgrp));
-+
-+ if ( oz_mode ) {
-+ iput(dir);
-+ return -ENOENT;
-+ } else {
-+ status = autofs_wait(sbi,hash,name,len);
-+ DPRINTK(("autofs_wait returned %d\n", status));
-+ if ( status ) {
-+ iput(dir);
-+ return status;
-+ }
-+ }
-+ }
-+
-+ DPRINTK(("lookup successful, inode = %08x\n", (unsigned int)ent->ino));
-+
-+ if (!(res = iget(dir->i_sb,ent->ino))) {
-+ printk("autofs: iget returned null!\n");
-+ iput(dir);
-+ return -EACCES;
-+ }
-+
-+ if ( !oz_mode && S_ISDIR(res->i_mode) && res->i_sb == dir->i_sb ) {
-+ /* Not a mount point yet, call 1-800-DAEMON */
-+ DPRINTK(("autofs: waiting on non-mountpoint dir, inode = %lu, pid = %u, pgrp = %u\n", res->i_ino, current->pid, current->pgrp));
-+ iput(res);
-+ res = NULL;
-+ status = autofs_wait(sbi,hash,name,len);
-+ if ( status ) {
-+ iput(dir);
-+ return status;
-+ }
-+ }
-+ } while(!res);
-+ autofs_update_usage(&sbi->dirhash,ent);
-+
-+ *result = res;
-+ iput(dir);
-+ return 0;
-+}
-+
-+static int autofs_root_symlink(struct inode *dir, const char *name, int len, const char *symname)
-+{
-+ struct autofs_sb_info *sbi = (struct autofs_sb_info *) dir->i_sb->u.generic_sbp;
-+ struct autofs_dirhash *dh = &sbi->dirhash;
-+ autofs_hash_t hash = autofs_hash(name,len);
-+ struct autofs_dir_ent *ent;
-+ unsigned int n;
-+ int slsize;
-+ struct autofs_symlink *sl;
-+
-+ DPRINTK(("autofs_root_symlink: %s <- ", symname));
-+ autofs_say(name,len);
-+
-+ if ( !autofs_oz_mode(sbi) ) {
-+ iput(dir);
-+ return -EPERM;
-+ }
-+ if ( autofs_hash_lookup(dh,hash,name,len) ) {
-+ iput(dir);
-+ return -EEXIST;
-+ }
-+ n = find_first_zero_bit(sbi->symlink_bitmap,AUTOFS_MAX_SYMLINKS);
-+ if ( n >= AUTOFS_MAX_SYMLINKS ) {
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ set_bit(n,sbi->symlink_bitmap);
-+ sl = &sbi->symlink[n];
-+ sl->len = strlen(symname);
-+ sl->data = kmalloc(slsize = sl->len+1, GFP_KERNEL);
-+ if ( !sl->data ) {
-+ clear_bit(n,sbi->symlink_bitmap);
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ ent = kmalloc(sizeof(struct autofs_dir_ent), GFP_KERNEL);
-+ if ( !ent ) {
-+ kfree(sl->data);
-+ clear_bit(n,sbi->symlink_bitmap);
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ ent->name = kmalloc(len, GFP_KERNEL);
-+ if ( !ent->name ) {
-+ kfree(sl->data);
-+ kfree(ent);
-+ clear_bit(n,sbi->symlink_bitmap);
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ memcpy(sl->data,symname,slsize);
-+ sl->mtime = CURRENT_TIME;
-+
-+ ent->ino = AUTOFS_FIRST_SYMLINK + n;
-+ ent->hash = hash;
-+ memcpy(ent->name,name,ent->len = len);
-+
-+ autofs_hash_insert(dh,ent);
-+ iput(dir);
-+
-+ return 0;
-+}
-+
-+static int autofs_root_unlink(struct inode *dir, const char *name, int len)
-+{
-+ struct autofs_sb_info *sbi = (struct autofs_sb_info *) dir->i_sb->u.generic_sbp;
-+ struct autofs_dirhash *dh = &sbi->dirhash;
-+ autofs_hash_t hash = autofs_hash(name,len);
-+ struct autofs_dir_ent *ent;
-+ unsigned int n;
-+
-+ iput(dir); /* Nothing below can sleep */
-+
-+ if ( !autofs_oz_mode(sbi) )
-+ return -EPERM;
-+
-+ ent = autofs_hash_lookup(dh,hash,name,len);
-+ if ( !ent )
-+ return -ENOENT;
-+
-+ n = ent->ino - AUTOFS_FIRST_SYMLINK;
-+ if ( n >= AUTOFS_MAX_SYMLINKS || !test_bit(n,sbi->symlink_bitmap) )
-+ return -EINVAL; /* Not a symlink inode, can't unlink */
-+
-+ autofs_hash_delete(ent);
-+ clear_bit(n,sbi->symlink_bitmap);
-+ kfree(sbi->symlink[n].data);
-+
-+ return 0;
-+}
-+
-+static int autofs_root_rmdir(struct inode *dir, const char *name, int len)
-+{
-+ struct autofs_sb_info *sbi = (struct autofs_sb_info *) dir->i_sb->u.generic_sbp;
-+ struct autofs_dirhash *dh = &sbi->dirhash;
-+ autofs_hash_t hash = autofs_hash(name,len);
-+ struct autofs_dir_ent *ent;
-+
-+ if ( !autofs_oz_mode(sbi) ) {
-+ iput(dir);
-+ return -EPERM;
-+ }
-+ ent = autofs_hash_lookup(dh,hash,name,len);
-+ if ( !ent ) {
-+ iput(dir);
-+ return -ENOENT;
-+ }
-+ if ( (unsigned int)ent->ino < AUTOFS_FIRST_DIR_INO ) {
-+ iput(dir);
-+ return -ENOTDIR; /* Not a directory */
-+ }
-+ autofs_hash_delete(ent);
-+ dir->i_nlink--;
-+ iput(dir);
-+
-+ return 0;
-+}
-+
-+static int autofs_root_mkdir(struct inode *dir, const char *name, int len, int mode)
-+{
-+ struct autofs_sb_info *sbi = (struct autofs_sb_info *) dir->i_sb->u.generic_sbp;
-+ struct autofs_dirhash *dh = &sbi->dirhash;
-+ autofs_hash_t hash = autofs_hash(name,len);
-+ struct autofs_dir_ent *ent;
-+
-+ if ( !autofs_oz_mode(sbi) ) {
-+ iput(dir);
-+ return -EPERM;
-+ }
-+ ent = autofs_hash_lookup(dh,hash,name,len);
-+ if ( ent ) {
-+ iput(dir);
-+ return -EEXIST;
-+ }
-+ if ( sbi->next_dir_ino < AUTOFS_FIRST_DIR_INO ) {
-+ printk("autofs: Out of inode numbers -- what the heck did you do??\n");
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ ent = kmalloc(sizeof(struct autofs_dir_ent), GFP_KERNEL);
-+ if ( !ent ) {
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ ent->name = kmalloc(len, GFP_KERNEL);
-+ if ( !ent->name ) {
-+ kfree(ent);
-+ iput(dir);
-+ return -ENOSPC;
-+ }
-+ ent->hash = hash;
-+ memcpy(ent->name, name, ent->len = len);
-+ ent->ino = sbi->next_dir_ino++;
-+ autofs_hash_insert(dh,ent);
-+ dir->i_nlink++;
-+ iput(dir);
-+
-+ return 0;
-+}
-+
-+/* Get/set timeout ioctl() operation */
-+static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi,
-+ unsigned long *p)
-+{
-+ int rv;
-+ unsigned long ntimeout;
-+
-+#if LINUX_VERSION_CODE < kver(2,1,0)
-+ if ( (rv = verify_area(VERIFY_WRITE, p, sizeof(unsigned long))) )
-+ return rv;
-+ ntimeout = get_user(p);
-+ put_user(sbi->exp_timeout/HZ, p);
-+#else
-+ if ( (rv = get_user(ntimeout, p)) ||
-+ (rv = put_user(sbi->exp_timeout/HZ, p)) )
-+ return rv;
-+#endif
-+
-+ if ( ntimeout > ULONG_MAX/HZ )
-+ sbi->exp_timeout = 0;
-+ else
-+ sbi->exp_timeout = ntimeout * HZ;
-+
-+ return 0;
-+}
-+
-+/* Return protocol version */
-+static inline int autofs_get_protover(int *p)
-+{
-+#if LINUX_VERSION_CODE < kver(2,1,0)
-+ int rv;
-+ if ( (rv = verify_area(VERIFY_WRITE, p, sizeof(int))) )
-+ return rv;
-+ put_user(AUTOFS_PROTO_VERSION, p);
-+ return 0;
-+#else
-+ return put_user(AUTOFS_PROTO_VERSION, p);
-+#endif
-+}
-+
-+/* Perform an expiry operation */
-+static inline int autofs_expire_run(struct autofs_sb_info *sbi,
-+ struct autofs_packet_expire *pkt_p)
-+{
-+ struct autofs_dir_ent *ent;
-+ struct autofs_packet_expire pkt;
-+ struct autofs_dirhash *dh = &(sbi->dirhash);
-+
-+ memset(&pkt,0,sizeof pkt);
-+
-+ pkt.hdr.proto_version = AUTOFS_PROTO_VERSION;
-+ pkt.hdr.type = autofs_ptype_expire;
-+
-+ if ( !sbi->exp_timeout ||
-+ !(ent = autofs_expire(dh,sbi->exp_timeout)) )
-+ return -EAGAIN;
-+
-+ pkt.len = ent->len;
-+ memcpy(pkt.name, ent->name, pkt.len);
-+ pkt.name[pkt.len] = '\0';
-+
-+ if ( copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)) )
-+ return -EFAULT;
-+
-+ autofs_update_usage(dh,ent);
-+
-+ return 0;
-+}
-+
-+/*
-+ * ioctl()'s on the root directory is the chief method for the daemon to
-+ * generate kernel reactions
-+ */
-+static int autofs_root_ioctl(struct inode *inode, struct file *filp,
-+ unsigned int cmd, unsigned long arg)
-+{
-+ struct autofs_sb_info *sbi =
-+ (struct autofs_sb_info *)inode->i_sb->u.generic_sbp;
-+
-+ DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,current->pgrp));
-+
-+ if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
-+ _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
-+ return -ENOTTY;
-+
-+ if ( !autofs_oz_mode(sbi) && !fsuser() )
-+ return -EPERM;
-+
-+ switch(cmd) {
-+ case AUTOFS_IOC_READY: /* Wait queue: go ahead and retry */
-+ return autofs_wait_release(sbi,arg,0);
-+ case AUTOFS_IOC_FAIL: /* Wait queue: fail with ENOENT */
-+ return autofs_wait_release(sbi,arg,-ENOENT);
-+ case AUTOFS_IOC_CATATONIC: /* Enter catatonic mode (daemon shutdown) */
-+ autofs_catatonic_mode(sbi);
-+ return 0;
-+ case AUTOFS_IOC_PROTOVER: /* Get protocol version */
-+ return autofs_get_protover((int *)arg);
-+ case AUTOFS_IOC_SETTIMEOUT:
-+ return autofs_get_set_timeout(sbi,(unsigned long *)arg);
-+ case AUTOFS_IOC_EXPIRE:
-+ return autofs_expire_run(sbi,(struct autofs_packet_expire *)arg);
-+ default:
-+ return -ENOSYS;
-+ }
-+}
-diff -urN 2.0.30/linux/fs/autofs/symlink.c linux/fs/autofs/symlink.c
---- 2.0.30/linux/fs/autofs/symlink.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/symlink.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,85 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/symlink.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include <linux/string.h>
-+#include <linux/sched.h>
-+#include "autofs_i.h"
-+
-+static int autofs_follow_link(struct inode *dir, struct inode *inode,
-+ int flag, int mode, struct inode **res_inode)
-+{
-+ int error;
-+ char *link;
-+
-+ *res_inode = NULL;
-+ if (!dir) {
-+ dir = current->fs->root;
-+ dir->i_count++;
-+ }
-+ if (!inode) {
-+ iput(dir);
-+ return -ENOENT;
-+ }
-+ if (!S_ISLNK(inode->i_mode)) {
-+ iput(dir);
-+ *res_inode = inode;
-+ return 0;
-+ }
-+ if (current->link_count > 5) {
-+ iput(dir);
-+ iput(inode);
-+ return -ELOOP;
-+ }
-+ link = ((struct autofs_symlink *)inode->u.generic_ip)->data;
-+ current->link_count++;
-+ error = open_namei(link,flag,mode,res_inode,dir);
-+ current->link_count--;
-+ iput(inode);
-+ return error;
-+}
-+
-+static int autofs_readlink(struct inode *inode, char *buffer, int buflen)
-+{
-+ struct autofs_symlink *sl;
-+ int len;
-+
-+ if (!S_ISLNK(inode->i_mode)) {
-+ iput(inode);
-+ return -EINVAL;
-+ }
-+ sl = (struct autofs_symlink *)inode->u.generic_ip;
-+ len = sl->len;
-+ if (len > buflen) len = buflen;
-+ copy_to_user(buffer,sl->data,len);
-+ iput(inode);
-+ return len;
-+}
-+
-+struct inode_operations autofs_symlink_inode_operations = {
-+ NULL, /* file operations */
-+ NULL, /* create */
-+ NULL, /* lookup */
-+ NULL, /* link */
-+ NULL, /* unlink */
-+ NULL, /* symlink */
-+ NULL, /* mkdir */
-+ NULL, /* rmdir */
-+ NULL, /* mknod */
-+ NULL, /* rename */
-+ autofs_readlink, /* readlink */
-+ autofs_follow_link, /* follow_link */
-+ NULL, /* readpage */
-+ NULL, /* writepage */
-+ NULL, /* bmap */
-+ NULL, /* truncate */
-+ NULL /* permission */
-+};
-diff -urN 2.0.30/linux/fs/autofs/waitq.c linux/fs/autofs/waitq.c
---- 2.0.30/linux/fs/autofs/waitq.c Wed Dec 31 16:00:00 1969
-+++ linux/fs/autofs/waitq.c Wed May 28 21:38:35 1997
-@@ -0,0 +1,171 @@
-+/* -*- linux-c -*- --------------------------------------------------------- *
-+ *
-+ * linux/fs/autofs/waitq.c
-+ *
-+ * Copyright 1997 Transmeta Corporation -- All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ------------------------------------------------------------------------- */
-+
-+#include <linux/malloc.h>
-+#include <linux/sched.h>
-+#include <linux/signal.h>
-+#include <linux/file.h>
-+#include "autofs_i.h"
-+
-+/* We make this a static variable rather than a part of the superblock; it
-+ is better if we don't reassign numbers easily even across filesystems */
-+static int autofs_next_wait_queue = 1;
-+
-+void autofs_catatonic_mode(struct autofs_sb_info *sbi)
-+{
-+ struct autofs_wait_queue *wq, *nwq;
-+
-+ DPRINTK(("autofs: entering catatonic mode\n"));
-+
-+ sbi->catatonic = 1;
-+ wq = sbi->queues;
-+ sbi->queues = NULL; /* Erase all wait queues */
-+ while ( wq ) {
-+ nwq = wq->next;
-+ wq->status = -ENOENT; /* Magic is gone - report failure */
-+ kfree(wq->name);
-+ wq->name = NULL;
-+ wake_up(&wq->queue);
-+ wq = nwq;
-+ }
-+ fput(sbi->pipe, sbi->pipe->f_inode); /* Close the pipe */
-+}
-+
-+static int autofs_write(struct file *file, const void *addr, int bytes)
-+{
-+ unsigned short fs;
-+ unsigned long old_signal;
-+ const char *data = (const char *)addr;
-+ int written = 0;
-+
-+ /** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
-+
-+ /* Save pointer to user space and point back to kernel space */
-+ fs = get_fs();
-+ set_fs(KERNEL_DS);
-+
-+ old_signal = current->signal;
-+
-+ while ( bytes && (written = file->f_op->write(file->f_inode,file,data,bytes)) > 0 ) {
-+ data += written;
-+ bytes -= written;
-+ }
-+
-+ if ( written == -EPIPE && !(old_signal & (1 << (SIGPIPE-1))) ) {
-+ /* Keep the currently executing process from receiving a
-+ SIGPIPE unless it was already supposed to get one */
-+ current->signal &= ~(1 << (SIGPIPE-1));
-+ }
-+ set_fs(fs);
-+
-+ return (bytes > 0);
-+}
-+
-+static void autofs_notify_daemon(struct autofs_sb_info *sbi, struct autofs_wait_queue *wq)
-+{
-+ struct autofs_packet_missing pkt;
-+
-+ DPRINTK(("autofs_wait: wait id = 0x%08lx, name = ", wq->wait_queue_token));
-+ autofs_say(wq->name,wq->len);
-+
-+ memset(&pkt,0,sizeof pkt); /* For security reasons */
-+
-+ pkt.hdr.proto_version = AUTOFS_PROTO_VERSION;
-+ pkt.hdr.type = autofs_ptype_missing;
-+ pkt.wait_queue_token = wq->wait_queue_token;
-+ pkt.len = wq->len;
-+ memcpy(pkt.name, wq->name, pkt.len);
-+ pkt.name[pkt.len] = '\0';
-+
-+ if ( autofs_write(sbi->pipe,&pkt,sizeof(struct autofs_packet_missing)) )
-+ autofs_catatonic_mode(sbi);
-+}
-+
-+int autofs_wait(struct autofs_sb_info *sbi, autofs_hash_t hash, const char *name, int len)
-+{
-+ struct autofs_wait_queue *wq;
-+ int status;
-+
-+ for ( wq = sbi->queues ; wq ; wq = wq->next ) {
-+ if ( wq->hash == hash &&
-+ wq->len == len &&
-+ wq->name && !memcmp(wq->name,name,len) )
-+ break;
-+ }
-+
-+ if ( !wq ) {
-+ /* Create a new wait queue */
-+ wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
-+ if ( !wq )
-+ return -ENOMEM;
-+
-+ wq->name = kmalloc(len,GFP_KERNEL);
-+ if ( !wq->name ) {
-+ kfree(wq);
-+ return -ENOMEM;
-+ }
-+ wq->wait_queue_token = autofs_next_wait_queue++;
-+ init_waitqueue(&wq->queue);
-+ wq->hash = hash;
-+ wq->len = len;
-+ wq->status = -EINTR; /* Status return if interrupted */
-+ memcpy(wq->name, name, len);
-+ wq->next = sbi->queues;
-+ sbi->queues = wq;
-+
-+ /* autofs_notify_daemon() may block */
-+ wq->wait_ctr = 2;
-+ autofs_notify_daemon(sbi,wq);
-+ } else
-+ wq->wait_ctr++;
-+
-+ if ( wq->name ) {
-+ /* wq->name is NULL if and only if the lock is released */
-+ interruptible_sleep_on(&wq->queue);
-+ } else {
-+ DPRINTK(("autofs_wait: skipped sleeping\n"));
-+ }
-+
-+ status = wq->status;
-+
-+ if ( ! --wq->wait_ctr ) /* Are we the last process to need status? */
-+ kfree(wq);
-+
-+ return status;
-+}
-+
-+
-+int autofs_wait_release(struct autofs_sb_info *sbi, unsigned long wait_queue_token, int status)
-+{
-+ struct autofs_wait_queue *wq, **wql;
-+
-+ for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) {
-+ if ( wq->wait_queue_token == wait_queue_token )
-+ break;
-+ }
-+ if ( !wq )
-+ return -EINVAL;
-+
-+ *wql = wq->next; /* Unlink from chain */
-+ kfree(wq->name);
-+ wq->name = NULL; /* Do not wait on this queue */
-+
-+ wq->status = status;
-+
-+ if ( ! --wq->wait_ctr ) /* Is anyone still waiting for this guy? */
-+ kfree(wq);
-+ else
-+ wake_up(&wq->queue);
-+
-+ return 0;
-+}
-+
-diff -urN 2.0.30/linux/fs/filesystems.c linux/fs/filesystems.c
---- 2.0.30/linux/fs/filesystems.c Thu Apr 25 02:32:39 1996
-+++ linux/fs/filesystems.c Thu May 1 12:35:18 1997
-@@ -24,6 +24,7 @@
- #include <linux/ncp_fs.h>
- #include <linux/affs_fs.h>
- #include <linux/ufs_fs.h>
-+#include <linux/auto_fs.h>
- #include <linux/major.h>
-
- extern void device_setup(void);
-@@ -110,6 +111,9 @@
- init_ufs_fs();
- #endif
-
-+#ifdef CONFIG_AUTOFS_FS
-+ init_autofs_fs();
-+#endif
- mount_root();
- return 0;
- }
-diff -urN 2.0.30/linux/include/linux/auto_fs.h linux/include/linux/auto_fs.h
---- 2.0.30/linux/include/linux/auto_fs.h Wed Dec 31 16:00:00 1969
-+++ linux/include/linux/auto_fs.h Wed May 28 21:38:59 1997
-@@ -0,0 +1,62 @@
-+/* -*- linux-c -*- ------------------------------------------------------- *
-+ *
-+ * linux/include/linux/auto_fs.h
-+ *
-+ * Copyright 1997 Transmeta Corporation - All Rights Reserved
-+ *
-+ * This file is part of the Linux kernel and is made available under
-+ * the terms of the GNU General Public License, version 2, or at your
-+ * option, any later version, incorporated herein by reference.
-+ *
-+ * ----------------------------------------------------------------------- */
-+
-+
-+#ifndef _LINUX_AUTO_FS_H
-+#define _LINUX_AUTO_FS_H
-+
-+#include <linux/version.h>
-+#include <linux/fs.h>
-+#include <linux/limits.h>
-+#include <linux/ioctl.h>
-+#include <asm/types.h>
-+
-+#define AUTOFS_PROTO_VERSION 3
-+
-+enum autofs_packet_type {
-+ autofs_ptype_missing, /* Missing entry (mount request) */
-+ autofs_ptype_expire, /* Expire entry (umount request) */
-+};
-+
-+struct autofs_packet_hdr {
-+ int proto_version; /* Protocol version */
-+ enum autofs_packet_type type; /* Type of packet */
-+};
-+
-+struct autofs_packet_missing {
-+ struct autofs_packet_hdr hdr;
-+ unsigned long wait_queue_token;
-+ int len;
-+ char name[NAME_MAX+1];
-+};
-+
-+struct autofs_packet_expire {
-+ struct autofs_packet_hdr hdr;
-+ int len;
-+ char name[NAME_MAX+1];
-+};
-+
-+#define AUTOFS_IOC_READY _IO(0x93,0x60)
-+#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
-+#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
-+#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
-+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
-+#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
-+
-+#ifdef __KERNEL__
-+
-+/* Init function */
-+int init_autofs_fs(void);
-+
-+#endif /* __KERNEL__ */
-+
-+#endif /* _LINUX_AUTO_FS_H */
-diff -urN 2.0.30/linux/kernel/ksyms.c linux/kernel/ksyms.c
---- 2.0.30/linux/kernel/ksyms.c Tue Mar 11 14:37:16 1997
-+++ linux/kernel/ksyms.c Thu May 1 12:35:18 1997
-@@ -46,6 +46,7 @@
- #include <linux/genhd.h>
- #include <linux/swap.h>
- #include <linux/ctype.h>
-+#include <linux/file.h>
-
- extern unsigned char aux_device_present, kbd_read_mask;
-
-@@ -170,6 +171,7 @@
- X(generic_file_read),
- X(generic_file_mmap),
- X(generic_readpage),
-+ X(__fput),
-
- /* device registration */
- X(register_chrdev),