On Wed, Dec 29, 2010 at 3:36 PM, Manish Katiyar <mkatiyar@xxxxxxxxx> wrote:
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
// 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,
};
Let me know if I am doing something wrong
Thanks
Dinesh
On Wed, Dec 29, 2010 at 12:21 PM, dinesh bhaskar <pdineshb@xxxxxxxxx> wrote:Sorry, but your question is not clear to me. Perhaps rephrasing it
> Hello All,
>
> I am trying to modify the path of the file while creating it. I was
> modifying the mkdir function pointer in the inode_operations structure. Not
> sure how to give the specific path to the file while creating it.
(with an example) will be better.
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
// 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,
};
Let me know if I am doing something wrong
Thanks
Dinesh
--
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies