[OpenAFS-devel] OpenBSD 4.2 and OpenAFS?

Matthew Schlegel nite97m@gmail.com
Fri, 28 Dec 2007 20:13:03 -0600


------=_Part_15602_29895142.1198894384007
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I don't suppose you might know what some of the side effects of that might
be for a server?

I'll give that a try and see how it looks.
Thank you,
Matthew

On Dec 28, 2007 7:15 PM, Jim Rees <rees@umich.edu> wrote:

> Matthew Schlegel wrote:
>
>  I'm working on getting OpenAFS to compile on OpenBSD 4.2 and I'm
> currently
>  stumped by the following errors:
>
> I'm afraid the OpenBSD vnode locking has changed in 4.2, probably for SMP.
> The fix will require looking at the new code and figuring out what
> changed.
> I usually do this by looking at what they changed in the nfs client, and
> trying to apply the same changes to OpenBSD.  I may eventually get around
> to
> doing this but it won't be any time soon.
>
> If you are feeling adventurous, you could try something like this:
>
> Index: osi_vnodeops.c
> ===================================================================
> RCS file: /cvs/openafs/src/afs/OBSD/osi_vnodeops.c,v
> retrieving revision 1.20
> diff -u -r1.20 osi_vnodeops.c
> --- osi_vnodeops.c      9 Mar 2006 15:27:17 -0000       1.20
> +++ osi_vnodeops.c      29 Dec 2007 01:13:28 -0000
> @@ -189,8 +189,8 @@
>     {&vop_abortop_desc, vop_generic_abortop},  /* abortop */
>     {&vop_inactive_desc, afs_nbsd_inactive},   /* inactive */
>     {&vop_reclaim_desc, afs_nbsd_reclaim},     /* reclaim */
> -    {&vop_lock_desc, afs_nbsd_lock},           /* lock */
> -    {&vop_unlock_desc, afs_nbsd_unlock},       /* unlock */
> +    {&vop_lock_desc, ((int (*)(void *))vop_generic_lock)},     /* lock */
> +    {&vop_unlock_desc, ((int (*)(void *))vop_generic_unlock)}, /* unlock
> */
>     {&vop_bmap_desc, afs_nbsd_bmap},           /* bmap */
>     {&vop_strategy_desc, afs_nbsd_strategy},   /* strategy */
>     {&vop_print_desc, afs_nbsd_print},         /* print */
> @@ -921,40 +921,6 @@
>  }
>
>  int
> -afs_nbsd_lock(void *v)
> -{
> -    struct vop_lock_args       /* {
> -                                * struct vnode *a_vp;
> -                                * int a_flags;
> -                                * sturct proc *a_p;
> -                                * } */ *ap = v;
> -    struct vnode *vp = ap->a_vp;
> -    struct vcache *vc = VTOAFS(vp);
> -
> -    if (!vc)
> -       panic("afs_nbsd_lock: null vcache");
> -    return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE,
> &vp->v_interlock,
> -                  ap->a_p);
> -}
> -
> -int
> -afs_nbsd_unlock(void *v)
> -{
> -    struct vop_unlock_args     /* {
> -                                * struct vnode *a_vp;
> -                                * int a_flags;
> -                                * struct proc *a_p;
> -                                * } */ *ap = v;
> -    struct vnode *vp = ap->a_vp;
> -    struct vcache *vc = VTOAFS(vp);
> -
> -    if (!vc)
> -       panic("afs_nbsd_unlock: null vcache");
> -    return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE,
> &vp->v_interlock,
> -                  ap->a_p);
> -}
> -
> -int
>  afs_nbsd_bmap(void *v)
>  {
>     struct vop_bmap_args       /* {
>



-- 
Matthew
http://www.schlegelhome.info

------=_Part_15602_29895142.1198894384007
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I don&#39;t suppose you might know what some of the side effects of that might be for a server?<br><br>I&#39;ll give that a try and see how it looks.<br>Thank you,<br>Matthew<br><br><div class="gmail_quote">On Dec 28, 2007 7:15 PM, Jim Rees &lt;
<a href="mailto:rees@umich.edu">rees@umich.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Matthew Schlegel wrote:
<br><br> &nbsp;I&#39;m working on getting OpenAFS to compile on OpenBSD 4.2 and I&#39;m currently<br> &nbsp;stumped by the following errors:<br><br></div>I&#39;m afraid the OpenBSD vnode locking has changed in 4.2, probably for SMP.
<br>The fix will require looking at the new code and figuring out what changed.<br>I usually do this by looking at what they changed in the nfs client, and<br>trying to apply the same changes to OpenBSD. &nbsp;I may eventually get around to
<br>doing this but it won&#39;t be any time soon.<br><br>If you are feeling adventurous, you could try something like this:<br><br>Index: osi_vnodeops.c<br>===================================================================
<br>RCS file: /cvs/openafs/src/afs/OBSD/osi_vnodeops.c,v<br>retrieving revision 1.20<br>diff -u -r1.20 osi_vnodeops.c<br>--- osi_vnodeops.c &nbsp; &nbsp; &nbsp;9 Mar 2006 15:27:17 -0000 &nbsp; &nbsp; &nbsp; 1.20<br>+++ osi_vnodeops.c &nbsp; &nbsp; &nbsp;29 Dec 2007 01:13:28 -0000
<br>@@ -189,8 +189,8 @@<br> &nbsp; &nbsp; {&amp;vop_abortop_desc, vop_generic_abortop}, &nbsp;/* abortop */<br> &nbsp; &nbsp; {&amp;vop_inactive_desc, afs_nbsd_inactive}, &nbsp; /* inactive */<br> &nbsp; &nbsp; {&amp;vop_reclaim_desc, afs_nbsd_reclaim}, &nbsp; &nbsp; /* reclaim */
<br>- &nbsp; &nbsp;{&amp;vop_lock_desc, afs_nbsd_lock}, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* lock */<br>- &nbsp; &nbsp;{&amp;vop_unlock_desc, afs_nbsd_unlock}, &nbsp; &nbsp; &nbsp; /* unlock */<br>+ &nbsp; &nbsp;{&amp;vop_lock_desc, ((int (*)(void *))vop_generic_lock)}, &nbsp; &nbsp; /* lock */<br>+ &nbsp; &nbsp;{&amp;vop_unlock_desc, ((int (*)(void *))vop_generic_unlock)}, /* unlock */
<br> &nbsp; &nbsp; {&amp;vop_bmap_desc, afs_nbsd_bmap}, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* bmap */<br> &nbsp; &nbsp; {&amp;vop_strategy_desc, afs_nbsd_strategy}, &nbsp; /* strategy */<br> &nbsp; &nbsp; {&amp;vop_print_desc, afs_nbsd_print}, &nbsp; &nbsp; &nbsp; &nbsp; /* print */<br>@@ -921,40 +921,6 @@
<br>&nbsp;}<br><br>&nbsp;int<br>-afs_nbsd_lock(void *v)<br>-{<br>- &nbsp; &nbsp;struct vop_lock_args &nbsp; &nbsp; &nbsp; /* {<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* struct vnode *a_vp;<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* int a_flags;<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* sturct proc *a_p;
<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* } */ *ap = v;<br>- &nbsp; &nbsp;struct vnode *vp = ap-&gt;a_vp;<br>- &nbsp; &nbsp;struct vcache *vc = VTOAFS(vp);<br>-<br>- &nbsp; &nbsp;if (!vc)<br>- &nbsp; &nbsp; &nbsp; panic(&quot;afs_nbsd_lock: null vcache&quot;);<br>- &nbsp; &nbsp;return afs_osi_lockmgr(&amp;vc-&gt;rwlock, ap-&gt;a_flags | LK_CANRECURSE, &amp;vp-&gt;v_interlock,
<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ap-&gt;a_p);<br>-}<br>-<br>-int<br>-afs_nbsd_unlock(void *v)<br>-{<br>- &nbsp; &nbsp;struct vop_unlock_args &nbsp; &nbsp; /* {<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* struct vnode *a_vp;<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* int a_flags;
<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* struct proc *a_p;<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* } */ *ap = v;<br>- &nbsp; &nbsp;struct vnode *vp = ap-&gt;a_vp;<br>- &nbsp; &nbsp;struct vcache *vc = VTOAFS(vp);<br>-<br>- &nbsp; &nbsp;if (!vc)<br>- &nbsp; &nbsp; &nbsp; panic(&quot;afs_nbsd_unlock: null vcache&quot;);
<br>- &nbsp; &nbsp;return afs_osi_lockmgr(&amp;vc-&gt;rwlock, ap-&gt;a_flags | LK_RELEASE, &amp;vp-&gt;v_interlock,<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ap-&gt;a_p);<br>-}<br>-<br>-int<br>&nbsp;afs_nbsd_bmap(void *v)<br>&nbsp;{<br> &nbsp; &nbsp; struct vop_bmap_args &nbsp; &nbsp; &nbsp; /* {
<br></blockquote></div><br><br clear="all"><br>-- <br>Matthew<br><a href="http://www.schlegelhome.info">http://www.schlegelhome.info</a>

------=_Part_15602_29895142.1198894384007--