On Mar 07, 2008 01:31 +0000, Duane Griffin wrote:Duane, thanks for doing the cleanup. Comments inline. (minor) calling this "hash_size" would be a bit clearer, and more consistent with the old code. Not a reason in itself to redo the patch though. (style) could fit on a single line by removing one space somewhere, or follow code style and move only "GFP_KERNEL" to the second line... (style) it is preferred to indent continuation lines to the previous '(' like: journal->j_revoke_table[0] = kmem_cache_alloc(jbd2_revoke_table_cache, GFP_KERNEL); or alternately: journal->j_revoke_table[0] = kmem_cache_alloc(jbd2_revoke_table_cache, GFP_KERNEL); (style) wrap at 80 columns. (minor) It appears we could reduce some more code duplication by doing the allocation of j_revoke_table[0] and j_revoke_table[1] inside journal_init_revoke_table(), passing back the table pointer or NULL on failure (-ENOMEM is really the only possible error return code here)? Doing the table allocation inside journal_init_revoke_table() also simplifies cleanup, because we don't need to handle "init" and "alloc" failures separately here. (minor) This should be moved above journal_init_revoke_table() and be used to free the first table if allocation/init of the second table fails. That is proper encapsulation of functionality, and by moving the table allocation inside journal_init_revoke_table() as previously suggested, we never have to handle partially-initialized tables (i.e. alloc, but list_heads not init. Sure, it is a bit more overhead than just freeing the arrays, but performance isn't critical if the mount just failed due to ENOMEM, and isn't expected to happen very often at all. (style) empty line here. (style) I'd probably write this as below, to keep the logic simpler: journal->j_revoke = NULL; if (journal->j_revoke_table[0]) jbd2_journal_destroy_revoke_table(journal->j_revoke_table[0]); if (journal->j_revoke_table[1]) jbd2_journal_destroy_revoke_table(journal->j_revoke_table[1]); Also, we don't really need to set journal->j_revoke = NULL twice. Same of course applies to both versions of the patch. Hopefully once ext4 has had some chance to bake in the kernel (when people start using it after the "dev" moniker is removed) and Fedora we can revert back to a single jbd code base. There are no incompatible format changes in jbd2 that would be forced upon ext3 by consolidating the code base, it was just split during development to avoid destabilizing ext3. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. --
| Arjan van de Ven | [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Tilman Schmidt | git guidance |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Martin Langhoff | Re: pack operation is thrashing my server |
| Alan Larkin | fatal: Out of memory, malloc failed |
| Mark Junker | git on MacOSX and files with decomposed utf-8 file names |
| Alex Riesen | Re: How do get a specific version of a particular file? |
| Leon Dippenaar | New tcp stack attack |
| Richard Stallman | Real men don't attack straw men |
| Pieter Verberne | Remove escape characters from file |
| Juan Miscaro | removing sendmail |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Chuck Lever | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
