Cleanly determining in a VFS function that it was called in the context of CREATE

Richard Sharpe realrichardsharpe at gmail.com
Tue Feb 2 17:37:09 UTC 2016


Hi folks,

For an on-line migration thing I am working on I need to cleanly
determine in a VFS function like mywrapped_stat that I was called in
the context of CREATE.

This is because Samba calls SMB_VFS_STAT with gay abandon ...

If I hook stat in the right place, there is no extra cost in the
common case (the file being present) and all the cost goes into the
error path and the uncommon case of the file needing to be migrated.

Now, one way I can think to do this is to add a PRE_CREATE VFS call
that is called before Samba calls filename_convert so that I can stash
some info away.

Is there another way that is clean?

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list