How to write/copy kernel data in newly allocated cache page? - Help
This is a discussion on How to write/copy kernel data in newly allocated cache page? - Help ; Hi all,
While working at the kernel level, I want to write some data to the
file without user knowing about it.
I guess I can allocate a new page using "__grab_cache_page()" and
write/copy that data to the newly allocated ...
-
How to write/copy kernel data in newly allocated cache page?
Hi all,
While working at the kernel level, I want to write some data to the
file without user knowing about it.
I guess I can allocate a new page using "__grab_cache_page()" and
write/copy that data to the newly allocated page. The page will be
eventually written to the file.
If this idea sounds practical, how do I write/copy the data at kernel
level to that newly allocated page?
Vineet
-
Re: How to write/copy kernel data in newly allocated cache page?
Vineet Joglekar wrote:
>
> Hi all,
>
> While working at the kernel level, I want to write some data to the
> file without user knowing about it.
> I guess I can allocate a new page using "__grab_cache_page()" and
> write/copy that data to the newly allocated page. The page will be
> eventually written to the file.
I don't think you should allocate the page. You should
make sure the page is in page cache, and modify it there.
Are you going to overwrite every byte of that page? Or
are you only going to modify parts of the page?
FUT: cold.system
--
Kasper Dupont -- der bruger for meget tid paa usenet.
For sending spam use abuse@mk.lir.dk and kasperd@mk.lir.dk
I'd rather be a hammer than a nail.
-
Re: How to write/copy kernel data in newly allocated cache page?
I guess I will not need the whole page. just a part of it will do..
can u please tell me how to modify it? that is, how to write/copy the
data I wanted in it?
Thanx and regards,
Vineet
Kasper Dupont wrote in message
news:<40ACF0D7.E20884F@daimi.au.dk>...
> Vineet Joglekar wrote:
> >
> > Hi all,
> >
> > While working at the kernel level, I want to write some data to the
> > file without user knowing about it.
> > I guess I can allocate a new page using "__grab_cache_page()" and
> > write/copy that data to the newly allocated page. The page will be
> > eventually written to the file.
>
> I don't think you should allocate the page. You should
> make sure the page is in page cache, and modify it there.
>
> Are you going to overwrite every byte of that page? Or
> are you only going to modify parts of the page?
>
> FUT: cold.system