All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 4/7] ocfs2: Introduce dir free space list
Date: Fri, 30 Jan 2009 17:29:26 -0800	[thread overview]
Message-ID: <20090131012926.GD6155@mail.oracle.com> (raw)
In-Reply-To: <1233351753-14640-5-git-send-email-mfasheh@suse.com>

On Fri, Jan 30, 2009 at 01:42:30PM -0800, Mark Fasheh wrote:
> The only operation which doesn't get faster with directory indexing is
> insert, which still has to walk the entire unindexed directory portion to
> find a free block. This patch provides an improvement in directory insert
> performance by maintaining a singly linked list of directory leaf blocks
> which have space for additional dirents.
> 
> Signed-off-by: Mark Fasheh <mfasheh@suse.com>

Two small comments inline.

Signed-off-by: Joel Becker <joel.becker@oracle.com>

> @@ -2074,8 +2280,12 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
>  	memset(new_bh->b_data, 0, osb->sb->s_blocksize);
>  
>  	de = ocfs2_fill_initial_dirents(inode, parent, new_bh->b_data, size);
> -	if (ocfs2_supports_dir_trailer(osb))
> -		ocfs2_init_dir_trailer(inode, new_bh);
> +	if (ocfs2_new_dir_wants_trailer(inode)) {
> +		int size = le16_to_cpu(de->rec_len);
> +		size -= OCFS2_DIR_REC_LEN(2);
> +		size -= sizeof(struct ocfs2_dir_block_trailer);
> +		ocfs2_init_dir_trailer(inode, new_bh, size);
> +	}

I don't get why you are...oh, I get it.  In fill_new_dir_el(), you're
starting with the rec_len of '..', then subtracting the "real" portion
of that dirent.  That describes the hole.  Can we get a comment - it
wasn't obvious.

> diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
> index 09ab57e..5d45bcf 100644
> --- a/fs/ocfs2/ocfs2_fs.h
> +++ b/fs/ocfs2/ocfs2_fs.h
> @@ -416,6 +416,7 @@ static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
>  #define OCFS2_DIR_REC_LEN(name_len)	(((name_len) + OCFS2_DIR_MEMBER_LEN + \
>                                            OCFS2_DIR_ROUND) & \
>  					 ~OCFS2_DIR_ROUND)
> +#define OCFS2_DIR_MIN_REC_LEN	OCFS2_DIR_REC_LEN(1)

	I think tools has this defined in ocfs2.h or dirblock.h or
something.  So when you bring ocfs2_fs.h over to tools, make sure to
remove any tools copy of this macro.

Joel

-- 

"Not everything that can be counted counts, and not everything
 that counts can be counted."
        - Albert Einstein 

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2009-01-31  1:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 21:42 [Ocfs2-devel] [PATCH 0/7] ocfs2: Directory indexing support Mark Fasheh
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 1/7] ocfs2: Introduce dir lookup helper struct Mark Fasheh
2009-01-30 22:22   ` Joel Becker
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 2/7] ocfs2: Add a name indexed b-tree to directory inodes Mark Fasheh
2009-01-31  0:54   ` Joel Becker
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 3/7] ocfs2: Store dir index records inline Mark Fasheh
2009-01-31  1:09   ` Joel Becker
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 4/7] ocfs2: Introduce dir free space list Mark Fasheh
2009-01-31  1:29   ` Joel Becker [this message]
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 5/7] ocfs2: Increase max links count Mark Fasheh
2009-01-31  1:36   ` Joel Becker
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 6/7] ocfs2: Enable indexed directories Mark Fasheh
2009-01-31  1:36   ` Joel Becker
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 7/7] ocfs2: add quota call to ocfs2_remove_btree_range() Mark Fasheh
2009-01-31  1:37   ` Joel Becker
2009-02-02 10:05   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090131012926.GD6155@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.