xfs
[Top] [All Lists]

Re: [PATCH 9/9] xfs: factor buffer reading from xfs_dir2_leaf_getdents

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 9/9] xfs: factor buffer reading from xfs_dir2_leaf_getdents
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 20 Jun 2012 03:27:10 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1339133914-11148-10-git-send-email-david@xxxxxxxxxxxxx>
References: <1339133914-11148-1-git-send-email-david@xxxxxxxxxxxxx> <1339133914-11148-10-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
> +struct _map_info {
> +     xfs_bmbt_irec_t *map;           /* map vector for blocks */
> +     xfs_extlen_t    map_blocks;     /* number of fsbs in map */
> +     xfs_dablk_t     map_off;        /* last mapped file offset */
> +     int             map_size;       /* total entries in *map */
> +     int             map_valid;      /* valid entries in *map */
> +     int             nmap;           /* mappings to ask xfs_bmapi */
> +     xfs_dir2_db_t   curdb;          /* db for current block */
> +};
> +
> +struct _ra_info {

Can you give these structure names xfs_dir2_leaf prefixes, please?

Also any reason the ra_info structure is kept entirely separate?  While
I see a bit of a point to have a logical grouping, it still semes more
useful to just embedd it into the map_info.

> +     map_info.map_size = howmany(bufsize + mp->m_dirblksize,
> +                                  mp->m_sb.sb_blocksize);
> +     map_info.map = kmem_zalloc(map_info.map_size *
> +                                     sizeof(struct xfs_bmbt_irec), KM_SLEEP);

I'd be tempted to say that the map field in the map_info should be a
variable sized array the end, and the whole structure should be
dynamically allocated to get a couple more variables off the stack.


Except for these nitpicks this looks like a great cleanup to me.

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