#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;
struct inode *tip = NULL;
struct dentry *dp = NULL;
struct file *filp = NULL;
+#if !defined(HAVE_IGET)
+ struct fid fid;
+#endif
AFS_STATCNT(osi_UFSOpen);
if (cacheDiskType != AFS_FCACHE_TYPE_UFS) {
osi_Panic("UFSOpen called for non-UFS cache\n");
sizeof(struct osi_file));
}
memset(afile, 0, sizeof(struct osi_file));
+#if defined(HAVE_IGET)
tip = iget(afs_cacheSBp, (u_long) ainode);
- if (!tip)
- osi_Panic("Can't get inode %d\n", ainode);
- tip->i_flags |= MS_NOATIME; /* Disable updating access times. */
-
- 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. */
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
if (IS_ERR(filp))
AFS_STATCNT(osi_Stat);
MObtainWriteLock(&afs_xosi, 320);
astat->size = OSIFILE_INODE(afile)->i_size;
-#ifdef STRUCT_INODE_HAS_I_BLKSIZE
- astat->blksize = OSIFILE_INODE(afile)->i_blksize;
-#endif
#if defined(AFS_LINUX26_ENV)
astat->mtime = OSIFILE_INODE(afile)->i_mtime.tv_sec;
astat->atime = OSIFILE_INODE(afile)->i_atime.tv_sec;
void
shutdown_osifile(void)
{
- extern int afs_cold_shutdown;
-
AFS_STATCNT(shutdown_osifile);
if (afs_cold_shutdown) {
afs_osicred_initialized = 0;