Dinesh, I think it would be better if you can describe our aim of the task in plain English without any technical details. May be people can suggest you an altogether better approach, because its getting hard to know what exactly you want to do, is it mkdir or create or both you are interested in? If every creation has to be prefixed, may be you don't have to even change any of inode operations. In short, just come up with our aim statement in plain English. Rajat On Thu, Dec 30, 2010 at 11:22 AM, dinesh bhaskar <pdineshb@xxxxxxxxx> wrote: > > Hello all, > > I am working on ramfs filesystem code. I would like to modify the directory > path while creating the file. > example when we give mkdir newfile; // this newfile should be present in > /newlabel/newfile > // Assuming ramfs is mounted at /, newlabel is > prefixed before the newfile > > So i am trying to modify the functions defined in the struct > inode_operations for the directory. > > static const struct inode_operations ramfs_dir_inode_operations = { > .create = ramfs_create, > .lookup = simple_lookup, > .link = simple_link, > .unlink = simple_unlink, > .symlink = ramfs_symlink, > .mkdir = ramfs_mkdir, > .rmdir = simple_rmdir, > .mknod = ramfs_mknod, //Modifying this function to add the prefix > to the file > .rename = simple_rename, > }; > is it possible? > > Let me know if I am doing something wrong. > > > Thanks > Dinesh > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@xxxxxxxxxxxxxxxxx > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies