Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using VFS operations for a given node



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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.