Re: pre-2.3.1-1 fails compile (smbfs)

Ingo Molnar (mingo@chiara.csoma.elte.hu)
Wed, 12 May 1999 12:09:12 +0200 (CEST)


On Tue, 11 May 1999, Pete Clements wrote:

> FYI:
>
> gcc -D__KERNEL__ -I/hdb3/usr/src/linux-2.3.1/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -c -o inode.o inode.c
> inode.c:71: `MUTEX' undeclared here (not in a function)
> inode.c: In function `smb_read_super':
> inode.c:365: `MUTEX' undeclared (first use this function)
> inode.c:365: (Each undeclared identifier is reported only once
> inode.c:365: for each function it appears in.)
> make[3]: *** [inode.o] Error 1
> make[3]: Leaving directory `/hdb3/usr/src/linux-2.3.1/fs/smbfs'

does the attached patch fix this? It does compile now but i'm not using
smbfs myself. (but the patch should be ok, the only nontrivial thing with
the new waitqueue architecture is that initialization of the sb.wait
waitqueue is now a necessity, memset() doesnt do it implicitly anymore.)

-- mingo

--- linux/fs/smbfs/inode.c.orig3 Wed May 12 10:46:59 1999
+++ linux/fs/smbfs/inode.c Wed May 12 10:56:13 1999
@@ -68,7 +68,7 @@
}

static struct smb_fattr *read_fattr = NULL;
-static struct semaphore read_semaphore = MUTEX;
+static DECLARE_MUTEX(read_semaphore);

struct inode *
smb_iget(struct super_block *sb, struct smb_fattr *fattr)
@@ -362,8 +362,8 @@
sb->s_op = &smb_sops;

sb->u.smbfs_sb.sock_file = NULL;
- sb->u.smbfs_sb.sem = MUTEX;
- sb->u.smbfs_sb.wait = NULL;
+ init_MUTEX(&sb->u.smbfs_sb.sem);
+ init_waitqueue_head(&sb->u.smbfs_sb.wait);
sb->u.smbfs_sb.conn_pid = 0;
sb->u.smbfs_sb.state = CONN_INVALID; /* no connection yet */
sb->u.smbfs_sb.generation = 0;
@@ -609,7 +609,7 @@
smb_current_vmalloced = 0;
#endif

- read_semaphore = MUTEX;
+ init_MUTEX(&read_semaphore);

return init_smb_fs();
}
--- linux/include/linux/smb_fs_sb.h.orig3 Wed May 12 10:50:13 1999
+++ linux/include/linux/smb_fs_sb.h Wed May 12 10:50:33 1999
@@ -34,7 +34,7 @@
struct smb_conn_opt opt;

struct semaphore sem;
- struct wait_queue * wait;
+ wait_queue_head_t wait;

__u32 packet_size;
unsigned char * packet;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/