[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130711185423.GA25414@lenny.home.zabbo.net>
Date: Thu, 11 Jul 2013 11:54:23 -0700
From: Zach Brown <zab@...hat.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: Ext4 Developers List <linux-ext4@...r.kernel.org>,
Zheng Liu <gnehzuil.liu@...il.com>,
Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [RFC PATCH 3/3] ext4: cache all of an extent tree's leaf block
upon reading
> @@ -490,6 +491,31 @@ __read_extent_tree_block(const char *function, unsigned int line,
> if (err)
> goto errout;
> set_buffer_verified(bh);
> + /*
> + * If this is a leaf block, cache all of its entries
> + */
> + if (!(flags & EXT4_EX_NOCACHE) && depth == 0) {
> + struct ext4_extent_header *eh = ext_block_hdr(bh);
> + struct ext4_extent *ex = EXT_FIRST_EXTENT(eh);
> + int i;
> +
> + for (i = eh->eh_entries; i > 0; i--, ex++) {
> + unsigned int status = EXTENT_STATUS_WRITTEN;
> + ext4_lblk_t prev = 0, lblk = le32_to_cpu(ex->ee_block);
> + int len = ext4_ext_get_actual_len(ex);
> +
> + if (prev && (prev != lblk))
> + ext4_es_cache_extent(inode, prev,
> + lblk - prev, ~0,
> + EXTENT_STATUS_HOLE);
> +
> + if (ext4_ext_is_uninitialized(ex))
> + status = EXTENT_STATUS_UNWRITTEN;
> + ext4_es_cache_extent(inode, lblk, len,
> + ext4_ext_pblock(ex), status);
> + prev = lblk + len;
> + }
> + }
Isn't prev going to be reinitialized to 0 for every extent?
- z
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists