hfsplus: fix HFSPLUS_SB calling convention
HFSPLUS_SB doesn't return a pointer to the hfsplus-specific superblock information like all other FOO_SB macros, but dereference the pointer in a way that made it look like a direct struct derefence. This only works as long as the HFSPLUS_SB macro is used directly and prevents us from keepig a local hfsplus_sb_info pointer. Fix the calling convention and introduce a local sbi variable in all functions that use it constantly. Signed-off-by: Christoph Hellwig <hch@tuxera.com>
This commit is contained in:

committed by
Christoph Hellwig

parent
e753a62156
commit
dd73a01a30
@@ -74,6 +74,7 @@ struct old_pmap {
|
||||
int hfs_part_find(struct super_block *sb,
|
||||
sector_t *part_start, sector_t *part_size)
|
||||
{
|
||||
struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
|
||||
struct buffer_head *bh;
|
||||
__be16 *data;
|
||||
int i, size, res;
|
||||
@@ -95,7 +96,7 @@ int hfs_part_find(struct super_block *sb,
|
||||
for (i = 0; i < size; p++, i++) {
|
||||
if (p->pdStart && p->pdSize &&
|
||||
p->pdFSID == cpu_to_be32(0x54465331)/*"TFS1"*/ &&
|
||||
(HFSPLUS_SB(sb).part < 0 || HFSPLUS_SB(sb).part == i)) {
|
||||
(sbi->part < 0 || sbi->part == i)) {
|
||||
*part_start += be32_to_cpu(p->pdStart);
|
||||
*part_size = be32_to_cpu(p->pdSize);
|
||||
res = 0;
|
||||
@@ -111,7 +112,7 @@ int hfs_part_find(struct super_block *sb,
|
||||
size = be32_to_cpu(pm->pmMapBlkCnt);
|
||||
for (i = 0; i < size;) {
|
||||
if (!memcmp(pm->pmPartType,"Apple_HFS", 9) &&
|
||||
(HFSPLUS_SB(sb).part < 0 || HFSPLUS_SB(sb).part == i)) {
|
||||
(sbi->part < 0 || sbi->part == i)) {
|
||||
*part_start += be32_to_cpu(pm->pmPyPartStart);
|
||||
*part_size = be32_to_cpu(pm->pmPartBlkCnt);
|
||||
res = 0;
|
||||
|
Reference in New Issue
Block a user