smbfs compile problems with 2.1.50

Craig Brozefsky (craig@onshore.com)
Mon, 18 Aug 1997 01:27:04 -0500


I was attempting to compile smbfs as a module with my 2.1.50 kernel and
ran into some problems were it looked like the smbfs code had not been
converted to the dcache scheme.

Here is a patch against 2.1.50 to fix the inode related smbfs code.

I have compiled and am running with it, but regretably do not have a Win95
machine or a WinNT machine in the house to test it against. I apologize
for not having copletely debugged it but I figured I would probably want
the maintainer of the smbfs code to look it over for an glaring
stupidities on my part.

I also apologize if this is no the proper diff format, I have not made
patches of the kernel before. Is there a place I could find guidelines
for patching the kernel, or generating patches and the protocols for
submitting them? The Coding-Style document doesn't contain such info.

I have not run a new kernel since 2.0.26, but on this litle laptop 2.1.50
seems noticably faster (or it could just be that I'm not compiling a dozen
packages right now).

I have pcmcia services working with it just fine after the previous
change I mentioned. I am only using pcmcia services for an ethernet
controller tho so i must say I also haven't tested the ds.c code I had to
change.

--- fs/smbfs/file.c.old Mon Aug 18 11:23:04 1997
+++ fs/smbfs/file.c Mon Aug 18 11:23:42 1997
@@ -126,7 +126,7 @@

if (!IS_RDONLY(inode))
inode->i_atime = CURRENT_TIME;
- inode->i_dirt = 1;
+ mark_inode_dirty(inode);

DPRINTK("smb_file_read: exit %s\n", SMB_FINFO(inode)->name);

@@ -196,7 +196,7 @@
}

inode->i_mtime = inode->i_ctime = CURRENT_TIME;
- inode->i_dirt = 1;
+ mark_inode_dirty(inode);

file->f_pos = pos;

--- fs/smbfs/inode.c.old Mon Aug 18 10:31:56 1997
+++ fs/smbfs/inode.c Mon Aug 18 11:17:23 1997
@@ -228,7 +228,7 @@
sb->s_dev = 0;
return NULL;
}
- if (!S_ISSOCK(filp->f_inode->i_mode))
+ if (!S_ISSOCK(filp->f_dentry->d_inode->i_mode))
{
printk("smb_read_super: not a socket!\n");
sb->s_dev = 0;
@@ -305,7 +305,7 @@
}
smb_init_root_dirent(server, &(server->root.finfo));

- if (!(sb->s_mounted = iget(sb, smb_info_ino(&(server->root)))))
+ if (!iget(sb, smb_info_ino(&(server->root))))
{
sb->s_dev = 0;
printk("smb_read_super: get root inode failed\n");
--- fs/smbfs/mmap.c.old Mon Aug 18 11:31:16 1997
+++ fs/smbfs/mmap.c Mon Aug 18 11:30:01 1997
@@ -27,7 +27,7 @@
smb_file_mmap_nopage(struct vm_area_struct *area,
unsigned long address, int no_share)
{
- struct inode *inode = area->vm_inode;
+ struct inode *inode = area->vm_dentry->d_inode;
unsigned long page;
unsigned int clear;
unsigned long tmp;
@@ -117,7 +117,7 @@
if (!IS_RDONLY(inode))
{
inode->i_atime = CURRENT_TIME;
- inode->i_dirt = 1;
+ mark_inode_dirty(inode);
}

vma->vm_dentry = dget(file->f_dentry);
--- fs/smbfs/sock.c.old Mon Aug 18 10:28:46 1997
+++ fs/smbfs/sock.c Mon Aug 18 10:29:42 1997
@@ -128,7 +128,7 @@

if ((server == NULL)
|| ((file = server->sock_file) == NULL)
- || ((inode = file->f_inode) == NULL)
+ || ((inode = file->f_dentry->d_inode) == NULL)
|| (!S_ISSOCK(inode->i_mode)))
{
printk("smb_catch_keepalive: did not get valid server!\n");
@@ -175,7 +175,7 @@

if ((server == NULL)
|| ((file = server->sock_file) == NULL)
- || ((inode = file->f_inode) == NULL)
+ || ((inode = file->f_dentry->d_inode) == NULL)
|| (!S_ISSOCK(inode->i_mode)))
{
printk("smb_dont_catch_keepalive: "
@@ -322,7 +322,7 @@
return NULL;
if ((file = server->sock_file) == NULL)
return NULL;
- if ((inode = file->f_inode) == NULL)
+ if ((inode = file->f_dentry->d_inode) == NULL)
return NULL;
return &(inode->u.socket_i);
}

Craig Brozefsky craig@onshore.com
onShore Inc. http://www.onshore.com/~craig
Development Team p_priority=PFUN+(p_work/4)+(2*p_cash)