Commit 45254b4fb2aef51c94a7397df1e481c4137b4b97
Committed by
Linus Torvalds
1 parent
48f15b93b2
Exists in
master
and in
7 other branches
efs: move headers out of include/linux/
Merge include/linux/efs_fs{_i,_dir}.h into fs/efs/efs.h. efs_vh.h remains there because this is the IRIX volume header and shouldn't really be handled by efs but by the partitioning code. efs_sb.h remains there for now because it's exported to userspace. Of course this wrong and aboot should have a copy of it's own, but I'll leave that to a separate patch to avoid any contention. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 10 changed files with 150 additions and 175 deletions Side-by-side Diff
fs/efs/dir.c
fs/efs/efs.h
1 | +/* | |
2 | + * Copyright (c) 1999 Al Smith | |
3 | + * | |
4 | + * Portions derived from work (c) 1995,1996 Christian Vogelgsang. | |
5 | + * Portions derived from IRIX header files (c) 1988 Silicon Graphics | |
6 | + */ | |
7 | +#ifndef _EFS_EFS_H_ | |
8 | +#define _EFS_EFS_H_ | |
9 | + | |
10 | +#include <linux/fs.h> | |
11 | +#include <asm/uaccess.h> | |
12 | + | |
13 | +#define EFS_VERSION "1.0a" | |
14 | + | |
15 | +static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>"; | |
16 | + | |
17 | + | |
18 | +/* 1 block is 512 bytes */ | |
19 | +#define EFS_BLOCKSIZE_BITS 9 | |
20 | +#define EFS_BLOCKSIZE (1 << EFS_BLOCKSIZE_BITS) | |
21 | + | |
22 | +typedef int32_t efs_block_t; | |
23 | +typedef uint32_t efs_ino_t; | |
24 | + | |
25 | +#define EFS_DIRECTEXTENTS 12 | |
26 | + | |
27 | +/* | |
28 | + * layout of an extent, in memory and on disk. 8 bytes exactly. | |
29 | + */ | |
30 | +typedef union extent_u { | |
31 | + unsigned char raw[8]; | |
32 | + struct extent_s { | |
33 | + unsigned int ex_magic:8; /* magic # (zero) */ | |
34 | + unsigned int ex_bn:24; /* basic block */ | |
35 | + unsigned int ex_length:8; /* numblocks in this extent */ | |
36 | + unsigned int ex_offset:24; /* logical offset into file */ | |
37 | + } cooked; | |
38 | +} efs_extent; | |
39 | + | |
40 | +typedef struct edevs { | |
41 | + __be16 odev; | |
42 | + __be32 ndev; | |
43 | +} efs_devs; | |
44 | + | |
45 | +/* | |
46 | + * extent based filesystem inode as it appears on disk. The efs inode | |
47 | + * is exactly 128 bytes long. | |
48 | + */ | |
49 | +struct efs_dinode { | |
50 | + __be16 di_mode; /* mode and type of file */ | |
51 | + __be16 di_nlink; /* number of links to file */ | |
52 | + __be16 di_uid; /* owner's user id */ | |
53 | + __be16 di_gid; /* owner's group id */ | |
54 | + __be32 di_size; /* number of bytes in file */ | |
55 | + __be32 di_atime; /* time last accessed */ | |
56 | + __be32 di_mtime; /* time last modified */ | |
57 | + __be32 di_ctime; /* time created */ | |
58 | + __be32 di_gen; /* generation number */ | |
59 | + __be16 di_numextents; /* # of extents */ | |
60 | + u_char di_version; /* version of inode */ | |
61 | + u_char di_spare; /* spare - used by AFS */ | |
62 | + union di_addr { | |
63 | + efs_extent di_extents[EFS_DIRECTEXTENTS]; | |
64 | + efs_devs di_dev; /* device for IFCHR/IFBLK */ | |
65 | + } di_u; | |
66 | +}; | |
67 | + | |
68 | +/* efs inode storage in memory */ | |
69 | +struct efs_inode_info { | |
70 | + int numextents; | |
71 | + int lastextent; | |
72 | + | |
73 | + efs_extent extents[EFS_DIRECTEXTENTS]; | |
74 | + struct inode vfs_inode; | |
75 | +}; | |
76 | + | |
77 | +#include <linux/efs_fs_sb.h> | |
78 | + | |
79 | +#define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS | |
80 | +#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS) | |
81 | + | |
82 | +struct efs_dentry { | |
83 | + __be32 inode; | |
84 | + unsigned char namelen; | |
85 | + char name[3]; | |
86 | +}; | |
87 | + | |
88 | +#define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1) | |
89 | +#define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1) | |
90 | + | |
91 | +#define EFS_DIRBLK_HEADERSIZE 4 | |
92 | +#define EFS_DIRBLK_MAGIC 0xbeef /* moo */ | |
93 | + | |
94 | +struct efs_dir { | |
95 | + __be16 magic; | |
96 | + unsigned char firstused; | |
97 | + unsigned char slots; | |
98 | + | |
99 | + unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE]; | |
100 | +}; | |
101 | + | |
102 | +#define EFS_MAXENTS \ | |
103 | + ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / \ | |
104 | + (EFS_DENTSIZE + sizeof(char))) | |
105 | + | |
106 | +#define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot]) | |
107 | + | |
108 | +#define EFS_REALOFF(offset) ((offset << 1)) | |
109 | + | |
110 | + | |
111 | +static inline struct efs_inode_info *INODE_INFO(struct inode *inode) | |
112 | +{ | |
113 | + return container_of(inode, struct efs_inode_info, vfs_inode); | |
114 | +} | |
115 | + | |
116 | +static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb) | |
117 | +{ | |
118 | + return sb->s_fs_info; | |
119 | +} | |
120 | + | |
121 | +struct statfs; | |
122 | +struct fid; | |
123 | + | |
124 | +extern const struct inode_operations efs_dir_inode_operations; | |
125 | +extern const struct file_operations efs_dir_operations; | |
126 | +extern const struct address_space_operations efs_symlink_aops; | |
127 | + | |
128 | +extern struct inode *efs_iget(struct super_block *, unsigned long); | |
129 | +extern efs_block_t efs_map_block(struct inode *, efs_block_t); | |
130 | +extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | |
131 | + | |
132 | +extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); | |
133 | +extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid, | |
134 | + int fh_len, int fh_type); | |
135 | +extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, | |
136 | + int fh_len, int fh_type); | |
137 | +extern struct dentry *efs_get_parent(struct dentry *); | |
138 | +extern int efs_bmap(struct inode *, int); | |
139 | + | |
140 | +#endif /* _EFS_EFS_H_ */ |
fs/efs/file.c
fs/efs/inode.c
... | ... | @@ -7,11 +7,11 @@ |
7 | 7 | * and from work (c) 1998 Mike Shaver. |
8 | 8 | */ |
9 | 9 | |
10 | -#include <linux/efs_fs.h> | |
11 | -#include <linux/efs_fs_sb.h> | |
12 | 10 | #include <linux/buffer_head.h> |
13 | 11 | #include <linux/module.h> |
14 | 12 | #include <linux/fs.h> |
13 | +#include "efs.h" | |
14 | +#include <linux/efs_fs_sb.h> | |
15 | 15 | |
16 | 16 | static int efs_readpage(struct file *file, struct page *page) |
17 | 17 | { |
fs/efs/namei.c
... | ... | @@ -8,9 +8,9 @@ |
8 | 8 | |
9 | 9 | #include <linux/buffer_head.h> |
10 | 10 | #include <linux/string.h> |
11 | -#include <linux/efs_fs.h> | |
12 | 11 | #include <linux/smp_lock.h> |
13 | 12 | #include <linux/exportfs.h> |
13 | +#include "efs.h" | |
14 | 14 | |
15 | 15 | |
16 | 16 | static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) { |
fs/efs/super.c
... | ... | @@ -8,13 +8,14 @@ |
8 | 8 | |
9 | 9 | #include <linux/init.h> |
10 | 10 | #include <linux/module.h> |
11 | -#include <linux/efs_fs.h> | |
12 | -#include <linux/efs_vh.h> | |
13 | -#include <linux/efs_fs_sb.h> | |
14 | 11 | #include <linux/exportfs.h> |
15 | 12 | #include <linux/slab.h> |
16 | 13 | #include <linux/buffer_head.h> |
17 | 14 | #include <linux/vfs.h> |
15 | + | |
16 | +#include "efs.h" | |
17 | +#include <linux/efs_vh.h> | |
18 | +#include <linux/efs_fs_sb.h> | |
18 | 19 | |
19 | 20 | static int efs_statfs(struct dentry *dentry, struct kstatfs *buf); |
20 | 21 | static int efs_fill_super(struct super_block *s, void *d, int silent); |
fs/efs/symlink.c
... | ... | @@ -7,10 +7,10 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <linux/string.h> |
10 | -#include <linux/efs_fs.h> | |
11 | 10 | #include <linux/pagemap.h> |
12 | 11 | #include <linux/buffer_head.h> |
13 | 12 | #include <linux/smp_lock.h> |
13 | +#include "efs.h" | |
14 | 14 | |
15 | 15 | static int efs_symlink_readpage(struct file *file, struct page *page) |
16 | 16 | { |
include/linux/efs_dir.h
1 | -/* | |
2 | - * efs_dir.h | |
3 | - * | |
4 | - * Copyright (c) 1999 Al Smith | |
5 | - */ | |
6 | - | |
7 | -#ifndef __EFS_DIR_H__ | |
8 | -#define __EFS_DIR_H__ | |
9 | - | |
10 | -#define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS | |
11 | -#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS) | |
12 | - | |
13 | -struct efs_dentry { | |
14 | - __be32 inode; | |
15 | - unsigned char namelen; | |
16 | - char name[3]; | |
17 | -}; | |
18 | - | |
19 | -#define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1) | |
20 | -#define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1) | |
21 | - | |
22 | -#define EFS_DIRBLK_HEADERSIZE 4 | |
23 | -#define EFS_DIRBLK_MAGIC 0xbeef /* moo */ | |
24 | - | |
25 | -struct efs_dir { | |
26 | - __be16 magic; | |
27 | - unsigned char firstused; | |
28 | - unsigned char slots; | |
29 | - | |
30 | - unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE]; | |
31 | -}; | |
32 | - | |
33 | -#define EFS_MAXENTS \ | |
34 | - ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / \ | |
35 | - (EFS_DENTSIZE + sizeof(char))) | |
36 | - | |
37 | -#define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot]) | |
38 | - | |
39 | -#define EFS_REALOFF(offset) ((offset << 1)) | |
40 | - | |
41 | -#endif /* __EFS_DIR_H__ */ |
include/linux/efs_fs.h
1 | -/* | |
2 | - * efs_fs.h | |
3 | - * | |
4 | - * Copyright (c) 1999 Al Smith | |
5 | - * | |
6 | - * Portions derived from work (c) 1995,1996 Christian Vogelgsang. | |
7 | - */ | |
8 | - | |
9 | -#ifndef __EFS_FS_H__ | |
10 | -#define __EFS_FS_H__ | |
11 | - | |
12 | -#define EFS_VERSION "1.0a" | |
13 | - | |
14 | -static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>"; | |
15 | - | |
16 | -#include <asm/uaccess.h> | |
17 | - | |
18 | -/* 1 block is 512 bytes */ | |
19 | -#define EFS_BLOCKSIZE_BITS 9 | |
20 | -#define EFS_BLOCKSIZE (1 << EFS_BLOCKSIZE_BITS) | |
21 | - | |
22 | -#include <linux/fs.h> | |
23 | -#include <linux/efs_fs_i.h> | |
24 | -#include <linux/efs_fs_sb.h> | |
25 | -#include <linux/efs_dir.h> | |
26 | - | |
27 | -static inline struct efs_inode_info *INODE_INFO(struct inode *inode) | |
28 | -{ | |
29 | - return container_of(inode, struct efs_inode_info, vfs_inode); | |
30 | -} | |
31 | - | |
32 | -static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb) | |
33 | -{ | |
34 | - return sb->s_fs_info; | |
35 | -} | |
36 | - | |
37 | -struct statfs; | |
38 | -struct fid; | |
39 | - | |
40 | -extern const struct inode_operations efs_dir_inode_operations; | |
41 | -extern const struct file_operations efs_dir_operations; | |
42 | -extern const struct address_space_operations efs_symlink_aops; | |
43 | - | |
44 | -extern struct inode *efs_iget(struct super_block *, unsigned long); | |
45 | -extern efs_block_t efs_map_block(struct inode *, efs_block_t); | |
46 | -extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | |
47 | - | |
48 | -extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); | |
49 | -extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid, | |
50 | - int fh_len, int fh_type); | |
51 | -extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, | |
52 | - int fh_len, int fh_type); | |
53 | -extern struct dentry *efs_get_parent(struct dentry *); | |
54 | -extern int efs_bmap(struct inode *, int); | |
55 | - | |
56 | -#endif /* __EFS_FS_H__ */ |
include/linux/efs_fs_i.h
1 | -/* | |
2 | - * efs_fs_i.h | |
3 | - * | |
4 | - * Copyright (c) 1999 Al Smith | |
5 | - * | |
6 | - * Portions derived from IRIX header files (c) 1988 Silicon Graphics | |
7 | - */ | |
8 | - | |
9 | -#ifndef __EFS_FS_I_H__ | |
10 | -#define __EFS_FS_I_H__ | |
11 | - | |
12 | -typedef int32_t efs_block_t; | |
13 | -typedef uint32_t efs_ino_t; | |
14 | - | |
15 | -#define EFS_DIRECTEXTENTS 12 | |
16 | - | |
17 | -/* | |
18 | - * layout of an extent, in memory and on disk. 8 bytes exactly. | |
19 | - */ | |
20 | -typedef union extent_u { | |
21 | - unsigned char raw[8]; | |
22 | - struct extent_s { | |
23 | - unsigned int ex_magic:8; /* magic # (zero) */ | |
24 | - unsigned int ex_bn:24; /* basic block */ | |
25 | - unsigned int ex_length:8; /* numblocks in this extent */ | |
26 | - unsigned int ex_offset:24; /* logical offset into file */ | |
27 | - } cooked; | |
28 | -} efs_extent; | |
29 | - | |
30 | -typedef struct edevs { | |
31 | - __be16 odev; | |
32 | - __be32 ndev; | |
33 | -} efs_devs; | |
34 | - | |
35 | -/* | |
36 | - * extent based filesystem inode as it appears on disk. The efs inode | |
37 | - * is exactly 128 bytes long. | |
38 | - */ | |
39 | -struct efs_dinode { | |
40 | - __be16 di_mode; /* mode and type of file */ | |
41 | - __be16 di_nlink; /* number of links to file */ | |
42 | - __be16 di_uid; /* owner's user id */ | |
43 | - __be16 di_gid; /* owner's group id */ | |
44 | - __be32 di_size; /* number of bytes in file */ | |
45 | - __be32 di_atime; /* time last accessed */ | |
46 | - __be32 di_mtime; /* time last modified */ | |
47 | - __be32 di_ctime; /* time created */ | |
48 | - __be32 di_gen; /* generation number */ | |
49 | - __be16 di_numextents; /* # of extents */ | |
50 | - u_char di_version; /* version of inode */ | |
51 | - u_char di_spare; /* spare - used by AFS */ | |
52 | - union di_addr { | |
53 | - efs_extent di_extents[EFS_DIRECTEXTENTS]; | |
54 | - efs_devs di_dev; /* device for IFCHR/IFBLK */ | |
55 | - } di_u; | |
56 | -}; | |
57 | - | |
58 | -/* efs inode storage in memory */ | |
59 | -struct efs_inode_info { | |
60 | - int numextents; | |
61 | - int lastextent; | |
62 | - | |
63 | - efs_extent extents[EFS_DIRECTEXTENTS]; | |
64 | - struct inode vfs_inode; | |
65 | -}; | |
66 | - | |
67 | -#endif /* __EFS_FS_I_H__ */ |