* [Ocfs2-devel] Cleancache [PATCH 2/7] (was Transcendent Memory): core files
[not found] <20100422132809.GA27302@ca-server1.us.oracle.com>
@ 2010-05-14 23:18 ` Al Viro
2010-05-24 20:04 ` Dan Magenheimer
0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2010-05-14 23:18 UTC (permalink / raw)
To: Dan Magenheimer
Cc: chris.mason, akpm, adilger, tytso, mfasheh, joel.becker, matthew,
linux-btrfs, linux-kernel, linux-fsdevel, linux-ext4, ocfs2-devel,
linux-mm, ngupta, jeremy, JBeulich, kurt.hackel, npiggin,
dave.mccracken, riel
On Thu, Apr 22, 2010 at 06:28:09AM -0700, Dan Magenheimer wrote:
> +struct cleancache_ops {
> + int (*init_fs)(unsigned long);
unsigned long? Really? Not even size_t?
> + int (*init_shared_fs)(char *uuid, unsigned long);
Ditto.
> + int (*get_page)(int, unsigned long, unsigned long, struct page *);
Ugh. First of all, presumably you have some structure behind that index,
don't you? Might be a better way to do it.
What's more, use of ->i_ino is simply wrong. How stable do you want that
to be and how much do you want it to outlive struct address_space in question?
From my reading of your code, it doesn't outlive that anyway, so...
The third one is pgoff_t; again, use sane types, _if_ you actually want
the argument #3 at all - it can be derived from struct page you are passing
there as well.
> + int (*put_page)(int, unsigned long, unsigned long, struct page *);
> + int (*flush_page)(int, unsigned long, unsigned long);
> + int (*flush_inode)(int, unsigned long);
> + void (*flush_fs)(int);
Same questions as above...
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] Cleancache [PATCH 2/7] (was Transcendent Memory): core files
2010-05-14 23:18 ` [Ocfs2-devel] Cleancache [PATCH 2/7] (was Transcendent Memory): core files Al Viro
@ 2010-05-24 20:04 ` Dan Magenheimer
2010-05-25 2:16 ` Dan Magenheimer
0 siblings, 1 reply; 3+ messages in thread
From: Dan Magenheimer @ 2010-05-24 20:04 UTC (permalink / raw)
To: Al Viro
Cc: chris.mason, akpm, adilger, tytso, mfasheh, joel.becker, matthew,
linux-btrfs, linux-kernel, linux-fsdevel, linux-ext4, ocfs2-devel,
linux-mm, ngupta, jeremy, JBeulich, kurt.hackel, npiggin,
dave.mccracken, riel
> From: Al Viro [mailto:viro at ZenIV.linux.org.uk]
> Subject: Re: Cleancache [PATCH 2/7] (was Transcendent Memory): core files
Hi Al!
Thanks for the feedback! Sorry for the delayed response.
> ...again, use sane types...
Good point. Will fix types for next rev (using size_t, ino_t,
and pgoff_t).
> > + int (*get_page)(int, unsigned long, unsigned long, struct page *);
>
> Ugh. First of all, presumably you have some structure behind that
> index, don't you? Might be a better way to do it.
Not quite sure what you mean here. The index is really
just part of a unique handle for cleancache to identify
the (page of) data.
> What's more, use of ->i_ino is simply wrong. How stable do you want that
> to be and how much do you want it to outlive struct address_space in question?
> From my reading of your code, it doesn't outlive that anyway, so...
Unless I misunderstand your point, no, the inode never outlives
the address space because the specification requires the kernel
to ensure coherency; if the inode were about to outlive the
address space, the cleancache_flush operations must be invoked
(and I think the patch covers all the necessary cases).
> The third one is pgoff_t; again, use sane types, _if_ you actually want
> the argument #3 at all - it can be derived from struct page you are
> passing there as well.
I thought it best to declare the _ops so that the struct page
is opaque to the "backend" (driver). The kernel-side ("frontend")
defines the handle and ensures coherency, so the backend shouldn't
be allowed to derive or muck with the three-tuple passed by the
kernel. In the existing (Xen tmem) driver, the only operation
performed on the struct page parameter is page_to_pfn(). OTOH,
I could go one step further and pass a pfn_t instead of a
struct page, since it is really only the physical page frame that
the backend needs to know about and (synchronously) read/write from/to.
Thoughts?
Thanks again!
Dan
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] Cleancache [PATCH 2/7] (was Transcendent Memory): core files
2010-05-24 20:04 ` Dan Magenheimer
@ 2010-05-25 2:16 ` Dan Magenheimer
0 siblings, 0 replies; 3+ messages in thread
From: Dan Magenheimer @ 2010-05-25 2:16 UTC (permalink / raw)
To: Al Viro
Cc: chris.mason, akpm, adilger, tytso, mfasheh, joel.becker, matthew,
linux-btrfs, linux-kernel, linux-fsdevel, linux-ext4, ocfs2-devel,
linux-mm, ngupta, jeremy, JBeulich, kurt.hackel, npiggin,
dave.mccracken, riel
> > The third one is pgoff_t; again, use sane types, _if_ you actually
> want
> > the argument #3 at all - it can be derived from struct page you are
> > passing there as well.
>
> I thought it best to declare the _ops so that the struct page
> is opaque to the "backend" (driver). The kernel-side ("frontend")
> defines the handle and ensures coherency, so the backend shouldn't
> be allowed to derive or muck with the three-tuple passed by the
> kernel. In the existing (Xen tmem) driver, the only operation
> performed on the struct page parameter is page_to_pfn(). OTOH,
> I could go one step further and pass a pfn_t instead of a
> struct page, since it is really only the physical page frame that
> the backend needs to know about and (synchronously) read/write from/to.
>
> Thoughts?
Silly me. pfn_t is a Xen/KVM type not otherwise used in the
kernel AFAICT. Please ignore...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-25 2:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20100422132809.GA27302@ca-server1.us.oracle.com>
2010-05-14 23:18 ` [Ocfs2-devel] Cleancache [PATCH 2/7] (was Transcendent Memory): core files Al Viro
2010-05-24 20:04 ` Dan Magenheimer
2010-05-25 2:16 ` Dan Magenheimer
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).