Timothy R. Chavez
2005-03-23 20:22:46 UTC
This is the latest patch. Quite a bit has changed and a lot more of the complexity has been stripped away. I've added back the hooks for d_instantiate() and d_splice_alias() for good form and rethought the positioning of the d_move() hooks. Also, I've done quite a bit with the locking. Now, [admittedly] I'm a novice, so the reader-writer locking stradegy I've used is probably not the best for performance -- especially since I've hooked __d_lookup() and will hit a write_lock() when I enter audit_attach_watch() (formly called audit_watch()).
Perhaps the locking can eventually change to using RCU and what not, but I'm pressed for time and have limited knowledge.
To save space in the inode struct, I've kept the i_audit as a pointer, rather then statically allocating memory for it. Now, all inode's get i_audit data allocated to them upon creation, and freed upon deletion. Is it reasonable to keep it this way? I am using kmalloc for this allocation, so I do believe I'm still wasting space, but I suppose I can change this back to audit_data slab allocations -- I just didn't know of a good way of creating the cache outside of the audit_inode_alloc() function itself.
I'll get cracking on the "list all watches" feature.
This is a patch against 2.6.11 for immediate gratification (and testing). David, I'll try to get you a patch to the the bitkeeper tree asap.