Skip to content

Commit 608ba50

Browse files
author
Al Viro
committed
Cleanup of adfs headers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ee450f7 commit 608ba50

11 files changed

Lines changed: 57 additions & 134 deletions

File tree

‎fs/adfs/adfs.h‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <linux/fs.h>
2+
#include <linux/adfs_fs.h>
3+
14
/* Internal data structures for ADFS */
25

36
#define ADFS_FREE_FRAG 0
@@ -16,6 +19,58 @@
1619

1720
struct buffer_head;
1821

22+
/*
23+
* adfs file system inode data in memory
24+
*/
25+
struct adfs_inode_info {
26+
loff_t mmu_private;
27+
unsigned long parent_id; /* object id of parent */
28+
__u32 loadaddr; /* RISC OS load address */
29+
__u32 execaddr; /* RISC OS exec address */
30+
unsigned int filetype; /* RISC OS file type */
31+
unsigned int attr; /* RISC OS permissions */
32+
unsigned int stamped:1; /* RISC OS file has date/time */
33+
struct inode vfs_inode;
34+
};
35+
36+
/*
37+
* Forward-declare this
38+
*/
39+
struct adfs_discmap;
40+
struct adfs_dir_ops;
41+
42+
/*
43+
* ADFS file system superblock data in memory
44+
*/
45+
struct adfs_sb_info {
46+
struct adfs_discmap *s_map; /* bh list containing map */
47+
struct adfs_dir_ops *s_dir; /* directory operations */
48+
49+
uid_t s_uid; /* owner uid */
50+
gid_t s_gid; /* owner gid */
51+
umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
52+
umode_t s_other_mask; /* ADFS other perm -> unix perm */
53+
54+
__u32 s_ids_per_zone; /* max. no ids in one zone */
55+
__u32 s_idlen; /* length of ID in map */
56+
__u32 s_map_size; /* sector size of a map */
57+
unsigned long s_size; /* total size (in blocks) of this fs */
58+
signed int s_map2blk; /* shift left by this for map->sector */
59+
unsigned int s_log2sharesize;/* log2 share size */
60+
__le32 s_version; /* disc format version */
61+
unsigned int s_namelen; /* maximum number of characters in name */
62+
};
63+
64+
static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb)
65+
{
66+
return sb->s_fs_info;
67+
}
68+
69+
static inline struct adfs_inode_info *ADFS_I(struct inode *inode)
70+
{
71+
return container_of(inode, struct adfs_inode_info, vfs_inode);
72+
}
73+
1974
/*
2075
* Directory handling
2176
*/

‎fs/adfs/dir.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99
*
1010
* Common directory handling for ADFS
1111
*/
12-
#include <linux/errno.h>
13-
#include <linux/fs.h>
14-
#include <linux/adfs_fs.h>
15-
#include <linux/time.h>
16-
#include <linux/stat.h>
17-
#include <linux/spinlock.h>
1812
#include <linux/smp_lock.h>
19-
#include <linux/buffer_head.h> /* for file_fsync() */
20-
2113
#include "adfs.h"
2214

2315
/*

‎fs/adfs/dir_f.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99
*
1010
* E and F format directory handling
1111
*/
12-
#include <linux/errno.h>
13-
#include <linux/fs.h>
14-
#include <linux/adfs_fs.h>
15-
#include <linux/time.h>
16-
#include <linux/stat.h>
17-
#include <linux/spinlock.h>
1812
#include <linux/buffer_head.h>
19-
#include <linux/string.h>
20-
2113
#include "adfs.h"
2214
#include "dir_f.h"
2315

‎fs/adfs/dir_fplus.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
* it under the terms of the GNU General Public License version 2 as
88
* published by the Free Software Foundation.
99
*/
10-
#include <linux/errno.h>
11-
#include <linux/fs.h>
12-
#include <linux/adfs_fs.h>
13-
#include <linux/time.h>
14-
#include <linux/stat.h>
15-
#include <linux/spinlock.h>
1610
#include <linux/buffer_head.h>
17-
#include <linux/string.h>
18-
1911
#include "adfs.h"
2012
#include "dir_fplus.h"
2113

