Whamcloud - gitweb
- landing of b_fid after merge with b_hd_cleanup_merge.
[fs/lustre-release.git] / lustre / kernel_patches / patches / nfs_export_kernel-2.4.24.patch
1 Index: lum/fs/Makefile
2 ===================================================================
3 --- lum.orig/fs/Makefile        2004-06-07 17:25:22.000000000 -0400
4 +++ lum/fs/Makefile     2004-06-07 17:25:22.000000000 -0400
5 @@ -7,7 +7,8 @@
6  
7  O_TARGET := fs.o
8  
9 -export-objs := filesystems.o open.o dcache.o buffer.o dquot.o inode.o
10 +export-objs := filesystems.o open.o dcache.o buffer.o dquot.o inode.o \
11 +               namei.o file_table.o
12  mod-subdirs := nls
13  
14  obj-y :=       open.o read_write.o devices.o file_table.o buffer.o \
15 Index: lum/fs/file_table.c
16 ===================================================================
17 --- lum.orig/fs/file_table.c    2002-11-28 18:53:15.000000000 -0500
18 +++ lum/fs/file_table.c 2004-06-07 17:25:22.000000000 -0400
19 @@ -82,7 +82,8 @@
20   * and call the open function (if any).  The caller must verify that
21   * inode->i_fop is not NULL.
22   */
23 -int init_private_file(struct file *filp, struct dentry *dentry, int mode)
24 +int init_private_file_it(struct file *filp, struct dentry *dentry, int mode,
25 +                         struct lookup_intent *it)
26  {
27         memset(filp, 0, sizeof(*filp));
28         filp->f_mode   = mode;
29 @@ -90,12 +91,20 @@
30         filp->f_dentry = dentry;
31         filp->f_uid    = current->fsuid;
32         filp->f_gid    = current->fsgid;
33 +       if (it)
34 +               filp->f_it = it;
35         filp->f_op     = dentry->d_inode->i_fop;
36         if (filp->f_op->open)
37                 return filp->f_op->open(dentry->d_inode, filp);
38         else
39                 return 0;
40  }
41 +EXPORT_SYMBOL(init_private_file_it);
42 +
43 +int init_private_file(struct file *filp, struct dentry *dentry, int mode)
44 +{
45 +       return init_private_file_it(filp, dentry, mode, NULL);
46 +}
47  
48  void fput(struct file * file)
49  {
50 Index: lum/fs/inode.c
51 ===================================================================
52 --- lum.orig/fs/inode.c 2004-06-07 17:25:22.000000000 -0400
53 +++ lum/fs/inode.c      2004-06-07 17:25:22.000000000 -0400
54 @@ -1045,9 +1045,10 @@
55  }
56  
57  
58 -struct inode *iget4(struct super_block *sb, unsigned long ino, find_inode_t find_actor, void *opaque)
59 +static inline struct inode *ifind(struct super_block *sb, unsigned long ino,
60 +                                  struct list_head *head,
61 +                                  find_inode_t find_actor, void *opaque)
62  {
63 -       struct list_head * head = inode_hashtable + hash(sb,ino);
64         struct inode * inode;
65  
66         spin_lock(&inode_lock);
67 @@ -1060,6 +1061,24 @@
68         }
69         spin_unlock(&inode_lock);
70  
71 +       return NULL;
72 +}
73 +
74 +struct inode *ilookup4(struct super_block *sb, unsigned long ino,
75 +                       find_inode_t find_actor, void *opaque)
76 +{
77 +       struct list_head * head = inode_hashtable + hash(sb,ino);
78 +       return ifind(sb, ino, head, find_actor, opaque);
79 +}
80 +
81 +struct inode *iget4(struct super_block *sb, unsigned long ino,
82 +                    find_inode_t find_actor, void *opaque)
83 +{
84 +       struct list_head * head = inode_hashtable + hash(sb,ino);
85 +       struct inode *inode = ifind(sb, ino, head, find_actor, opaque);
86 +       if (inode)
87 +               return inode;
88 +
89         /*
90          * get_new_inode() will do the right thing, re-trying the search
91          * in case it had to block at any point.
92 Index: lum/fs/namei.c
93 ===================================================================
94 --- lum.orig/fs/namei.c 2004-06-07 17:24:47.000000000 -0400
95 +++ lum/fs/namei.c      2004-06-07 18:08:28.000000000 -0400
96 @@ -22,6 +22,7 @@
97  #include <linux/dnotify.h>
98  #include <linux/smp_lock.h>
99  #include <linux/personality.h>
100 +#include <linux/module.h>
101  
102  #include <asm/namei.h>
103  #include <asm/uaccess.h>
104 @@ -100,6 +101,7 @@
105                 it->it_op_release(it);
106  
107  }
108 +EXPORT_SYMBOL(intent_release);
109  
110  /* In order to reduce some races, while at the same time doing additional
111   * checking and hopefully speeding things up, we copy filenames to the
112 @@ -907,7 +909,8 @@
113  
114  
115  /* SMP-safe */
116 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
117 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base,
118 +                                  int len, struct lookup_intent *it)
119  {
120         unsigned long hash;
121         struct qstr this;
122 @@ -927,11 +930,16 @@
123         }
124         this.hash = end_name_hash(hash);
125  
126 -       return lookup_hash_it(&this, base, NULL, NULL);
127 +       return lookup_hash_it(&this, base, NULL, it);
128  access:
129         return ERR_PTR(-EACCES);
130  }
131  
132 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
133 +{
134 +       return lookup_one_len_it(name, base, len, NULL);
135 +}
136 +
137  /*
138   *     namei()
139   *
140 Index: lum/fs/nfsd/export.c
141 ===================================================================
142 --- lum.orig/fs/nfsd/export.c   2003-11-28 13:26:21.000000000 -0500
143 +++ lum/fs/nfsd/export.c        2004-06-07 17:25:22.000000000 -0400
144 @@ -223,6 +223,11 @@
145         inode = nd.dentry->d_inode;
146         dev = inode->i_dev;
147         ino = inode->i_ino;
148 +       if ((inode->i_sb->s_type->fs_flags & FS_NFSEXP_FSID) &&
149 +           !(nxp->ex_flags & NFSEXP_FSID)) {
150 +           nxp->ex_dev = inode->i_sb->s_dev;
151 +           nxp->ex_flags |= NFSEXP_FSID;
152 +       }
153         err = -EINVAL;
154  
155         exp = exp_get(clp, dev, ino);
156 Index: lum/fs/nfsd/nfsfh.c
157 ===================================================================
158 --- lum.orig/fs/nfsd/nfsfh.c    2003-11-28 13:26:21.000000000 -0500
159 +++ lum/fs/nfsd/nfsfh.c 2004-06-07 17:51:58.000000000 -0400
160 @@ -36,6 +36,15 @@
161         int sequence;           /* sequence counter */
162  };
163  
164 +static struct dentry *lookup_it(struct inode *inode, struct dentry * dentry)
165 +{
166 +       if (inode->i_op->lookup_it)
167 +           return inode->i_op->lookup_it(inode, dentry, NULL, NULL, 0);
168 +       else
169 +           return inode->i_op->lookup(inode, dentry);
170 +               
171 +}
172 +
173  /*
174   * A rather strange filldir function to capture
175   * the name matching the specified inode number.
176 @@ -75,6 +84,8 @@
177         int error;
178         struct file file;
179         struct nfsd_getdents_callback buffer;
180 +       struct lookup_intent it;
181 +       struct file *filp = NULL;
182  
183         error = -ENOTDIR;
184         if (!dir || !S_ISDIR(dir->i_mode))
185 @@ -85,9 +96,37 @@
186         /*
187          * Open the directory ...
188          */
189 -       error = init_private_file(&file, dentry, FMODE_READ);
190 -       if (error)
191 +       if (dentry->d_op && dentry->d_op->d_revalidate_it) {
192 +               if ((dentry->d_flags & DCACHE_NFSD_DISCONNECTED) &&
193 +                   (dentry->d_parent == dentry) ) {
194 +                       it.it_op_release = NULL;
195 +                       /* 
196 +                        * XXX Temporary Hack: Simulating init_private_file without
197 +                        * f_op->open for disconnected dentry Since we don't have actual
198 +                        * dentry->d_name to revalidate in revalidate_it()
199 +                        */
200 +                       filp = &file;
201 +                       memset(filp, 0, sizeof(*filp));
202 +                       filp->f_mode   = FMODE_READ;
203 +                       atomic_set(&filp->f_count, 1);
204 +                       filp->f_dentry = dentry;
205 +                       filp->f_uid = current->fsuid;
206 +                       filp->f_gid = current->fsgid;
207 +                       filp->f_op = dentry->d_inode->i_fop;
208 +                       error = 0;
209 +               } else {
210 +                       intent_init(&it, IT_OPEN, 0);
211 +                       error = revalidate_it(dentry, &it);
212 +                       if (error)
213 +                               goto out;
214 +                       error = init_private_file_it(&file, dentry, FMODE_READ, &it);
215 +               }
216 +       } else {
217 +               error = init_private_file_it(&file, dentry, FMODE_READ, NULL);
218 +       }
219 +       if (error) 
220                 goto out;
221 +
222         error = -EINVAL;
223         if (!file.f_op->readdir)
224                 goto out_close;
225 @@ -113,9 +152,13 @@
226         }
227  
228  out_close:
229 -       if (file.f_op->release)
230 +       if (file.f_op->release && !filp)
231                 file.f_op->release(dir, &file);
232  out:
233 +       if (dentry->d_op &&
234 +           dentry->d_op->d_revalidate_it &&
235 +           it.it_op_release && !filp)
236 +               intent_release(&it);
237         return error;
238  }
239  
240 @@ -274,7 +317,7 @@
241          * it is well connected.  But nobody returns different dentrys do they?
242          */
243         down(&child->d_inode->i_sem);
244 -       pdentry = child->d_inode->i_op->lookup(child->d_inode, tdentry);
245 +       pdentry = lookup_it(child->d_inode, tdentry);
246         up(&child->d_inode->i_sem);
247         d_drop(tdentry); /* we never want ".." hashed */
248         if (!pdentry && tdentry->d_inode == NULL) {
249 @@ -307,6 +350,8 @@
250                                 pdentry->d_flags |= DCACHE_NFSD_DISCONNECTED;
251                                 pdentry->d_op = child->d_op;
252                         }
253 +                       if (child->d_op && child->d_op->d_revalidate_it)
254 +                               pdentry->d_op = child->d_op;
255                 }
256                 if (pdentry == NULL)
257                         pdentry = ERR_PTR(-ENOMEM);
258 @@ -464,6 +509,8 @@
259                 struct dentry *pdentry;
260                 struct inode *parent;
261  
262 +               if (result->d_op && result->d_op->d_revalidate_it)
263 +                       dentry->d_op = result->d_op;
264                 pdentry = nfsd_findparent(dentry);
265                 err = PTR_ERR(pdentry);
266                 if (IS_ERR(pdentry))
267 @@ -670,6 +717,11 @@
268  
269         inode = dentry->d_inode;
270  
271 +       /* cache coherency for non-device filesystems */
272 +       if (inode->i_op && inode->i_op->revalidate_it) {
273 +           inode->i_op->revalidate_it(dentry, NULL);
274 +       }
275 +
276         /* Type check. The correct error return for type mismatches
277          * does not seem to be generally agreed upon. SunOS seems to
278          * use EISDIR if file isn't S_IFREG; a comment in the NFSv3
279 @@ -903,8 +955,9 @@
280                 dentry->d_parent->d_name.name, dentry->d_name.name);
281         goto out;
282  out_uptodate:
283 -       printk(KERN_ERR "fh_update: %s/%s already up-to-date!\n",
284 -               dentry->d_parent->d_name.name, dentry->d_name.name);
285 +       if(!dentry->d_parent->d_inode->i_op->mkdir_raw)
286 +               printk(KERN_ERR "fh_update: %s/%s already up-to-date!\n",
287 +                       dentry->d_parent->d_name.name, dentry->d_name.name);
288         goto out;
289  }
290  
291 Index: lum/fs/nfsd/vfs.c
292 ===================================================================
293 --- lum.orig/fs/nfsd/vfs.c      2003-11-28 13:26:21.000000000 -0500
294 +++ lum/fs/nfsd/vfs.c   2004-06-07 17:25:22.000000000 -0400
295 @@ -77,6 +77,128 @@
296  static struct raparms *                raparml;
297  static struct raparms *                raparm_cache;
298  
299 +static int link_raw(struct dentry *dold, struct dentry *ddir,
300 +                    struct dentry *dnew)
301 +{
302 +       int err;
303 +
304 +       struct nameidata old_nd = { .dentry = dold };
305 +       struct nameidata nd = { .dentry = ddir, .last = dnew->d_name };
306 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
307 +       err = op->link_raw(&old_nd, &nd);
308 +       d_instantiate(dnew, dold->d_inode);
309 +       if(dold->d_inode->i_op && dold->d_inode->i_op->revalidate_it)
310 +               dold->d_inode->i_op->revalidate_it(dnew, NULL);
311 +
312 +       return err;
313 +}
314 +
315 +static int unlink_raw(struct dentry *dentry, char *fname, int flen,
316 +                      struct dentry *rdentry)
317 +{
318 +       int err;
319 +        struct qstr last = { .name = fname, .len = flen };
320 +       struct nameidata nd = { .dentry = dentry, .last = last };
321 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
322 +       err = op->unlink_raw(&nd);
323 +       if (!err)
324 +               d_delete(rdentry);
325 +
326 +       return err;
327 +}
328 +
329 +static int rmdir_raw(struct dentry *dentry, char *fname, int flen,
330 +                     struct dentry *rdentry)
331 +{
332 +       int err;
333 +        struct qstr last = { .name = fname, .len = flen };
334 +       struct nameidata nd = { .dentry = dentry, .last = last };
335 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
336 +       err = op->rmdir_raw(&nd);
337 +       if(!err) {
338 +               rdentry->d_inode->i_flags |= S_DEAD;
339 +               d_delete(rdentry);
340 +       }
341 +
342 +       return err;
343 +}
344 +
345 +static int symlink_raw(struct dentry *dentry,  char *fname, int flen,
346 +                       char *path)
347 +{
348 +       int err;
349 +        struct qstr last = { .name = fname, .len = flen };
350 +       struct nameidata nd = { .dentry = dentry, .last = last };
351 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
352 +       err = op->symlink_raw(&nd, path);
353 +
354 +       return err;
355 +}
356 +
357 +static int mkdir_raw(struct dentry *dentry, char *fname, int flen, int mode)
358 +{
359 +       int err;
360 +        struct qstr last = { .name = fname, .len = flen };
361 +       struct nameidata nd = { .dentry = dentry, .last = last };
362 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
363 +       err = op->mkdir_raw(&nd, mode);
364 +
365 +       return err;
366 +}
367 +
368 +static int mknod_raw(struct dentry *dentry, char *fname, int flen, int mode,
369 +                     dev_t dev)
370 +{
371 +       int err;
372 +        struct qstr last = { .name = fname, .len = flen };
373 +       struct nameidata nd = { .dentry = dentry, .last = last };
374 +       struct inode_operations *op = nd.dentry->d_inode->i_op;
375 +       err = op->mknod_raw(&nd, mode, dev);
376 +
377 +       return err;
378 +}      
379 +
380 +static int rename_raw(struct dentry *fdentry, struct dentry *tdentry,
381 +                      struct dentry *odentry, struct dentry *ndentry)
382 +{
383 +       int err;
384 +
385 +       struct nameidata old_nd = { .dentry = fdentry, .last = odentry->d_name};
386 +       struct nameidata new_nd = { .dentry = tdentry, .last = ndentry->d_name};
387 +       struct inode_operations *op = old_nd.dentry->d_inode->i_op;
388 +       err = op->rename_raw(&old_nd, &new_nd);
389 +       d_move(odentry, ndentry);
390 +
391 +       return err;
392 +}
393 +
394 +static int setattr_raw(struct inode *inode, struct iattr *iap)
395 +{
396 +       int err;
397 +
398 +       iap->ia_valid |= ATTR_RAW;
399 +       err = inode->i_op->setattr_raw(inode, iap);
400 +
401 +       return err;
402 +}
403 +
404 +int revalidate_it(struct dentry *dentry, struct lookup_intent *it)
405 +{
406 +       int err = 0;
407 +
408 +       if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
409 +               if (!dentry->d_op->d_revalidate_it(dentry, 0, NULL, it) &&
410 +                       !d_invalidate(dentry)) {
411 +                       dput(dentry);
412 +                       err = -EINVAL;
413 +                       dentry = NULL;
414 +                       return err;
415 +               }
416 +       }
417 +
418 +       return err;
419 +}
420 +
421  /*
422   * Look up one component of a pathname.
423   * N.B. After this call _both_ fhp and resfh need an fh_put
424 @@ -302,7 +424,10 @@
425         }
426         err = nfserr_notsync;
427         if (!check_guard || guardtime == inode->i_ctime) {
428 -               err = notify_change(dentry, iap);
429 +               if ( dentry->d_inode->i_op && dentry->d_inode->i_op->setattr_raw)
430 +                       err = setattr_raw(dentry->d_inode, iap);
431 +               else
432 +                       err = notify_change(dentry, iap);
433                 err = nfserrno(err);
434         }
435         if (size_change) {
436 @@ -429,6 +554,7 @@
437  {
438         struct dentry   *dentry;
439         struct inode    *inode;
440 +       struct lookup_intent it;
441         int             err;
442  
443         /* If we get here, then the client has already done an "open", and (hopefully)
444 @@ -475,6 +601,14 @@
445                 filp->f_mode  = FMODE_READ;
446         }
447  
448 +       intent_init(&it, IT_OPEN, (filp->f_flags & ~O_ACCMODE) | filp->f_mode);
449 +
450 +       err = revalidate_it(dentry, &it);
451 +       if (err)
452 +               goto out_nfserr;
453 +       
454 +       filp->f_it = &it;
455 +       
456         err = 0;
457         if (filp->f_op && filp->f_op->open) {
458                 err = filp->f_op->open(inode, filp);
459 @@ -489,7 +623,11 @@
460                         atomic_dec(&filp->f_count);
461                 }
462         }
463 +
464  out_nfserr:
465 +       if (it.it_op_release)
466 +               intent_release(&it);
467 +
468         if (err)
469                 err = nfserrno(err);
470  out:
471 @@ -820,7 +958,7 @@
472  {
473         struct dentry   *dentry, *dchild;
474         struct inode    *dirp;
475 -       int             err;
476 +       int             err, error = -EOPNOTSUPP;
477  
478         err = nfserr_perm;
479         if (!flen)
480 @@ -836,20 +974,44 @@
481         dentry = fhp->fh_dentry;
482         dirp = dentry->d_inode;
483  
484 +       switch (type) {
485 +                       case S_IFDIR:
486 +                               if (dirp->i_op->mkdir_raw)
487 +                           error = mkdir_raw(dentry, fname, flen, iap->ia_mode);
488 +                               break;
489 +                       case S_IFCHR:
490 +                       case S_IFBLK:
491 +                       case S_IFIFO:
492 +                       case S_IFSOCK:
493 +                       case S_IFREG:
494 +                           if (dirp->i_op->mknod_raw) {
495 +                                       if (type == S_IFREG)
496 +                                               rdev = 0;
497 +                                       error = mknod_raw(dentry, fname, flen, iap->ia_mode, rdev);
498 +                               }
499 +                               break;
500 +                               default:
501 +                       printk("nfsd: bad file type %o in nfsd_create\n", type);
502 +       }
503 +
504         err = nfserr_notdir;
505 -       if(!dirp->i_op || !dirp->i_op->lookup)
506 +       if(!dirp->i_op || !(dirp->i_op->lookup || dirp->i_op->lookup_it))
507                 goto out;
508         /*
509          * Check whether the response file handle has been verified yet.
510          * If it has, the parent directory should already be locked.
511          */
512 -       if (!resfhp->fh_dentry) {
513 -               /* called from nfsd_proc_mkdir, or possibly nfsd3_proc_create */
514 -               fh_lock(fhp);
515 +       if (!resfhp->fh_dentry || dirp->i_op->lookup_it) {
516 +               /* called from nfsd_proc_mkdir, or possibly nfsd3_proc_create
517 +                  and nfsd_proc_create in case of lustre
518 +               */
519 +               if (!resfhp->fh_dentry)
520 +                       fh_lock(fhp);
521                 dchild = lookup_one_len(fname, dentry, flen);
522                 err = PTR_ERR(dchild);
523                 if (IS_ERR(dchild))
524                         goto out_nfserr;
525 +               resfhp->fh_dentry = NULL;
526                 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp);
527                 if (err)
528                         goto out;
529 @@ -870,10 +1032,12 @@
530          * Make sure the child dentry is still negative ...
531          */
532         err = nfserr_exist;
533 -       if (dchild->d_inode) {
534 -               dprintk("nfsd_create: dentry %s/%s not negative!\n",
535 -                       dentry->d_name.name, dchild->d_name.name);
536 -               goto out; 
537 +       if ( error == -EOPNOTSUPP) {
538 +               if (dchild->d_inode) {
539 +                       dprintk("nfsd_create: dentry %s/%s not negative!\n",
540 +                               dentry->d_name.name, dchild->d_name.name);
541 +                       goto out; 
542 +               }
543         }
544  
545         if (!(iap->ia_valid & ATTR_MODE))
546 @@ -886,16 +1050,19 @@
547         err = nfserr_perm;
548         switch (type) {
549         case S_IFREG:
550 -               err = vfs_create(dirp, dchild, iap->ia_mode);
551 +               if (error == -EOPNOTSUPP)
552 +                       err = vfs_create(dirp, dchild, iap->ia_mode);
553                 break;
554         case S_IFDIR:
555 -               err = vfs_mkdir(dirp, dchild, iap->ia_mode);
556 +               if (error == -EOPNOTSUPP)
557 +                       err = vfs_mkdir(dirp, dchild, iap->ia_mode);
558                 break;
559         case S_IFCHR:
560         case S_IFBLK:
561         case S_IFIFO:
562         case S_IFSOCK:
563 -               err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
564 +               if (error == -EOPNOTSUPP)       
565 +                       err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
566                 break;
567         default:
568                 printk("nfsd: bad file type %o in nfsd_create\n", type);
569 @@ -964,7 +1131,13 @@
570         /* Get all the sanity checks out of the way before
571          * we lock the parent. */
572         err = nfserr_notdir;
573 -       if(!dirp->i_op || !dirp->i_op->lookup)
574 +       if (dirp->i_op->mknod_raw) {
575 +               err = mknod_raw(dentry, fname, flen, iap->ia_mode, 0);
576 +               if (err && err != -EOPNOTSUPP)
577 +                       goto out;
578 +       }
579 +
580 +       if(!dirp->i_op ||  !(dirp->i_op->lookup || dirp->i_op->lookup_it))
581                 goto out;
582         fh_lock(fhp);
583  
584 @@ -1015,6 +1188,8 @@
585                 case NFS3_CREATE_GUARDED:
586                         err = nfserr_exist;
587                 }
588 +               if(dirp->i_op->mknod_raw)
589 +                       err = 0;
590                 goto out;
591         }
592  
593 @@ -1121,7 +1296,7 @@
594                                 struct iattr *iap)
595  {
596         struct dentry   *dentry, *dnew;
597 -       int             err, cerr;
598 +       int             err, cerr, error = -EOPNOTSUPP;
599  
600         err = nfserr_noent;
601         if (!flen || !plen)
602 @@ -1135,12 +1310,18 @@
603                 goto out;
604         fh_lock(fhp);
605         dentry = fhp->fh_dentry;
606 +       
607 +       if (dentry->d_inode->i_op->symlink_raw)
608 +               error = symlink_raw(dentry, fname, flen, path);
609 +
610         dnew = lookup_one_len(fname, dentry, flen);
611         err = PTR_ERR(dnew);
612         if (IS_ERR(dnew))
613                 goto out_nfserr;
614  
615 -       err = vfs_symlink(dentry->d_inode, dnew, path);
616 +       err = error;
617 +       if (err == -EOPNOTSUPP || !dentry->d_inode->i_op->symlink_raw)
618 +               err = vfs_symlink(dentry->d_inode, dnew, path);
619         if (!err) {
620                 if (EX_ISSYNC(fhp->fh_export))
621                         nfsd_sync_dir(dentry);
622 @@ -1150,7 +1331,10 @@
623                                 iap->ia_valid |= ATTR_CTIME;
624                                 iap->ia_mode = (iap->ia_mode&S_IALLUGO)
625                                         | S_IFLNK;
626 -                               err = notify_change(dnew, iap);
627 +                               if (dnew->d_inode->i_op && dnew->d_inode->i_op->setattr_raw)
628 +                                       err = setattr_raw(dnew->d_inode, iap);
629 +                               else
630 +                                       err = notify_change(dnew, iap);
631                                 if (err)
632                                         err = nfserrno(err);
633                                 else if (EX_ISSYNC(fhp->fh_export))
634 @@ -1210,7 +1394,10 @@
635         dold = tfhp->fh_dentry;
636         dest = dold->d_inode;
637  
638 -       err = vfs_link(dold, dirp, dnew);
639 +       if (dirp->i_op->link_raw)
640 +               err = link_raw(dold, ddir, dnew);
641 +       else
642 +               err = vfs_link(dold, dirp, dnew);
643         if (!err) {
644                 if (EX_ISSYNC(ffhp->fh_export)) {
645                         nfsd_sync_dir(ddir);
646 @@ -1295,7 +1482,10 @@
647                         err = nfserr_perm;
648         } else
649  #endif
650 -       err = vfs_rename(fdir, odentry, tdir, ndentry);
651 +       if(fdir->i_op->rename_raw)
652 +               err = rename_raw(fdentry, tdentry, odentry, ndentry);
653 +       else
654 +               err = vfs_rename(fdir, odentry, tdir, ndentry);
655         if (!err && EX_ISSYNC(tfhp->fh_export)) {
656                 nfsd_sync_dir(tdentry);
657                 nfsd_sync_dir(fdentry);
658 @@ -1316,7 +1506,7 @@
659         fill_post_wcc(tfhp);
660         double_up(&tdir->i_sem, &fdir->i_sem);
661         ffhp->fh_locked = tfhp->fh_locked = 0;
662 -       
663 +
664  out:
665         return err;
666  }
667 @@ -1362,9 +1552,15 @@
668                         err = nfserr_perm;
669                 } else
670  #endif
671 -               err = vfs_unlink(dirp, rdentry);
672 +               if (dirp->i_op->unlink_raw)
673 +                       err = unlink_raw(dentry, fname, flen, rdentry);
674 +               else
675 +                       err = vfs_unlink(dirp, rdentry);
676         } else { /* It's RMDIR */
677 -               err = vfs_rmdir(dirp, rdentry);
678 +               if (dirp->i_op->rmdir_raw)
679 +                       err = rmdir_raw(dentry, fname, flen, rdentry);
680 +               else
681 +                       err = vfs_rmdir(dirp, rdentry);
682         }
683  
684         dput(rdentry);
685 Index: lum/include/linux/fs.h
686 ===================================================================
687 --- lum.orig/include/linux/fs.h 2004-06-07 17:25:22.000000000 -0400
688 +++ lum/include/linux/fs.h      2004-06-07 17:25:22.000000000 -0400
689 @@ -93,6 +93,9 @@
690  #define FS_SINGLE      8 /* Filesystem that can have only one superblock */
691  #define FS_NOMOUNT     16 /* Never mount from userland */
692  #define FS_LITTER      32 /* Keeps the tree in dcache */
693 +#define FS_NFSEXP_FSID 64 /* Use file system specific fsid for
694 +                          * exporting non device filesystems.
695 +                          */
696  #define FS_ODD_RENAME  32768   /* Temporary stuff; will go away as soon
697                                   * as nfs_rename() will be cleaned up
698                                   */
699 @@ -1122,6 +1125,9 @@
700                          struct nameidata *nd, struct lookup_intent *it);
701  extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
702                             int flags, struct lookup_intent *it);
703 +extern int revalidate_it(struct dentry *dentry, struct lookup_intent *it);
704 +extern int init_private_file_it(struct file *, struct dentry *dentry, int mode,
705 +                                struct lookup_intent *it);
706  extern int filp_close(struct file *, fl_owner_t id);
707  extern char * getname(const char *);
708  
709 @@ -1419,6 +1425,8 @@
710  extern int follow_down(struct vfsmount **, struct dentry **);
711  extern int follow_up(struct vfsmount **, struct dentry **);
712  extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
713 +extern struct dentry * lookup_one_len_it(const char *, struct dentry *, int,
714 +                                         struct lookup_intent *);
715  extern struct dentry * lookup_hash(struct qstr *, struct dentry *, struct nameidata *);
716  #define user_path_walk(name,nd)         __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
717  #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
718 @@ -1434,6 +1442,8 @@
719  
720  typedef int (*find_inode_t)(struct inode *, unsigned long, void *);
721  extern struct inode * iget4(struct super_block *, unsigned long, find_inode_t, void *);
722 +extern struct inode * ilookup4(struct super_block *, unsigned long,
723 +                               find_inode_t, void *);
724  static inline struct inode *iget(struct super_block *sb, unsigned long ino)
725  {
726         return iget4(sb, ino, NULL, NULL);
727 Index: lum/kernel/ksyms.c
728 ===================================================================
729 --- lum.orig/kernel/ksyms.c     2004-06-07 17:25:22.000000000 -0400
730 +++ lum/kernel/ksyms.c  2004-06-07 17:25:22.000000000 -0400
731 @@ -150,6 +150,7 @@
732  EXPORT_SYMBOL(iunique);
733  EXPORT_SYMBOL(ilookup);
734  EXPORT_SYMBOL(iget4);
735 +EXPORT_SYMBOL(ilookup4);
736  EXPORT_SYMBOL(iput);
737  EXPORT_SYMBOL(inode_init_once);
738  EXPORT_SYMBOL(force_delete);
739 @@ -161,6 +162,7 @@
740  EXPORT_SYMBOL(path_release);
741  EXPORT_SYMBOL(__user_walk);
742  EXPORT_SYMBOL(lookup_one_len);
743 +EXPORT_SYMBOL(lookup_one_len_it);
744  EXPORT_SYMBOL(lookup_hash);
745  EXPORT_SYMBOL(sys_close);
746  EXPORT_SYMBOL(dcache_lock);