tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Vnode API change: mnt_vnodelist traversal



On Mar 3, 2014, at 4:11 PM, Taylor R Campbell 
<campbell+netbsd-tech-kern%mumble.net@localhost> wrote:

>   Date: Mon, 3 Mar 2014 15:55:16 +0100
>   From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
> 
>   On Mar 3, 2014, at 3:28 PM, Taylor R Campbell 
> <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
> 
>> /* mount.h */
>> struct vnode_iterator; /* opaque */
>> 
>> void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **vip);
>> void vfs_vnode_iterator_destroy(struct vnode_iterator *vi);
>> bool vfs_vnode_iterator_next(struct vnode_iterator *vi, struct vnode **vpp);
>> 
>> /* vfs_mount.c */
>> struct vnode_iterator {
>>      struct vnode vi_vnode;
>> };
> 
>   No.  I want to keep the state opaque to the caller.  There is no need for
>   the calling party to know anything about state internals.
> 
> That is exactly what I was going for, except with a typed pointer
> instead of a void pointer.

Please explain in more detail why you prefer a typed pointer over a void
pointer for opaque data.  What is the benefit?

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)



Home | Main Index | Thread Index | Old Index