kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Modifying the filesystem code
@ 2010-12-29 20:21 dinesh bhaskar
  2010-12-29 20:36 ` Manish Katiyar
  0 siblings, 1 reply; 5+ messages in thread
From: dinesh bhaskar @ 2010-12-29 20:21 UTC (permalink / raw)
  To: kernelnewbies

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.


Thanks in advance
Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101229/922e2ad7/attachment.html 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Modifying the filesystem code
  2010-12-29 20:21 dinesh bhaskar
@ 2010-12-29 20:36 ` Manish Katiyar
  2010-12-29 21:13   ` dinesh bhaskar
  0 siblings, 1 reply; 5+ messages in thread
From: Manish Katiyar @ 2010-12-29 20:36 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Dec 29, 2010 at 12:21 PM, dinesh bhaskar <pdineshb@gmail.com> wrote:
> 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.

Sorry, but your question is not clear to me. Perhaps rephrasing it
(with an example) will be better.


-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Modifying the filesystem code
  2010-12-29 20:36 ` Manish Katiyar
@ 2010-12-29 21:13   ` dinesh bhaskar
  0 siblings, 0 replies; 5+ messages in thread
From: dinesh bhaskar @ 2010-12-29 21:13 UTC (permalink / raw)
  To: kernelnewbies

Manish,

On Wed, Dec 29, 2010 at 3:36 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:

> On Wed, Dec 29, 2010 at 12:21 PM, dinesh bhaskar <pdineshb@gmail.com>
> wrote:
> > 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.
>
> Sorry, but your question is not clear to me. Perhaps rephrasing 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
> ==================================
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101229/f5a031f3/attachment-0001.html 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Modifying the filesystem code
@ 2010-12-30  5:52 dinesh bhaskar
  2010-12-30  6:41 ` Rajat Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: dinesh bhaskar @ 2010-12-30  5:52 UTC (permalink / raw)
  To: kernelnewbies

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101230/24318746/attachment.html 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Modifying the filesystem code
  2010-12-30  5:52 Modifying the filesystem code dinesh bhaskar
@ 2010-12-30  6:41 ` Rajat Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Rajat Sharma @ 2010-12-30  6:41 UTC (permalink / raw)
  To: kernelnewbies

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@gmail.com> 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 at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-30  6:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-30  5:52 Modifying the filesystem code dinesh bhaskar
2010-12-30  6:41 ` Rajat Sharma
  -- strict thread matches above, loose matches on Subject: below --
2010-12-29 20:21 dinesh bhaskar
2010-12-29 20:36 ` Manish Katiyar
2010-12-29 21:13   ` dinesh bhaskar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).