grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f2fs-dev] [PATCH v4] F2FS support


From: Andrei Borzenkov
Subject: Re: [f2fs-dev] [PATCH v4] F2FS support
Date: Tue, 15 Dec 2015 11:34:24 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

15.12.2015 03:34, Jaegeuk Kim пишет:
> Change log from v3:
>  o add grub_test_bit_le()
...

> +
> +static inline int
> +grub_f2fs_test_bit_le (int nr, const grub_uint8_t *addr)
> +{
> +  const grub_int32_t *p = (const grub_int32_t *)addr;
> +
> +  nr = nr ^ 0;

It does nothing.

> +
> +  return p[nr >> 5] & (1 << (nr & 31));
> +}

Well, you still miss the point - if you are working with integers you
must shift differently depending on whether we are running big or little
endian.

But as I mentioned before, we know that bitmap is little endian so we
can work with bytes and be independent of byte order. Could you test if
this works for you:

static inline int
grub_f2fs_test_bit_le (int nr, const grub_uint8_t *addr)
{
  return addr[nr >> 3] & (1 << (nr & 7));
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]