‎fs/adfs/file.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
*
2020
* adfs regular file handling primitives
2121
*/
22-
#include <linux/fs.h>
23-
#include <linux/buffer_head.h> /* for file_fsync() */
24-
#include <linux/adfs_fs.h>
25-
2622
#include "adfs.h"
2723

2824
const struct file_operations adfs_file_operations = {

‎fs/adfs/inode.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@
77
* it under the terms of the GNU General Public License version 2 as
88
* published by the Free Software Foundation.
99
*/
10-
#include <linux/errno.h>
11-
#include <linux/fs.h>
12-
#include <linux/adfs_fs.h>
13-
#include <linux/time.h>
14-
#include <linux/stat.h>
15-
#include <linux/string.h>
16-
#include <linux/mm.h>
1710
#include <linux/smp_lock.h>
18-
#include <linux/module.h>
1911
#include <linux/buffer_head.h>
20-
2112
#include "adfs.h"
2213

2314
/*
@@ -395,4 +386,3 @@ int adfs_write_inode(struct inode *inode, int wait)
395386
unlock_kernel();
396387
return ret;
397388
}
398-
MODULE_LICENSE("GPL");

‎fs/adfs/map.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@
77
* it under the terms of the GNU General Public License version 2 as
88
* published by the Free Software Foundation.
99
*/
10-
#include <linux/errno.h>
11-
#include <linux/fs.h>
12-
#include <linux/adfs_fs.h>
13-
#include <linux/spinlock.h>
1410
#include <linux/buffer_head.h>
15-
1611
#include <asm/unaligned.h>
17-
1812
#include "adfs.h"
1913

2014
/*

‎fs/adfs/super.c‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,12 @@
88
* published by the Free Software Foundation.
99
*/
1010
#include <linux/module.h>
11-
#include <linux/errno.h>
12-
#include <linux/fs.h>
13-
#include <linux/adfs_fs.h>
14-
#include <linux/slab.h>
15-
#include <linux/time.h>
16-
#include <linux/stat.h>
17-
#include <linux/string.h>
1811
#include <linux/init.h>
1912
#include <linux/buffer_head.h>
20-
#include <linux/vfs.h>
2113
#include <linux/parser.h>
22-
#include <linux/bitops.h>
2314
#include <linux/mount.h>
2415
#include <linux/seq_file.h>
25-
26-
#include <asm/uaccess.h>
27-
#include <asm/system.h>
28-
29-
#include <stdarg.h>
30-
16+
#include <linux/statfs.h>
3117
#include "adfs.h"
3218
#include "dir_f.h"
3319
#include "dir_fplus.h"
@@ -534,3 +520,4 @@ static void __exit exit_adfs_fs(void)
534520

535521
module_init(init_adfs_fs)
536522
module_exit(exit_adfs_fs)
523+
MODULE_LICENSE("GPL");

‎include/linux/adfs_fs.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ struct adfs_discrecord {
4141
#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
4242

4343
#ifdef __KERNEL__
44-
#include <linux/adfs_fs_i.h>
45-
#include <linux/adfs_fs_sb.h>
4644
/*
4745
* Calculate the boot block checksum on an ADFS drive. Note that this will
4846
* appear to be correct if the sector contains all zeros, so also check that
@@ -60,17 +58,6 @@ static inline int adfs_checkbblk(unsigned char *ptr)
6058

6159
return (result & 0xff) != ptr[511];
6260
}
63-
64-
static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb)
65-
{
66-
return sb->s_fs_info;
67-
}
68-
69-
static inline struct adfs_inode_info *ADFS_I(struct inode *inode)
70-
{
71-
return container_of(inode, struct adfs_inode_info, vfs_inode);
72-
}
73-
7461
#endif
7562

7663
#endif

‎include/linux/adfs_fs_i.h‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)