All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Fix warning in fs/xfs.c
Date: Thu, 03 Jul 2008 14:48:07 -0400	[thread overview]
Message-ID: <1215110887.4585.35.camel@dv> (raw)
In-Reply-To: <87tzf66d6w.fsf@xs4all.nl>

On Thu, 2008-07-03 at 20:21 +0200, Marco Gerards wrote:
> Pavel Roskin <proski@gnu.org> writes:
> 
> > ChangeLog:
> > 	* fs/xfs.c (struct grub_xfs_dir_header): Use names similar to
> > 	those in Linux XFS code.  Provide a way to access 64-bit parent
> > 	inode.
> > 	(grub_xfs_iterate_dir): Use the new names.  Avoid reading past
> > 	the end of struct grub_xfs_dir_header.
> 
> *please* do not look at Linux code or whatever *and* contribute to
>  GRUB.  It might cause copyright troubles I will have to deal with :-/

I just tried to make names similar without copying any code.  But it's a
useful reminder.

> I do not see the advantage of this patch.  Can you please explain why
> we need these name changes?

We were casting a pointer to a 32-bit integer to a pointer to a 64-bit
integer, which is bad, and gcc was emitting a warning about it.

Worse yet, the 64-bit value was "sticking" beyond the end the structure
we were using to describe the header.

i4 and i8 are generally used by Linux XFS code to describe 32-bit and
64-bit values if either can be used.  The "smallino" field was highly
misleading because it had to be negated.  It's the number of "big" (i8
or 64-bit) entries.  If it's 0, then the entries are "small".

So it was natural to call it "i8count".  And once it was "i8count", it
was natural to call the first value "count".

If you prefer another naming convention, let's rename the entries
according to it.  I was thinking having 2 32-bit integers "parent_hi"
and "parent_lo" or something like that.  Anyway, let's not use
"smallino" - "bigentries" would be better.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2008-07-03 18:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02  0:10 [PATCH] Fix warning in fs/xfs.c Pavel Roskin
2008-07-03 18:21 ` Marco Gerards
2008-07-03 18:48   ` Pavel Roskin [this message]
2008-07-20 18:50     ` Marco Gerards
2008-07-20 20:28       ` Pavel Roskin
2008-07-21 21:40       ` Cesare Leonardi

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=1215110887.4585.35.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /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.