When making a Linux fielsystem, what to pass for the user_namespace parameter for inode_init_owner
I'm writing a Linux filesystem driver, and found this code in a tutorial. From there, I came across this modified version of the previous code, which makes it compile on 3.x kernels. However it seems that again the filesystem API has changed, and one of the functions (inode_init_owner
) takes a new parameter. The new signature of this function (in linux/fs.h
) is:
void inode_init_owner(struct user_namespace *mnt_userns, struct inode *inode,
const struct inode *dir, umode_t mode);
This mnt_userns
parameter isn't given in the example code, and I can't seem to find any documentation for t开发者_如何学JAVAhis function online whatsoever. I tried passing NULL
for it, in case it would then just ignore it and revert to previous behaviour, but unsurprisingly this led to a crash (dereferencing NULL pointer).
What should this parameter be set to? What does it even mean? Thanks in advance :)
精彩评论