Using VFS operations for a given node
Using VFS operations for a given node
- Subject: Using VFS operations for a given node
- From: "Standard Azi" <email@hidden>
- Date: Tue, 24 Jul 2007 10:04:42 +0200
Hello!
I've noticed, that operations related to a given filesystem are
handled via an array of function pointers named `v_op'.
I am now wondering, what's the best way to reference this array. I'd
like to use the `getxattr()' function within a kernel extension. As
I'm unable to use v_op, I've tried to find a "general" function for
`getxattr()'. After a bit of exploration, I've found :
`vn_getxattr()' which seems the right thing to use. This is how I've
tried to use it :
====
#include <mach/mach_types.h>
#include <libkern/libkern.h>
#include <libkern/OSAtomic.h>
#include <libkern/OSMalloc.h>
#include <sys/sysctl.h>
#include <sys/kauth.h>
#include <sys/vnode.h>
#include <sys/xattr.h>
/* .... */
char val[VAL_SIZE];
if ( vn_getxattr( (vnode_t)vn, KEY_NAME, val, VAL_SIZE, 0, NULL) == -1) {
/* .... */
====
The build succeeds, but trying to load the module fails due to linking errors :
===
kld(): Undefined symbols:
_vn_getxattr
kextload: kld_load_from_memory() failed for module
/Users/marco/vnode_example/build/Release/vnode_example.kext/Contents/MacOS/vnode_example
===
I'm now wondering what have I missed. What would be the best way to
access VFS operations given a valid vnode?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden