DEVEL15-linux-2625-update-20080322 openafs-devel-1_5_34
authorMarc Dionne <marc.dionne@technoconseil.com>
Sun, 23 Mar 2008 00:53:46 +0000 (00:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 23 Mar 2008 00:53:46 +0000 (00:53 +0000)
LICENSE IPL10
FIXES 88000

update 2.6.25 patch to hopefully cover what we need better

(cherry picked from commit 76494a572e504c426fe9dabc8e68115f7ee6a05c)

src/afs/LINUX/osi_file.c
src/config/param.i386_linux26.h

index e63de50..f1fd634 100644 (file)
@@ -23,7 +23,9 @@ RCSID
 #if defined(AFS_LINUX26_ENV)
 #include "h/namei.h"
 #endif
-
+#if !defined(HAVE_IGET)
+#include "h/exportfs.h"
+#endif
 
 afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
@@ -41,10 +43,8 @@ osi_UFSOpen(afs_int32 ainode)
     struct inode *tip = NULL;
     struct dentry *dp = NULL;
     struct file *filp = NULL;
-#if defined(AFS_CACHE_VNODE_PATH)
-    int code;
-    int dummy;
-    char fname[1024];
+#if !defined(HAVE_IGET)
+    struct fid fid;
 #endif
     AFS_STATCNT(osi_UFSOpen);
     if (cacheDiskType != AFS_FCACHE_TYPE_UFS) {
@@ -63,39 +63,15 @@ osi_UFSOpen(afs_int32 ainode)
                  sizeof(struct osi_file));
     }
     memset(afile, 0, sizeof(struct osi_file));
-#ifdef AFS_CACHE_VNODE_PATH
-    if (ainode < 0) {
-      switch (ainode) {
-      case AFS_CACHE_CELLS_INODE:
-       snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "CellItems");
-       break;
-      case AFS_CACHE_ITEMS_INODE:
-       snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "CacheItems");
-       break;
-      case AFS_CACHE_VOLUME_INODE:
-       snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "VolumeItems");
-       break;
-      default:
-       osi_Panic("Invalid negative inode");
-      }
-    } else {
-      dummy = ainode / afs_numfilesperdir;
-      snprintf(fname, 1024, "%s/D%d/V%d", afs_cachebasedir, dummy, ainode);
-    }
-
-    code = osi_lookupname(fname, AFS_UIOSYS, 0, &dp);
-    if (code) {
-       osi_Panic("Failed cache file lookup: %s in UFSOpen\n", fname);
-    }
-    tip = dp->d_inode;
-#else
+#if defined(HAVE_IGET)
     tip = iget(afs_cacheSBp, (u_long) ainode);
-    if (!tip)
-       osi_Panic("Can't get inode %d\n", ainode);
-
-    dp = d_alloc_anon(tip);
+#else
+    fid.i32.ino = ainode;
+    fid.i32.gen = 0;
+    dp = afs_cacheSBp->s_export_op->fh_to_dentry(afs_cacheSBp, &fid, sizeof(fid), FILEID_INO32_GEN);
     if (!dp) 
            osi_Panic("Can't get dentry for inode %d\n", ainode);          
+    tip = dp->d_inode;
 #endif
     tip->i_flags |= MS_NOATIME;        /* Disable updating access times. */
 
index 6c99269..33a9376 100644 (file)
@@ -27,9 +27,6 @@
 #define AFS_64BIT_ENV          1
 #define AFS_64BIT_CLIENT       1
 
-#ifndef HAVE_IGET
-#define AFS_CACHE_VNODE_PATH 1
-#endif
 
 #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)