Hello ppl,

How can i create a subdirectory using the parent directory's dentry
object ?

I followed this approach, which did not work.

                struct qstr name;
                char *tmp;
                struct dentry *dentry;
                tmp = (char *) kmalloc(6,GFP_KERNEL);
                strcpy(tmp,"HELLO");
                name.name = tmp;
                name.len=5;
                dentry = d_alloc(parent_dentry,&name);
                vfs_mkdir(parent_dentry->d_inode,dentry,493);

This code does not cause any OOPS. but, the new directory simply fails
to show up. What is wrong in my approach here ?

One more thing. I noticed that there is a field called hash in struct
qstr. I guessed that the d_hash method of the dentry_operations need to
be used. But when i tried using it, it gave me segfault, as the d_op
field of the dentry was NULL. Won't  VFS provide a default hash function in
case the file system does not proivde one ?

Thank you.

-- 
regards,
balaji rao

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to