Manoj Sati(deleted)
|
io_mknod callout in resource manager and differentiating between mkdir() and mknod()
|
Manoj Sati(deleted)
11/26/2014 12:34 AM
post112439
|
io_mknod callout in resource manager and differentiating between mkdir() and mknod()
I am implementing a resource manager for my mount point on the file system.
As part of that, I have specified a callout for mknod() as follows:
resmgr_connect_funcs_t connect_funcs;
connect_funcs.mknod = io_mknod;
and the mknod callout is defined as:
int io_mknod(resmgr_context_t *ctp, io_mknod_t *msg, RESMGR_HANDLE_T *handle, void *reserved);
in this callout, io_mknod() how do I differentiate between a client call to mknod() and a client call to mkdir().
Empirical observations led me to assume that when the mode value is 16384, the callout was invoked for a client call to
mknod() and when the mode value is 16877, the callout was invoked for a client call to mkdir(). So my code becomes
something like this:
int io_mknod(resmgr_context_t *ctp, io_mknod_t *msg, RESMGR_HANDLE_T *handle, void *reserved)
{
if( msg->connect.mode == 16877)
// we got called for mkdir()
else
// we got called for mknod()
}
Is there any other way to differentiate? I have not been able to reconcile these values (16384 or 16877) to any ORing of
constants in the header files.
Thanks,
ms
|
|
|