On 07/29/14 13:18, Mark Tinguely wrote:
On 07/29/14 12:31, Eric Sandeen wrote:
I was cleaning up xfsprogs to plug some leaks, and wanted to use
jdm_delete_filehandle(). I noticed that it has an "hlen" argument which
Can we remove that, or is this part of a public API? It's not in any
manpage (or even called anywhere in xfsprogs/xfstests/xfsdump/dmapi)
but it is in a public header...
If needed I guess I can just call it with hlen==0, but that seems odd.
The first thing that comes to mind is maybe they trying to distinguish
between a fshandle or handle. Or they we trying to be consistent with
the allocation calls.
The libhandle free_handle has the same calling parameters. It also does
nothing with the length. That we cannot change without breaking existing
I will look/ask around.
Looks like the code is pretty sloppy with freeing the handles.
Best guess is jdm_delete_filehandle() and free_handle are trying to
keep the API similar to DMAPI. The DMAPI handle free routine,
dm_handle_free(), also has a second length parameter that is not used in
The code example that I saw are similar to the use in xfsdump, where the
length used in the free comes from the handle creation/conversion routine.
Since the xfsprogs do not open handles with calls that provide a length.
How about FSHANDLE_SZ and FILEHANDLE_SZ depending on if it is a
xfs_fshandle or xfs_handle?