Re: Patch for fs/autofs

H. Peter Anvin (hpa@transmeta.com)
4 Apr 1997 17:21:30 GMT


Followup to: <Pine.LNX.3.94.970404085157.12882B-100000@tirka.csl-gmbh.net>
By author: Uwe Ohse <uwe@tirka.gun.de>
In newsgroup: linux.dev.kernel
>
> Hello,
>
> autofs compiles only as module because it includes <linux/modversions.h>.
>

This is my current set of patches for autofs against 2.1.31:

diff -urP stock/linux-2.1.31/fs/autofs/dir.c linux-2.1.31-smp/fs/autofs/dir.c
--- stock/linux-2.1.31/fs/autofs/dir.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/dir.c Thu Apr 3 12:21:45 1997
@@ -10,7 +10,6 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/auto_fs.h>

static int autofs_dir_readdir(struct inode *inode, struct file *filp,
diff -urP stock/linux-2.1.31/fs/autofs/dirhash.c linux-2.1.31-smp/fs/autofs/dirhash.c
--- stock/linux-2.1.31/fs/autofs/dirhash.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/dirhash.c Thu Apr 3 12:21:39 1997
@@ -10,7 +10,6 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/string.h>
#include <linux/malloc.h>
#include <linux/auto_fs.h>
diff -urP stock/linux-2.1.31/fs/autofs/inode.c linux-2.1.31-smp/fs/autofs/inode.c
--- stock/linux-2.1.31/fs/autofs/inode.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/inode.c Thu Apr 3 12:23:23 1997
@@ -10,7 +10,6 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/kernel.h>
#include <linux/malloc.h>
#include <linux/file.h>
@@ -143,6 +142,7 @@
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));
@@ -208,7 +208,7 @@
struct statfs tmp;

tmp.f_type = AUTOFS_SUPER_MAGIC;
- tmp.f_bsize = PAGE_SIZE/sizeof(long);
+ tmp.f_bsize = 1024;
tmp.f_blocks = 0;
tmp.f_bfree = 0;
tmp.f_bavail = 0;
diff -urP stock/linux-2.1.31/fs/autofs/root.c linux-2.1.31-smp/fs/autofs/root.c
--- stock/linux-2.1.31/fs/autofs/root.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/root.c Thu Apr 3 12:21:15 1997
@@ -10,7 +10,6 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/malloc.h>
diff -urP stock/linux-2.1.31/fs/autofs/symlink.c linux-2.1.31-smp/fs/autofs/symlink.c
--- stock/linux-2.1.31/fs/autofs/symlink.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/symlink.c Thu Apr 3 12:21:10 1997
@@ -10,7 +10,6 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/auto_fs.h>
diff -urP stock/linux-2.1.31/fs/autofs/waitq.c linux-2.1.31-smp/fs/autofs/waitq.c
--- stock/linux-2.1.31/fs/autofs/waitq.c Thu Apr 3 09:36:33 1997
+++ linux-2.1.31-smp/fs/autofs/waitq.c Thu Apr 3 20:56:13 1997
@@ -10,8 +10,9 @@
*
* ------------------------------------------------------------------------- */

-#include <linux/modversions.h>
#include <linux/malloc.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
#include <linux/auto_fs.h>

/* We make this a static variable rather than a part of the superblock; it
@@ -40,6 +41,7 @@
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;

@@ -49,9 +51,17 @@
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);

diff -urP stock/linux-2.1.31/net/netsyms.c linux-2.1.31-smp/net/netsyms.c
--- stock/linux-2.1.31/net/netsyms.c Thu Apr 3 09:36:34 1997
+++ linux-2.1.31-smp/net/netsyms.c Thu Apr 3 12:11:27 1997
@@ -150,10 +150,6 @@
EXPORT_SYMBOL(scm_detach_fds);
#endif

-#ifdef CONFIG_SMB_FS_MODULE
-EXPORT_SYMBOL(scm_detach_fds);
-#endif
-
#ifdef CONFIG_INET
/* Internet layer registration */
EXPORT_SYMBOL(inet_add_protocol);

-- 
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Bahá'í -- ask me about it or see http://www.bahai.org/