if test "x$ac_cv_linux_have_kmem_cache_t" = "xyes" ; then
AC_DEFINE(KMEM_CACHE_TAKES_DTOR, 1, [define if kmem_cache_create takes a destructor argument])
fi
+ if test "$enable_linux_fh" = "yes"; then
+ AC_DEFINE(LINUX_USE_FH, 1, [define if you want to open cache files by file handle instead of inode numbers])
+ fi
if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" -o "x$ac_cv_linux_func_i_put_link_takes_cookie" = "xyes"; then
AC_DEFINE(USABLE_KERNEL_PAGE_SYMLINK_CACHE, 1, [define if your kernel has a usable symlink cache API])
else
#if defined(AFS_LINUX26_ENV)
void *
+#if defined(LINUX_USE_FH)
+osi_UFSOpen_fh(struct fid *fh, int fh_type)
+#else
osi_UFSOpen(afs_int32 ainode)
+#endif
{
register struct osi_file *afile = NULL;
extern int cacheDiskType;
struct inode *tip = NULL;
struct dentry *dp = NULL;
struct file *filp = NULL;
-#if !defined(HAVE_IGET)
+#if !defined(HAVE_IGET) || defined(LINUX_USE_FH)
struct fid fid;
#endif
AFS_STATCNT(osi_UFSOpen);
dp = d_alloc_anon(tip);
#else
+#if defined(LINUX_USE_FH)
+ dp = afs_cacheSBp->s_export_op->fh_to_dentry(afs_cacheSBp, fh, sizeof(struct fid), fh_type);
+#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);
+#endif
if (!dp)
- osi_Panic("Can't get dentry for inode %d\n", ainode);
+ osi_Panic("Can't get dentry\n");
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))
+#if defined(LINUX_USE_FH)
+ osi_Panic("Can't open file\n");
+#else
osi_Panic("Can't open inode %d\n", ainode);
+#endif
afile->filp = filp;
afile->size = FILE_INODE(filp)->i_size;
AFS_GLOCK();
afile->offset = 0;
afile->proc = (int (*)())0;
+#if defined(LINUX_USE_FH)
+ afile->inum = tip->i_ino; /* for hint validity checking */
+#else
afile->inum = ainode; /* for hint validity checking */
+#endif
return (void *)afile;
}
#else
}
#endif
+#if defined(LINUX_USE_FH)
+int
+osi_get_fh(struct dentry *dp, struct fid *fh, int *max_len) {
+ int fh_type;
+
+ if (dp->d_sb->s_export_op->encode_fh) {
+ fh_type = dp->d_sb->s_export_op->encode_fh(dp, (__u32 *)fh, max_len, 0);
+ } else {
+ fh_type = FILEID_INO32_GEN;
+ fh->i32.ino = dp->d_inode->i_ino;
+ fh->i32.gen = dp->d_inode->i_generation;
+ }
+ dput(dp);
+ return(fh_type);
+}
+#endif
+
int
afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat)
{
osi_InitCacheInfo(char *aname)
{
int code;
+#if defined(LINUX_USE_FH)
+ int max_len = sizeof(struct fid);
+#else
+ extern ino_t cacheInode;
+#endif
struct dentry *dp;
extern ino_t cacheInode;
extern struct osi_dev cacheDev;
if (code)
return ENOENT;
+#if defined(LINUX_USE_FH)
+ if (dp->d_sb->s_export_op->encode_fh) {
+ cacheitems_fh_type = dp->d_sb->s_export_op->encode_fh(dp, (__u32 *)&cacheitems_fh, &max_len, 0);
+ } else {
+ cacheitems_fh_type = FILEID_INO32_GEN;
+ cacheitems_fh.i32.ino = dp->d_inode->i_ino;
+ cacheitems_fh.i32.gen = dp->d_inode->i_generation;
+ }
+#else
cacheInode = dp->d_inode->i_ino;
+#endif
cacheDev.dev = dp->d_inode->i_sb->s_dev;
afs_fsfragsize = dp->d_inode->i_sb->s_blocksize - 1;
afs_cacheSBp = dp->d_inode->i_sb;
usedihint++;
} else
#endif /* IHINT */
-
+#if defined(LINUX_USE_FH)
+ tfile = (struct osi_file *)osi_UFSOpen_fh(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
+#endif
#ifdef AFS_DARWIN80_ENV
trimlen = len;
tuiop = afsio_darwin_partialcopy(auio, trimlen);
rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
tlen = len;
ObtainReadLock(&tdc->lock);
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = osi_UFSOpen(tdc->f.inode);
+#endif
code = afs_osi_Read(tfile, -1, rbuf, tlen);
osi_UFSClose(tfile);
ReleaseReadLock(&tdc->lock);
tdc->f.states |= DWriting;
tdc->dflags |= DFEntryMod;
}
+#if defined(LINUX_USE_FH)
+ tfile = (struct osi_file *)osi_UFSOpen_fh(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
+#endif
len = totalLength; /* write this amount by default */
offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */
afs_int32 fid; /* is adc->index, the cache file number */
afs_inode_t inode; /* is adc->f.inode, the inode number of the cac\
he file */
+#if defined(LINUX_USE_FH)
+ struct fid fh; /* Opaque file handle */
+ int fh_type; /* Opaque file handle type */
+#endif
afs_int32 page;
afs_int32 accesstime;
struct buffer *hashNext;
afs_inode_t inode; /* Unix inode for this chunk */
afs_int32 chunkBytes; /* Num bytes in this chunk */
char states; /* Has this chunk been modified? */
+#if defined(LINUX_USE_FH)
+ struct fid fh; /* File handle */
+ int fh_type; /* File handle type */
+#endif
};
#endif
MReleaseWriteLock(&tb->lock);
return NULL;
}
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&adc->f.fh, adc->f.fh_type);
+#else
tfile = afs_CFileOpen(adc->f.inode);
+#endif
code =
afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data,
AFS_BUFFER_PAGESIZE);
if (lp->dirty) {
/* see DFlush for rationale for not getting and locking the dcache */
- tfile = afs_CFileOpen(lp->inode);
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&lp->fh, lp->fh_type);
+#else
+ tfile = afs_CFileOpen(lp->inode);
+#endif
afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, lp->data,
AFS_BUFFER_PAGESIZE);
lp->dirty = 0;
/* Now fill in the header. */
lp->fid = adc->index;
+#if defined(LINUX_USE_FH)
+ memcpy(&lp->fh, &adc->f.fh, sizeof(struct fid));
+ lp->fh_type = adc->f.fh_type;
+#else
lp->inode = adc->f.inode;
+#endif
lp->page = apage;
lp->accesstime = timecounter++;
FixupBucket(lp); /* move to the right hash bucket */
* we cannot lock afs_xdcache). In addition, we cannot obtain
* a dcache lock while holding the tb->lock of the same file
* since that can deadlock with DRead/DNew */
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&tb->fh, tb->fh_type);
+#else
tfile = afs_CFileOpen(tb->inode);
+#endif
afs_CFileWrite(tfile, tb->page * AFS_BUFFER_PAGESIZE,
tb->data, AFS_BUFFER_PAGESIZE);
tb->dirty = 0; /* Clear the dirty flag */
*/
struct cell_name *afs_cellname_head; /* Export for kdump */
+#if defined(LINUX_USE_FH)
+struct fid afs_cellname_fh;
+int afs_cellname_fh_type;
+static int afs_cellname_fh_set;
+#else
static ino_t afs_cellname_inode;
static int afs_cellname_inode_set;
+#endif
static int afs_cellname_dirty;
static afs_int32 afs_cellnum_next;
* \return 0 for success. < 0 for error.
*/
int
+#if defined(LINUX_USE_FH)
+afs_cellname_init(struct fid *fh, int fh_type, int lookupcode)
+#else
afs_cellname_init(ino_t inode, int lookupcode)
+#endif
{
struct osi_file *tfile;
int cc, off = 0;
return lookupcode;
}
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(fh, fh_type);
+#else
tfile = osi_UFSOpen(inode);
+#endif
if (!tfile) {
ReleaseWriteLock(&afs_xcell);
return EIO;
}
+#if defined(LINUX_USE_FH)
+ memcpy(&afs_cellname_fh, fh, sizeof(struct fid));
+ afs_cellname_fh_type = fh_type;
+ afs_cellname_fh_set = 1;
+#else
afs_cellname_inode = inode;
afs_cellname_inode_set = 1;
+#endif
while (1) {
afs_int32 cellnum, clen, magic;
struct cell_name *cn;
int off;
+#if defined(LINUX_USE_FH)
+ if (!afs_cellname_dirty || !afs_cellname_fh_set)
+#else
if (!afs_cellname_dirty || !afs_cellname_inode_set)
+#endif
return 0;
if (afs_initState != 300)
return 0;
ObtainWriteLock(&afs_xcell, 693);
afs_cellname_dirty = 0;
off = 0;
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&afs_cellname_fh, afs_cellname_fh_type);
+#else
tfile = osi_UFSOpen(afs_cellname_inode);
+#endif
if (!tfile) {
ReleaseWriteLock(&afs_xcell);
return EIO;
#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
void *(*open) (ino_t ainode);
#else
+#if defined(LINUX_USE_FH)
+ void *(*open) (struct fid *fh, int fh_type);
+#else
void *(*open) (afs_int32 ainode);
#endif
+#endif
int (*truncate) (struct osi_file * fp, afs_int32 len);
int (*fread) (struct osi_file * fp, int offset, void *buf, afs_int32 len);
int (*fwrite) (struct osi_file * fp, afs_int32 offset, void *buf,
};
/* Ideally we should have used consistent naming - like COP_OPEN, COP_TRUNCATE, etc. */
+#if defined(LINUX_USE_FH)
+#define afs_CFileOpen(fh, fh_type) (void *)(*(afs_cacheType->open))(fh, fh_type)
+#else
#define afs_CFileOpen(inode) (void *)(*(afs_cacheType->open))(inode)
+#endif
#define afs_CFileTruncate(handle, size) (*(afs_cacheType->truncate))((handle), size)
#define afs_CFileRead(file, offset, data, size) (*(afs_cacheType->fread))(file, offset, data, size)
#define afs_CFileWrite(file, offset, data, size) (*(afs_cacheType->fwrite))(file, offset, data, size)
afs_int32 afs_discardDCCount; /*!< Count of elts in discardDCList */
struct dcache *afs_freeDSList; /*!< Free list for disk slots */
struct dcache *afs_Initial_freeDSList; /*!< Initial list for above */
-ino_t cacheInode; /*!< Inode for CacheItems file */
+#if defined(LINUX_USE_FH)
+struct fid cacheitems_fh;
+int cacheitems_fh_type;
+#else
+ino_t cacheInode; /*!< Inode for CacheItems file */
+#endif
struct osi_file *afs_cacheInodep = 0; /*!< file for CacheItems inode */
struct afs_q afs_DLRU; /*!< dcache LRU */
afs_int32 afs_dhashsize = 1024;
static int afs_UFSCacheFetchProc(), afs_UFSCacheStoreProc();
struct afs_cacheOps afs_UfsCacheOps = {
+#if defined(LINUX_USE_FH)
+ osi_UFSOpen_fh,
+#else
osi_UFSOpen,
+#endif
osi_UFSTruncate,
afs_osi_Read,
afs_osi_Write,
/*
* Truncate the element to reclaim its space
*/
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = afs_CFileOpen(tdc->f.inode);
+#endif
afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile);
afs_AdjustSize(tdc, 0);
afs_stats_cmperf.cacheBlocksDiscarded = afs_blocksDiscarded;
if (lock & 2) {
/* Truncate the chunk so zeroes get filled properly */
+#if defined(LINUX_USE_FH)
+ file = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
file = afs_CFileOpen(tdc->f.inode);
+#endif
afs_CFileTruncate(file, 0);
afs_CFileClose(file);
afs_AdjustSize(tdc, 0);
/* no data in file to read at this position */
UpgradeSToWLock(&tdc->lock, 607);
+#if defined(LINUX_USE_FH)
+ file = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
file = afs_CFileOpen(tdc->f.inode);
+#endif
afs_CFileTruncate(file, 0);
afs_CFileClose(file);
afs_AdjustSize(tdc, 0);
* fetch the whole file.
*/
DZap(tdc); /* pages in cache may be old */
+#if defined(LINUX_USE_FH)
+ file = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
file = afs_CFileOpen(tdc->f.inode);
+#endif
afs_RemoveVCB(&avc->fid);
tdc->f.states |= DWriting;
tdc->dflags |= DFFetching;
struct osi_file *tfile;
struct osi_stat tstat;
register struct dcache *tdc;
+#if defined(LINUX_USE_FH)
+ int max_len = sizeof(struct fid);
+#endif
AFS_STATCNT(afs_InitCacheFile);
index = afs_stats_cmperf.cacheNumEntries;
* UFS file system, and just record the inode number.
*/
#ifdef AFS_LINUX22_ENV
- tdc->f.inode = VTOI(filevp->d_inode)->i_number;
- dput(filevp);
+#if defined(LINUX_USE_FH)
+ tdc->f.fh_type = osi_get_fh(filevp, &tdc->f.fh, &max_len);
+#else
+ tdc->f.inode = VTOI(filevp->d_inode)->i_number;
+#endif
#else
tdc->f.inode = afs_vnodeToInumber(filevp);
AFS_RELE(filevp);
fileIsBad = 0;
if ((tdc->f.states & DWriting) || tdc->f.fid.Fid.Volume == 0)
fileIsBad = 1;
- tfile = osi_UFSOpen(tdc->f.inode);
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&tdc->f.fh, tdc->f.fh_type);
+#else
+ tfile = osi_UFSOpen(ainode);
+#endif
code = afs_osi_Stat(tfile, &tstat);
if (code)
osi_Panic("initcachefile stat");
{
ino_t inode;
int code;
+#if defined(LINUX_USE_FH)
+ struct fid fh;
+ int fh_type;
+ int max_len = sizeof(struct fid);
+ struct dentry *dp;
+#endif
#ifdef AFS_CACHE_VNODE_PATH
return afs_cellname_init(AFS_CACHE_CELLS_INODE, code);
+#elif defined(LINUX_USE_FH)
+ code = gop_lookupname(afile, AFS_UIOSYS, 0, &dp);
+ fh_type = osi_get_fh(dp, &fh, &max_len);
+ return afs_cellname_init(&fh, fh_type, code);
#else
code = LookupInodeByPath(afile, &inode, NULL);
return afs_cellname_init(inode, code);
{
int code;
struct osi_file *tfile;
+#if defined(LINUX_USE_FH)
+ int max_len = sizeof(struct fid);
+ struct dentry *dp;
+#endif
AFS_STATCNT(afs_InitVolumeInfo);
#if defined(AFS_XBSD_ENV)
code = LookupInodeByPath(afile, &volumeInode, &volumeVnode);
#elif defined(AFS_CACHE_VNODE_PATH)
volumeInode = AFS_CACHE_VOLUME_INODE;
+#elif defined(LINUX_USE_FH)
+ code = gop_lookupname(afile, AFS_UIOSYS, 0, &dp);
+ volumeinfo_fh_type = osi_get_fh(dp, &volumeinfo_fh, &max_len);
#else
code = LookupInodeByPath(afile, &volumeInode, NULL);
#endif
if (code)
return code;
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&volumeinfo_fh, volumeinfo_fh_type);
+#else
tfile = afs_CFileOpen(volumeInode);
+#endif
afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile);
return 0;
#endif /* AFS_LINUX20_ENV */
AFS_RELE(filevp);
#endif /* AFS_LINUX22_ENV */
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&cacheitems_fh, cacheitems_fh_type);
+#else
tfile = osi_UFSOpen(cacheInode);
+#endif
afs_osi_Stat(tfile, &tstat);
cacheInfoModTime = tstat.mtime;
code = afs_osi_Read(tfile, -1, &theader, sizeof(theader));
cacheDev.held_vnode = NULL;
}
#endif
+#if !defined(LINUX_USE_FH)
cacheInode = volumeInode = (ino_t) 0;
-
+#endif
cacheInfoModTime = 0;
afs_fsfragsize = 1023;
extern void afs_CellInit(void);
extern void shutdown_cell(void);
+#if defined(LINUX_USE_FH)
+extern int afs_cellname_init(struct fid *fh, int fh_type, int lookupcode);
+#else
extern int afs_cellname_init(ino_t inode, int lookupcode);
+#endif
extern int afs_cellname_write(void);
extern afs_int32 afs_NewCell(char *acellName, afs_int32 * acellHosts,
int aflags, char *linkedcname, u_short fsport,
extern afs_uint32 afs_tpct1, afs_tpct2, splitdcache;
extern unsigned char *afs_indexFlags;
extern struct afs_cacheOps *afs_cacheType;
+#if defined(LINUX_USE_FH)
+extern struct fid cacheitems_fh;
+extern int cacheitems_fh_type;
+#else
extern ino_t cacheInode;
+#endif
extern struct osi_file *afs_cacheInodep;
extern void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
int aflags);
#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
extern void *osi_UFSOpen(ino_t ainode);
#else
+#if defined(LINUX_USE_FH)
+extern void *osi_UFSOpen_fh(struct fid *fh, int fh_type);
+extern int osi_get_fh(struct dentry *dp, struct fid *fh, int *max_len);
+#else
extern void *osi_UFSOpen(afs_int32 ainode);
#endif
+#endif
extern int afs_osi_Stat(register struct osi_file *afile,
register struct osi_stat *astat);
extern int osi_UFSClose(register struct osi_file *afile);
extern afs_int32 afs_volCounter;
extern afs_rwlock_t afs_xvolume;
extern struct volume *afs_volumes[NVOLS];
+#if defined(LINUX_USE_FH)
+extern struct fid volumeinfo_fh;
+extern int volumeinfo_fh_type;
+#else
extern ino_t volumeInode;
+#endif
extern struct volume *afs_FindVolume(struct VenusFid *afid,
afs_int32 locktype);
extern struct volume *afs_freeVolList;
shouldwake = &nomore;
}
}
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = afs_CFileOpen(tdc->f.inode);
+#endif
#ifndef AFS_NOSTATS
xferP =
&(afs_stats_cmfullperf.rpc.
ObtainSharedLock(&tdc->lock, 672);
if (newSize < tdc->f.chunkBytes) {
UpgradeSToWLock(&tdc->lock, 673);
+#if defined(LINUX_USE_FH)
+ tfile = afs_CFileOpen(&tdc->f.fh, tdc->f.fh_type);
+#else
tfile = afs_CFileOpen(tdc->f.inode);
+#endif
afs_CFileTruncate(tfile, newSize);
afs_CFileClose(tfile);
afs_AdjustSize(tdc, newSize);
#endif /* vlserver error base define */
/* Exported variables */
-ino_t volumeInode; /** Inode for VolumeItems file */
+#if defined(LINUX_USE_FH)
+struct fid volumeinfo_fh; /* File handle for VolumeItems file */
+int volumeinfo_fh_type;
+#else
+ino_t volumeInode; /* Inode for VolumeItems file */
+#endif
afs_rwlock_t afs_xvolume; /** allocation lock for volumes */
struct volume *afs_freeVolList;
struct volume *afs_volumes[NVOLS];
* next chain
*/
if (afs_FVIndex != tv->vtix) {
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&volumeinfo_fh, volumeinfo_fh_type);
+#else
tfile = osi_UFSOpen(volumeInode);
+#endif
code =
afs_osi_Read(tfile, sizeof(struct fvolume) * tv->vtix,
&staticFVolume, sizeof(struct fvolume));
staticFVolume.dotdot = tv->dotdot;
staticFVolume.rootVnode = tv->rootVnode;
staticFVolume.rootUnique = tv->rootUnique;
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&volumeinfo_fh, volumeinfo_fh_type);
+#else
tfile = osi_UFSOpen(volumeInode);
+#endif
code =
afs_osi_Write(tfile, sizeof(struct fvolume) * afs_FVIndex,
&staticFVolume, sizeof(struct fvolume));
for (j = fvTable[FVHash(tv->cell, volid)]; j != 0; j = tf->next) {
if (afs_FVIndex != j) {
struct osi_file *tfile;
- tfile = osi_UFSOpen(volumeInode);
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&volumeinfo_fh, volumeinfo_fh_type);
+#else
+ tfile = osi_UFSOpen(volumeInode);
+#endif
err =
afs_osi_Read(tfile, sizeof(struct fvolume) * j,
&staticFVolume, sizeof(struct fvolume));
#ifdef COMPLETION_H_EXISTS
#include <linux/completion.h>
#endif
+#if defined(LINUX_USE_FH)
+#include <linux/exportfs.h>
+#endif
#else /* AFS_LINUX22_ENV */
#if defined(AFS_DARWIN_ENV)
* -2: file exists in top-level
* >=0: file exists in Dxxx
*/
-#ifndef AFS_CACHE_VNODE_PATH
+#if !defined(AFS_CACHE_VNODE_PATH) && !defined(LINUX_USE_FH)
AFSD_INO_T *inode_for_V; /* Array of inodes for desired
* cache files */
#endif
* file's inode, directory, and bump the number of files found
* total and in this directory.
*/
-#ifndef AFS_CACHE_VNODE_PATH
+#if !defined(AFS_CACHE_VNODE_PATH) && !defined(LINUX_USE_FH)
inode_for_V[vFileNum] = currp->d_ino;
#endif
dir_for_V[vFileNum] = dirNum; /* remember this directory */
vFileNum);
else {
struct stat statb;
-#ifndef AFS_CACHE_VNODE_PATH
+#if !defined(AFS_CACHE_VNODE_PATH) && !defined(LINUX_USE_FH)
assert(inode_for_V[vFileNum] == (AFSD_INO_T) 0);
#endif
sprintf(vFilePtr, "D%d/V%d", thisDir, vFileNum);
if (CreateCacheFile(fullpn_VFile, &statb))
printf("%s: Can't create '%s'\n", rn, fullpn_VFile);
else {
-#ifndef AFS_CACHE_VNODE_PATH
+#if !defined(AFS_CACHE_VNODE_PATH) && !defined(LINUX_USE_FH)
inode_for_V[vFileNum] = statb.st_ino;
#endif
dir_for_V[vFileNum] = thisDir;
if (res != 0) {
return "unable to statfs cache base directory";
}
+#if !defined(LINUX_USE_FH)
if (statfsbuf.f_type == 0x52654973) { /* REISERFS_SUPER_MAGIC */
return "cannot use reiserfs as cache partition";
} else if (statfsbuf.f_type == 0x58465342) { /* XFS_SUPER_MAGIC */
} else if (statfsbuf.f_type != 0xEF53) {
return "must use ext2 or ext3 for cache partition";
}
+#endif
}
#endif
cacheStatEntries);
}
-#ifndef AFS_CACHE_VNODE_PATH
+#if !defined(AFS_CACHE_VNODE_PATH) && !defined(LINUX_USE_FH)
/*
* Create and zero the inode table for the desired cache files.
*/
(afs_uint32) (inode_for_V[currVFile] >> 32),
(afs_uint32) (inode_for_V[currVFile] & 0xffffffff));
#else
+#if defined(LINUX_USE_FH)
+ sprintf(fullpn_VFile, "%s/D%d/V%d", cacheBaseDir, dir_for_V[currVFile], currVFile);
+ call_syscall(AFSOP_CACHEFILE, fullpn_VFile);
+#else
call_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]);
#endif
+#endif
}
#endif