2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * System independent part of vget VFS call.
14 #include <afsconfig.h>
15 #include "../afs/param.h"
19 #include "../afs/sysincludes.h" /* Standard vendor system headers */
20 #include "../afs/afsincludes.h" /* Afs-based standard headers */
21 #include "../afs/afs_stats.h" /* statistics stuff */
25 #if !defined(AFS_LINUX20_ENV)
26 /* This is the common part of the vget VFS call. */
27 int afs_osi_vget(struct vcache **avcpp, struct fid *afidp,
28 struct vrequest *areqp)
32 register struct cell *tcell;
34 register afs_int32 code = 0, cellindex;
37 memcpy((char *)&Sfid, afidp->fid_data, SIZEOF_SMALLFID);
39 Sfid.Vnode = afidp->fid_reserved;
42 /* Need to extract fid from SmallFid. Will need a wild card option for
43 * finding the right vcache entry.
45 cellindex = (Sfid.CellAndUnique >> 24) & 0xff;
46 tcell = afs_GetCellByIndex(cellindex, READ_LOCK);
49 vfid.Cell = tcell->cellNum;
50 afs_PutCell(tcell, WRITE_LOCK);
51 vfid.Fid.Volume = Sfid.Volume;
52 vfid.Fid.Vnode = Sfid.Vnode;
53 vfid.Fid.Unique = Sfid.CellAndUnique & 0xffffff;
55 /* First attempt to find in cache using wildcard. If that fails,
56 * try the usual route to try to get the vcache from the server.
57 * This could be done better by splitting out afs_FindVCache from
61 ret = afs_NFSFindVCache(avcpp, &vfid);
63 /* More than one entry matches. */
67 /* didn't find an entry. */
68 *avcpp = afs_GetVCache(&vfid, &treq, NULL, NULL);
76 #endif /* AFS_LINUX20_ENV */