[PATCH][SAMBA3] allow VFS modules to extend files_struct
James Peach
jpeach at samba.org
Tue Jun 6 02:56:32 GMT 2006
On Mon, 2006-06-05 at 19:00 -0700, Jeremy Allison wrote:
> On Tue, Jun 06, 2006 at 09:04:03AM +1000, James Peach wrote:
> >
> > I'm quite hurt that you would call my code clever :)
> >
> > I've converted 3 modules and this API turns out to be quite nice to
> > use.
> >
> > SMB_OFF_T * last;
> > if ((last = VFS_ADD_FSP_EXTENSION(handle, fsp, SMB_OFF_T)) {
> > /* do stuff */
> > }
> >
> >
> > You don't have to worry about the case where one allocation succeeds but
> > the other fails, and the storage mechanism is completely hidden. I would
> > like to borrow talloc's use of typeof to improve the type-safety,
> > though.
> >
> > Actually, I just realised that I can keep this API, but convert to using
> > a void * and a separate allocation internally. That is,
> > vfs_add_extension_notype would allocate the block and attach it to a
> > data pointer in struct vfs_fsp_data. I'll be happy to make this change
> > if you want, since it contains the multiple allocations in a single
> > place.
>
> Actually you've beaten me down. I can cope with clever code :-).
>
> Thinking about it I'm actually good with whichever you decide on
> this one. Thanks for all your effort on this !
Ok then, I'll commit the clever version for now ...
> > Yep, it's a side-effect of the process. I can explain the gory details
> > offline if you really want to know (it's not that exciting though:)).
>
> Yeah, but you can't check it in like that.... so you're still
> waiting for final approval ?
It's approved, I just can't post personal copyrighted code to the list
unless I can guarantee that it will be committed. There's a race
condition in the agreement :)
--
James Peach | jpeach at samba.org
More information about the samba-technical
mailing list