]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fs/adfs: add helper to get discrecord from map
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 4 Jun 2019 13:49:30 +0000 (14:49 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Jun 2019 00:14:13 +0000 (20:14 -0400)
Add a helper to get the disc record from the map, rather than open
coding this in adfs_fill_super().

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

index 804c6a77c5db2d7715afec77b27188ebdfb24940..5a72a0ea03bdf2c93dae7af53ebcee750f23e7c7 100644 (file)
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+#include <linux/buffer_head.h>
 #include <linux/fs.h>
 #include <linux/adfs_fs.h>
 
@@ -18,8 +19,6 @@
 
 #include "dir_f.h"
 
-struct buffer_head;
-
 /*
  * adfs file system inode data in memory
  */
@@ -195,3 +194,10 @@ __adfs_block_map(struct super_block *sb, unsigned int object_id,
 
        return adfs_map_lookup(sb, object_id >> 8, block);
 }
+
+/* Return the disc record from the map */
+static inline
+struct adfs_discrecord *adfs_map_discrecord(struct adfs_discmap *dm)
+{
+       return (void *)(dm[0].dm_bh->b_data + 4);
+}
index 693f69ed3de3e3917c03212f02d0b5ad922d72a8..beedd275599f6facd149139a00c20fa56113a247 100644 (file)
@@ -9,7 +9,6 @@
  *
  *  E and F format directory handling
  */
-#include <linux/buffer_head.h>
 #include "adfs.h"
 #include "dir_f.h"
 
index 97b9f28f459b89702099a1891a7d7a866aacb18a..12ab34dad8158e738f06fdcaa003cc626ab9eb98 100644 (file)
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/buffer_head.h>
 #include <linux/slab.h>
 #include "adfs.h"
 #include "dir_fplus.h"
index 6935f05202acb502e8ae9554665ad7ae5f03270f..5f2d9d77530559778aa326b90dcc2f3b248328a9 100644 (file)
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/buffer_head.h>
 #include <asm/unaligned.h>
 #include "adfs.h"
 
index 2a83655c408f1f2625dca60d7b010c6fb097cc21..533c9601a670d17fcc98fb9b5705aa3dd1d495f9 100644 (file)
@@ -9,7 +9,6 @@
  */
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/buffer_head.h>
 #include <linux/parser.h>
 #include <linux/mount.h>
 #include <linux/seq_file.h>
@@ -463,7 +462,7 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
         */
        sb->s_op = &adfs_sops;
 
-       dr = (struct adfs_discrecord *)(asb->s_map[0].dm_bh->b_data + 4);
+       dr = adfs_map_discrecord(asb->s_map);
 
        root_obj.parent_id = root_obj.file_id = le32_to_cpu(dr->root);
        root_obj.name_len  = 0;