[OpenAFS-devel] Error of VGetVolume() call in venus/fs.c

xianwei zhang cinwell.chang@gmail.com
Mon, 9 Apr 2012 13:47:34 -0400


--14dae9340ddbebdf4c04bd4299a7
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Currently I am doing a small project on OpenAFS. Now, I am planning to read
the Vnode associated with a file. My idea is let user enter the command 'fs
getvnode FILE_NAME'
to view the vnode (status) information:
(1) user enters 'fs getvnode /afs'
(2) first get the fid for that file and then use the fid to get the vnode

while for (1) response is in the file /venus/fs.c, the function to get
vnode is implemented in file /vol/vnode.c. I want to call the VGetVnode()
in fs.c. But
I always failed to make the modified codes. Error is:
/openafs-1.4.14/lib/vlib.a(volume.o): In function 'VReleaseVolumeHandles_r':
/openafs-1.4.14/src/vol/volume.c: 1235: undefined reference to
'DFlushVolume'
/openafs-1.4.14/lib/vlib.a(volume.o): In function 'VCloseVolumeHandles_r':
/openafs-1.4.14/src/vol/volume.c: 1323: undefined reference to
'DFlushVolume'

My modifications are:
(1) include more headers:
#include <afs/ihandle.h>
#include <afs/nfs.h>
#include <afs/vnode.h>
#include <afs/volume.h>
#include <afs/dir.h>

(2) within the method GetFidCmd() I added two lines with the if(0 ==
pioctl(ti->data, VIOCGETFID, &blob, 1))
int errorCode;
Volume * vol = VGetVolume(&errorCode, (afs_int32)vfid.Fid.Volume);

I didn't change the Makefile since seems no need to change that.

I am a newbie to OpenAFS and C, plz help me to solve this silly question.
Or, better idea to achieve this?

Regards,

--14dae9340ddbebdf4c04bd4299a7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">Hi,<div><br></div><div>Currently I am doing a sm=
all project on OpenAFS. Now, I am planning to read the Vnode associated wit=
h a file. My idea is let user enter the command &#39;fs getvnode FILE_NAME&=
#39;=A0</div>
<div>to view the vnode (status) information:=A0</div>
<div>(1) user enters &#39;fs getvnode /afs&#39;</div><div>(2) first get the=
 fid for that file and then use the fid to get the vnode</div>
<div><br></div><div>while for (1) response is in the file /venus/fs.c, the =
function to get vnode is implemented in file /vol/vnode.c. I want to call t=
he VGetVnode() in fs.c. But</div><div>I always failed to make the modified =
codes. Error is:</div>


<div>/openafs-1.4.14/lib/vlib.a(volume.o): In function &#39;VReleaseVolumeH=
andles_r&#39;:</div><div>/openafs-1.4.14/src/vol/volume.c: 1235: undefined =
reference to &#39;DFlushVolume&#39;</div><div><div>/openafs-1.4.14/lib/vlib=
.a(volume.o): In function &#39;VCloseVolumeHandles_r&#39;:</div>

<div>/openafs-1.4.14/src/vol/volume.c: 1323: undefined reference to &#39;DF=
lushVolume&#39;</div></div><div><br></div><div>My modifications are:</div><=
div>(1) include more headers:</div><div>#include &lt;afs/ihandle.h&gt;</div=
>

<div>#include &lt;afs/nfs.h&gt;</div><div>#include &lt;afs/vnode.h&gt;</div=
><div>#include &lt;afs/volume.h&gt;</div><div>#include &lt;afs/dir.h&gt;</d=
iv><div><br></div><div>(2) within the method GetFidCmd() I added two lines =
with the if(0 =3D=3D pioctl(ti-&gt;data, VIOCGETFID, &amp;blob, 1))</div>

<div>int errorCode;</div><div>Volume * vol =3D VGetVolume(&amp;errorCode, (=
afs_int32)vfid.Fid.Volume);</div><div><br></div><div>I didn&#39;t change th=
e Makefile since seems no need to change that.</div><div><br></div><div>
I am a newbie to OpenAFS and C, plz help me to solve this silly question. O=
r, better idea to achieve this?</div>
<div><br></div><div>Regards,</div><div><br></div><div><br></div>
</div><br>

--14dae9340ddbebdf4c04bd4299a7--