From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: grub-devel@gnu.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH v2] F2FS support
Date: Sun, 3 May 2015 09:28:58 +0300 [thread overview]
Message-ID: <20150503092858.016b3217@opensuse.site> (raw)
In-Reply-To: <20150502201545.1ac3fead@opensuse.site>
В Sat, 2 May 2015 20:15:45 +0300
Andrei Borzenkov <arvidjaar@gmail.com> пишет:
> > +
> > +static inline int
> > +grub_generic_test_bit (int nr, const grub_uint32_t *addr)
> > +{
> > + return 1UL & (addr[nr / 32] >> (nr & 31));
> > +}
> > +
>
> This is used only in grub_f2fs_check_dentries() with on-disk bitmap.
> On-disk bitmap is little-endian; code is wrong on big-endian system.
>
> Also dentry_bitmap is not multiple of 4 bytes as you replied earlier.
> You should rather compute correct byte address instead and make all
> parameters grub_uint8_t *. This will also avoid all those casts later.
>
> That's really just
>
> grub_uint8_t *addr;
>
> byte = nr >> 3;
> #ifdef WORDS_BIGENDIAN
> byte ^= 3;
> #endif
Scratch it. We do know that byte order is LE so it is fixed. Sorry.
> return addr[byte] & (1 << nr & 7);
>
WARNING: multiple messages have this Message-ID (diff)
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: grub-devel@gnu.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH v2] F2FS support
Date: Sun, 3 May 2015 09:28:58 +0300 [thread overview]
Message-ID: <20150503092858.016b3217@opensuse.site> (raw)
In-Reply-To: <20150502201545.1ac3fead@opensuse.site>
В Sat, 2 May 2015 20:15:45 +0300
Andrei Borzenkov <arvidjaar@gmail.com> пишет:
> > +
> > +static inline int
> > +grub_generic_test_bit (int nr, const grub_uint32_t *addr)
> > +{
> > + return 1UL & (addr[nr / 32] >> (nr & 31));
> > +}
> > +
>
> This is used only in grub_f2fs_check_dentries() with on-disk bitmap.
> On-disk bitmap is little-endian; code is wrong on big-endian system.
>
> Also dentry_bitmap is not multiple of 4 bytes as you replied earlier.
> You should rather compute correct byte address instead and make all
> parameters grub_uint8_t *. This will also avoid all those casts later.
>
> That's really just
>
> grub_uint8_t *addr;
>
> byte = nr >> 3;
> #ifdef WORDS_BIGENDIAN
> byte ^= 3;
> #endif
Scratch it. We do know that byte order is LE so it is fixed. Sorry.
> return addr[byte] & (1 << nr & 7);
>
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2015-05-03 6:29 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 8:19 [PATCH] F2FS support Jaegeuk Kim
2015-03-24 8:19 ` Jaegeuk Kim
2015-03-28 7:31 ` Andrei Borzenkov
2015-03-28 7:31 ` Andrei Borzenkov
2015-03-28 20:43 ` Jaegeuk Kim
2015-03-28 20:43 ` Jaegeuk Kim
2015-03-28 21:00 ` Andrei Borzenkov
2015-03-28 21:00 ` Andrei Borzenkov
2015-04-03 22:48 ` Jaegeuk Kim
2015-04-03 22:48 ` Jaegeuk Kim
2015-04-03 22:49 ` [PATCH v2] " Jaegeuk Kim
2015-04-03 22:49 ` Jaegeuk Kim
2015-04-29 20:48 ` [f2fs-dev] " Jaegeuk Kim
2015-04-29 20:48 ` Jaegeuk Kim
2015-04-30 3:32 ` Andrei Borzenkov
2015-04-30 3:32 ` Andrei Borzenkov
2015-05-02 17:15 ` Andrei Borzenkov
2015-05-02 17:15 ` Andrei Borzenkov
2015-05-03 6:28 ` Andrei Borzenkov [this message]
2015-05-03 6:28 ` Andrei Borzenkov
2015-05-07 14:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-05-07 14:57 ` Andrei Borzenkov
2015-11-19 21:28 ` [PATCH v3] " Jaegeuk Kim
2015-11-19 21:28 ` Jaegeuk Kim
2015-12-14 8:28 ` Andrei Borzenkov
2015-12-14 8:28 ` Andrei Borzenkov
2015-12-15 0:30 ` [f2fs-dev] " Jaegeuk Kim
2015-12-15 0:30 ` Jaegeuk Kim
2015-12-15 0:34 ` [f2fs-dev] [PATCH v4] " Jaegeuk Kim
2015-12-15 0:34 ` Jaegeuk Kim
2015-12-15 8:34 ` [f2fs-dev] " Andrei Borzenkov
2015-12-15 8:34 ` Andrei Borzenkov
2015-12-15 18:08 ` [f2fs-dev] " Jaegeuk Kim
2015-12-15 18:08 ` Jaegeuk Kim
2015-12-15 18:14 ` [f2fs-dev] [PATCH v5] " Jaegeuk Kim
2015-12-15 18:14 ` Jaegeuk Kim
2016-01-07 19:37 ` [f2fs-dev] " Michael Zimmermann
2016-01-07 19:37 ` Michael Zimmermann
2016-01-08 19:41 ` [f2fs-dev] [PATCH v6] " Jaegeuk Kim
2016-01-08 19:41 ` Jaegeuk Kim
2016-02-22 9:25 ` [f2fs-dev] " Andrei Borzenkov
2016-02-22 9:25 ` Andrei Borzenkov
2016-02-22 18:21 ` [f2fs-dev] " Jaegeuk Kim
2016-02-22 18:21 ` Jaegeuk Kim
2016-02-22 18:25 ` [f2fs-dev] [PATCH v7] " Jaegeuk Kim
2016-02-22 18:25 ` Jaegeuk Kim
2016-03-01 19:52 ` [2.02] Re: [f2fs-dev] " Andrei Borzenkov
2016-03-01 19:52 ` Andrei Borzenkov
2016-03-02 23:20 ` Michael Zimmermann
2016-03-02 23:20 ` Michael Zimmermann
2016-03-03 21:35 ` Jaegeuk Kim
2016-03-03 21:35 ` [2.02] " Jaegeuk Kim
2016-03-03 21:36 ` [2.02] Re: [f2fs-dev] [PATCH v8] " Jaegeuk Kim
2016-03-03 21:36 ` Jaegeuk Kim
2016-08-04 17:06 ` [f2fs-dev] [2.02] " Jaegeuk Kim
2016-08-04 17:06 ` Jaegeuk Kim
2016-08-05 10:57 ` [f2fs-dev] " Andrei Borzenkov
2016-08-05 10:57 ` Andrei Borzenkov
2016-08-05 18:07 ` [f2fs-dev] " Jaegeuk Kim
2016-08-05 18:07 ` Jaegeuk Kim
2016-08-05 19:17 ` [f2fs-dev] " Michael Zimmermann
2016-08-05 19:17 ` Michael Zimmermann
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=20150503092858.016b3217@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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.