OSDN Git Service

fs/adfs: map: incorporate map offsets into layout
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 9 Dec 2019 11:08:49 +0000 (11:08 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Jan 2020 01:12:40 +0000 (20:12 -0500)
commit197ba3c519312a0bed91aeaf34095b2c09c6431a
treebe6067609c33ffdadfd27bacf3816094fcac7224
parent7b1952676256d2cdc03d0415a4c0e6bfb64e00ff
fs/adfs: map: incorporate map offsets into layout

lookup_zone() and scan_free_map() cope in different ways with the
location of the map data within a zone:

1. lookup_zone() adds a four byte offset to the map data pointer to
   skip over the check and free link bytes.

2. scan_free_map() needs to use the free link pointer, which is an
   offset from itself, so we end up adding a 32-bit offset to the
   end pointer (aka mapsize) which is really confusing.

Rename mapsize to endbit as this is really what it is, and incorporate
the 32-bit offset into the map layout.  This means that both dm_startbit
and dm_endbit are now bit offsets from the start of the buffer, rather
than four bytes in to the buffer.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/adfs/map.c