fscache review comments, part 2
This is about the actual fscache code.
- there's a bunch of gfp_t-related sparse warnings. I'll send a patch to fix them as a followup to this mail.
- the Kconfig hackery is rather ugly. I'd rather express the depencies with selects in this case - the filesystem fscache options select FSCACHE, as does the cachefiles module. Patch will be sent later.
- include/linux/fscache.h is an utter mess :)
Please reorder the file so there's just a single big
#if defined(CONFIG_FSCACHE) || defined(CONFIG_FSCACHE_MODULE) #else
#endif
block. Doing that will also allow to drop a lot of the __fscache function and directly stub out the non-__ versions.
- please remove the #ifdef CONFIG_DEBUG_SLAB BUG_ONs from cookie.c, driver should never deal with slab or slab debugging internals.
- various statically initialize structs in main.c set members to NULL, which is not required and should be removed
- IIRC k* release callbacks must not be NULL. Please check which Greg on your kset usage
- please adjust your comment style to normal linux style. kernel-doc headers for functions please, and no /********/ full line comments
- maybe fscache should provide a generic ->mkwrite operation or even a set of otherwise filemap-based vm_operations for it's client filesystems?
Quoted 2 lines · Christoph Hellwig
- there's a bunch of gfp_t-related sparse warnings. I'll send a patch to fix them as a followup to this mail.
Added.
Quoted 3 lines
- the
Kconfighackery is rather ugly. I'd rather express the depencies with selects in this case - the filesystem fscache options select FSCACHE, as does the cachefiles module. Patch will be sent later.
I don't much like that either; some people want to build FS-Cache in whilst retaining AFS and NFS as modules, and you've removed that option. I also think "select" should go away as it causes problems, though that's a weakness of the config programs.
Quoted 7 lines
-
include/linux/fscache.his an utter mess :)
Please reorder the file so there's just a single big #ifdefined(CONFIG_FSCACHE)||defined(CONFIG_FSCACHE_MODULE)#else
#endif
block. Doing that will also allow to drop a lot of the__fscachefunction and directly stub out the non-__ versions.
Sigh. Another #ifdef-hater.
Quoted 2 lines
- please remove the #ifdef
CONFIG_DEBUG_SLABBUG_ONsfromcookie.c, driver should never deal with slab or slab debugging internals.
They're useful debugging checks, but okay.
Quoted 2 lines
- various statically initialize structs in
main.cset members to NULL, which is not required and should be removed
Ok.
Quoted 2 lines
- IIRC k* release callbacks must not be NULL. Please check which Greg on your kset usage
Eh? The only one I've got is not NULL. It points to fscache_ktype_release().
Quoted 2 lines
- please adjust your comment style to normal linux style. kernel-doc headers for functions please,
kernel-doc is broken. It encourages people to be lazy about writing proper documentation. I have provided proper documentation.
Quoted 3 lines
- maybe fscache should provide a generic ->mkwrite operation or even a set of otherwise filemap-based
vm_operationsfor it's client filesystems?
Possibly.
David
Quoted 8 lines · David Howells
Quoted 3 lines
- the
Kconfighackery is rather ugly. I'd rather express the depencies with selects in this case - the filesystem fscache options select FSCACHE, as does the cachefiles module. Patch will be sent later.I don't much like that either; some people want to build FS-Cache in whilst retaining AFS and NFS as modules, and you've removed that option. I also think "select" should go away as it causes problems, though that's a weakness of the config programs.
Well, it's up to you. But the current Kconfig bits are a really fragile mess.
Quoted 4 lines
Quoted 2 lines
- IIRC k* release callbacks must not be NULL. Please check which Greg on your kset usage
Eh? The only one I've got is not NULL. It points to
fscache_ktype_release().
Sorry, it mean no-op, not NULL. rest of the sentence stands as it is.
Quoted 6 lines
Quoted 3 lines
- please adjust your comment style to normal linux style. kernel-doc headers for functions please,
kernel-doc is broken. It encourages people to be lazy about writing proper documentation. I have provided proper documentation.
It's not broken and it's the standard way of documenting kernel code. David, your free to use whatever coding style you want on your projects (even the current one that I'd call "broken" when we want to start name-calling), but please stick to the guideline for the project your working on. And Documentation/CodingStyle clearly suggests using kernel-doc style documentation.