В Sat, 2 May 2015 20:15:45 +0300
Andrei Borzenkov <arvidj...@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);
> 

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to