[2.1.45] compiling {NFS as module,VFS}

B. James Phillippe (bryan@Terran.ORG)
Thu, 17 Jul 1997 02:21:12 -0700 (PDT)


Greets,

I ran into some problems trying to compile 2.1.45 with modular NFS
(w/server support). I tried fixing it, and actually did get some of it to
compile cleanly, but I can't test it right now and am really not sure I
even know what I'm doing. I tried following the dentry stuff around but I
really am only taking an educated guess here. Can someone tell me if I am
even on the right track? I did something like this:

***WARNING TO NOVICE*** DO NOT APPLY THIS DIFF; IT WAS MADE BY AN IDIOT

--- fs/nfsd/nfsproc.c.bp-orig Wed Jul 16 23:56:32 1997
+++ fs/nfsd/nfsproc.c Thu Jul 17 00:40:11 1997
@@ -217,7 +217,7 @@
nfserr = fh_lookup(rqstp, dirfhp, S_IFDIR, MAY_EXEC);
if (nfserr)
RETURN(nfserr);
- dirp = dirfhp->fh_inode;
+ dirp = dirfhp->fh_dentry->d_inode;

/* Check for MAY_WRITE separately. */
nfserr = nfsd_permission(dirfhp->fh_export, dirp, MAY_WRITE);
@@ -230,7 +230,7 @@

/* First, check if the file already exists. */
exists = !nfsd_lookup(rqstp, dirfhp, argp->name, argp->len, newfhp);
- inode = newfhp->fh_inode;
+ inode = newfhp->fh_dentry->d_inode;

/* Unfudge the mode bits */
if (attr->ia_valid & ATTR_MODE) {

--- fs/nfsd/nfsfh.c.bp-orig Thu Jul 17 01:37:32 1997
+++ fs/nfsd/nfsfh.c Thu Jul 17 01:06:39 1997
@@ -39,7 +39,7 @@
struct knfs_fh *fh = &fhp->fh_handle;

/* Already checked */
- if (fhp->fh_inode)
+ if (fhp->fh_dentry->d_inode)
return 0;

dprintk("nfsd: fh_lookup(exp %x/%ld fh %x/%ld)\n",
@@ -84,9 +84,9 @@
}

/* This is basically what wait_on_inode does */
- while (inode->i_lock)
+ while (test_bit(I_LOCK, &inode->i_state))
sleep_on(&inode->i_wait);
- fhp->fh_inode = inode;
+ fhp->fh_dentry->d_inode = inode;
fhp->fh_export = exp;

/* Type check. The correct error return for type mismatches
@@ -114,7 +114,7 @@
exp->ex_dev, exp->ex_ino, inode->i_dev, inode->i_ino);

fh_init(fhp); /* initialize empty fh */
- fhp->fh_inode = inode;
+ fhp->fh_dentry->d_inode = inode;
fhp->fh_export = exp;
fhp->fh_handle.fh_dev = inode->i_dev;
fhp->fh_handle.fh_ino = inode->i_ino;

I can't get any further even with this piece compiling because I get
nailed in vfs.c and it looks way too damn spooky for me to venture any
further. FWIW, the kernel itself built apparently okay; it finished,
anyway...

vfs.c: In function `nfsd_iscovered':
vfs.c:93: structure has no member named `i_mount'
vfs.c:94: warning: control reaches end of non-void function
vfs.c: In function `nfsd_lookup':
vfs.c:114: structure has no member named `fh_inode'
vfs.c:122: warning: comparison of distinct pointer types lacks a cast
vfs.c:153: warning: passing arg 2 from incompatible pointer type
vfs.c:153: too many arguments to function

....... Oogles more deleted.

Looks like "struct inode *i_mount;" was pulled in fs.h of 2.1.44, but it
didn't go away everywhere? I'd really like to learn this stuff so if
anyone has any comments on what the problem is or how I went about trying
to fix (some of) it, please let me know.

-bp

--
B. James Phillippe                              Seattle Software Labs, Inc
Network Administrator                           Phone: (206) 521-8346
NIC Handle: BJP4                                Fax: (206) 521-8340
http://w3.terran.org/~bryan                     http://www.sealabs.com