Message ID | CAB5sJHwdf+MmNPfFrrmX7HYnmTjKXY-Wju2db_0i3VQ7A+eMag@mail.gmail.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
On Thu, Jan 16, 2014 at 09:22:57PM -0500, Ivan Jager wrote: > After patching this I realized Liu Bo had already written a similar > patch, but I think mine is cleaner, so I'm sending it anyway. Thanks for taking the time, I like your version better and will replace Liu Bo's patch in integration branch. > If you like, I could also change the location->objectid references > between my two changes, which would make the patch bigger, but would > make it actually reduce the overall code size slightly. Not necessary. > Feel free to make or request any necessary style changes as I couldn't > find documentation on the coding style for btrfs-tools. I'ts the same as the kernel coding style, code and people are mostly the shared. > PS: Here is the gdb output in case anyone is interested. It helps to verify how the unaligned access propagated, thanks. I'll put your analysis as a changelog and the missing Signed-off-by line from your name + email. It's the "Developer's Certificate of Origin 1.1", see http://lxr.free-electrons.com/source/Documentation/SubmittingPatches#L307 if you'r not familiar with this practice. david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jan 17, 2014 at 8:58 AM, David Sterba <dsterba@suse.cz> wrote: > I'll put your analysis as a changelog and the missing Signed-off-by > line from your name + email. > It's the "Developer's Certificate of Origin 1.1", see > http://lxr.free-electrons.com/source/Documentation/SubmittingPatches#L307 > if you'r not familiar with this practice. Ok, I had seen some of those lines but misunderstood what they meant. I thought it was code review related but in a different way. Ivan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/disk-io.c b/disk-io.c index 0af3898..a995b52 100644 --- a/disk-io.c +++ b/disk-io.c @@ -680,6 +680,7 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root; struct rb_node *node; int ret; + u64 objectid = location->objectid; if (location->objectid == BTRFS_ROOT_TREE_OBJECTID) return fs_info->tree_root; @@ -695,7 +696,7 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_fs_info *fs_info, BUG_ON(location->objectid == BTRFS_TREE_RELOC_OBJECTID || location->offset != (u64)-1); - node = rb_search(&fs_info->fs_root_tree, (void *)&location->objectid, + node = rb_search(&fs_info->fs_root_tree, (void *)&objectid, btrfs_fs_roots_compare_objectids, NULL); if (node) return container_of(node, struct btrfs_root, rb_node);