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 5/7] ocfs2: Increase max links count
Date: Fri, 30 Jan 2009 17:36:02 -0800	[thread overview]
Message-ID: <20090131013602.GE6155@mail.oracle.com> (raw)
In-Reply-To: <1233351753-14640-6-git-send-email-mfasheh@suse.com>

On Fri, Jan 30, 2009 at 01:42:31PM -0800, Mark Fasheh wrote:
> Since we've now got a directory format capable of handling a large number of
> entries, we can increase the maximum link count supported. This only gets
> increased if the directory indexing feature is turned on.
> 
> Signed-off-by: Mark Fasheh <mfasheh@suse.com>

	Couple comments - I think one needs fixing.

> @@ -1292,7 +1293,7 @@ static int ocfs2_rename(struct inode *old_dir,
>  		}
>  
>  		if (S_ISDIR(new_inode->i_mode) ||
> -		    (newfe->i_links_count == cpu_to_le16(1))){
> +		    (ocfs2_read_links_count(newfe) == cpu_to_le16(1))) {
>  			status = ocfs2_orphan_add(osb, handle, new_inode,
>  						  newfe, orphan_name,
>  						  &orphan_insert, orphan_dir);

	ocfs2_read_links_count() returns cpu-endian numbers.  So I think
this needs to compare with "1", not "cpu_to_le16(1)".

> +static inline unsigned int ocfs2_read_links_count(struct ocfs2_dinode *di)
> +{
> +	u32 nlink = le16_to_cpu(di->i_links_count);
> +	u32 hi = le16_to_cpu(di->i_links_count_hi);
> +
> +	nlink |= (hi << OCFS2_LINKS_HI_SHIFT);
> +
> +	return nlink;
> +}

	I *think* we can rely on links_count_hi being 0 on all
existing filesystems.  But wouldn't it be safer to just skip
links_count_hi if !FEATURE_DX?

Joel

-- 

Life's Little Instruction Book #444

	"Never underestimate the power of a kind word or deed."

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

  reply	other threads:[~2009-01-31  1:36 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
2009-01-30 21:42 ` [Ocfs2-devel] [PATCH 5/7] ocfs2: Increase max links count Mark Fasheh
2009-01-31  1:36   ` Joel Becker [this message]
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=20090131013602.GE6155@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.