Re: [PATCH v2 2/6] Btrfs: use more straightforward extent_buffer_uptodate
On Fri, May 18, 2018 at 01:17:16PM +0800, Qu Wenruo wrote: > > > On 2018年05月18日 11:00, Liu Bo wrote: > > If parent_transid "0" is passed to btrfs_buffer_uptodate(), > > btrfs_buffer_uptodate() is equivalent to extent_buffer_uptodate(), but > > extent_buffer_uptodate() is preferred since we don't have to look into > > verify_parent_transid(). > > > > Signed-off-by: Liu Bo > > Reviewed-by: Qu Wenruo > > And considering how little extra work we do in btrfs_buffer_uptodate(), > what about make it an inline function? The actual picture as the compiler sees the function can be quite different, eg if there are static functions called from that one, they could get inlined and suddenly btrfs_buffer_uptodate becomes btrfs_buffer_uptodate + verify_parent_transid. IOW, leave the inlining on the compiler and use 'static inline' only for really lightweight functions. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/6] Btrfs: use more straightforward extent_buffer_uptodate
On 2018年05月18日 11:00, Liu Bo wrote: > If parent_transid "0" is passed to btrfs_buffer_uptodate(), > btrfs_buffer_uptodate() is equivalent to extent_buffer_uptodate(), but > extent_buffer_uptodate() is preferred since we don't have to look into > verify_parent_transid(). > > Signed-off-by: Liu Bo Reviewed-by: Qu Wenruo And considering how little extra work we do in btrfs_buffer_uptodate(), what about make it an inline function? Thanks, Qu > --- > fs/btrfs/ctree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c > index 9fa3d77c98d4..a96d308c51b8 100644 > --- a/fs/btrfs/ctree.c > +++ b/fs/btrfs/ctree.c > @@ -2445,7 +2445,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path > *path, int level) >* and give up so that our caller doesn't loop forever >* on our EAGAINs. >*/ > - if (!btrfs_buffer_uptodate(tmp, 0, 0)) > + if (!extent_buffer_uptodate(tmp)) > ret = -EIO; > free_extent_buffer(tmp); > } else { > signature.asc Description: OpenPGP digital signature