[Top] [All Lists]

Re: [RFC, PATCH 0/12] xfs: compound buffers for directory blocks

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [RFC, PATCH 0/12] xfs: compound buffers for directory blocks
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 14 Dec 2011 13:33:14 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1323238703-13198-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1323238703-13198-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
I've been really busy the last days and only managed to look over this
a bit while waiting for compiles and benchmarks.

The only really major comment I have is that I start to really dislike
the way struct xfs_bmbt_irec is used in the compound buffers.  The
XFS_EXT_DADDR flag basically gives the data types in there a totally
different meaning and is really confusing for anyone reading the code:
either we're using a "normal" one passes in from the directory code,
or an artificial one used internally, which uses different units.

I suspect we'd really be much better off introducing a new, smaller type
here, especially as it's only seen inside the buffer code:

struct xfs_buf_map {
        sector_t        bm_bno;
        size_t          bm_len;

any use it consistently, that is also use it to replace
b_file_offset/b_buffer_length and b_bn.    This will also make my number
two suggestion a lot cleaner, that is make sure the new abstraction can
be implemented for reading/writing log buffers that wrap around, and
allow to kill off xfs_buf_associate_memory entirely.

<Prev in Thread] Current Thread [Next in Thread>