for (tq = VLRU.prev; tq != &VLRU; tq = uq) {
tvc = QTOV(tq);
uq = QPrev(tq);
- nodeid = tvc->f.fid.Fid.Vnode + (tvc->f.fid.Fid.Volume << 16);
- nodeid &= 0x7fffffff;
- qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n", tvc,
+ nodeid = afs_calc_inum(tvc->f.fid.Cell, tvc->f.fid.Fid.Volume,
+ tvc->f.fid.Fid.Vnode);
+ qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %lu(0x%lx)\n", tvc,
tab_vtypes[((vnode_t *) tvc)->v_type],
((vnode_t *) tvc)->v_count,
- (int)VN_GET_PGCNT((vnode_t *) tvc), (int)tvc->mapcnt, nodeid,
- nodeid);
+ (int)VN_GET_PGCNT((vnode_t *) tvc), (int)tvc->mapcnt,
+ (long unsigned)nodeid, (long unsigned)nodeid);
}
AFS_GUNLOCK();
return 0;
* AFS readdir vnodeop and bulk stat support.
*/
-/* Saber C hates negative inode #s. We're not going to talk about software
- * that could fail if it sees a negative inode #.
- */
-#define FIXUPSTUPIDINODE(a) ((a) &= 0x7fffffff)
-
/* BlobScan is supposed to ensure that the blob reference refers to a valid
directory entry. It consults the allocation map in the page header
to determine whether a blob is actually in use or not.
if (use64BitDirent) {
struct min_dirent sdirEntry;
- sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode);
- FIXUPSTUPIDINODE(sdirEntry.d_fileno);
+ sdirEntry.d_fileno = afs_calc_inum(vc->f.fid.Cell,
+ Volume, ntohl(Vnode));
sdirEntry.d_reclen = rlen;
sdirEntry.d_off = (off_t) off;
AFS_UIOMOVE(&sdirEntry, AFS_DIRENT64BASESIZE, UIO_READ, auio,
}
} else {
struct irix5_min_dirent sdirEntry;
- sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode);
- FIXUPSTUPIDINODE(sdirEntry.d_fileno);
+ sdirEntry.d_fileno = afs_calc_inum(vc->f.fid.Cell,
+ Volume, ntohl(Vnode));
sdirEntry.d_reclen = rlen;
sdirEntry.d_off = (afs_int32) off;
AFS_UIOMOVE(&sdirEntry, AFS_DIRENT32BASESIZE, UIO_READ, auio,
#else
direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
#endif
- direntp->d_ino = (Volume << 16) + ntohl(Vnode);
- FIXUPSTUPIDINODE(direntp->d_ino);
+ direntp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
direntp->d_offset = off;
direntp->d_namlen = slen;
osi_FreeLargeSpace((char *)direntp);
#else /* AFS_SUN5_ENV */
/* Note the odd mechanism for building the inode number */
- sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode);
- FIXUPSTUPIDINODE(sdirEntry.d_fileno);
+ sdirEntry.d_fileno = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
sdirEntry.d_reclen = rlen;
#if !defined(AFS_SGI_ENV)
sdirEntry.d_namlen = slen;
struct dirent *dp;
dp = osi_AllocLargeSpace(sizeof(struct dirent));
memset(dp, 0, sizeof(struct dirent));
- dp->d_ino = (Volume << 16) + ntohl(Vnode);
- FIXUPSTUPIDINODE(dp->d_ino);
+ dp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
dp->d_namlen = slen;
dp->d_type = afs_readdir_type(vc, de);
strcpy(dp->d_name, de->name);
if (len) {
/* something to hand over. */
#ifdef AFS_HPUX_ENV
- sdirEntry->d_fileno =
- (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
- FIXUPSTUPIDINODE(sdirEntry->d_fileno);
+ sdirEntry->d_fileno = afs_calc_inum(avc->f.fid.Cell,
+ avc->f.fid.Fid.Volume,
+ ntohl(ode->fid.vnode));
sdirEntry->d_reclen = rlen = AFS_UIO_RESID(auio);
sdirEntry->d_namlen = o_slen;
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
DRelease(&nextEntry, 0); /* can't use this one. */
if (len) {
#ifdef AFS_HPUX_ENV
- sdirEntry->d_fileno =
- (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
- FIXUPSTUPIDINODE(sdirEntry->d_fileno);
+ sdirEntry->d_fileno = afs_calc_inum(avc->f.fid.Cell,
+ avc->f.fid.Fid.Volume,
+ ntohl(ode->fid.vnode));
sdirEntry->d_reclen = rlen = AFS_UIO_RESID(auio);
sdirEntry->d_namlen = o_slen;
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
*/
if (len) {
#ifdef AFS_HPUX_ENV
- sdirEntry->d_fileno =
- (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
- FIXUPSTUPIDINODE(sdirEntry->d_fileno);
+ sdirEntry->d_fileno = afs_calc_inum(avc->f.fid.Cell,
+ avc->f.fid.Fid.Volume,
+ ntohl(ode->fid.vnode));
sdirEntry->d_reclen = rlen = len;
sdirEntry->d_namlen = o_slen;
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)