aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-02-22 06:39:12 -0500
committerJan Kara <jack@suse.cz>2008-04-17 08:22:23 -0400
commit15aebd2866b21a568d8defec134bf29f9aea9088 (patch)
tree7b697a462e3ff1bedeaaa7cf9a4441ae504c7a07
parentb1e321266d8797b21eac433b11458ac65b098938 (diff)
udf: move headers out include/linux/
There's really no reason to keep udf headers in include/linux as they're not used by anything but fs/udf/. This patch merges most of include/linux/udf_fs_i.h into fs/udf/udf_i.h, include/linux/udf_fs_sb.h into fs/udf/udf_sb.h and include/linux/udf_fs.h into fs/udf/udfdecl.h. The only thing remaining in include/linux/ is a stub of udf_fs_i.h defining the four user-visible udf ioctls. It's also moved from unifdef-y to headers-y because it can be included unconditionally now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/file.c1
-rw-r--r--fs/udf/ialloc.c1
-rw-r--r--fs/udf/lowlevel.c1
-rw-r--r--fs/udf/misc.c1
-rw-r--r--fs/udf/partition.c1
-rw-r--r--fs/udf/super.c1
-rw-r--r--fs/udf/symlink.c1
-rw-r--r--fs/udf/truncate.c1
-rw-r--r--fs/udf/udf_i.h30
-rw-r--r--fs/udf/udf_sb.h93
-rw-r--r--fs/udf/udfdecl.h25
-rw-r--r--fs/udf/unicode.c1
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/udf_fs.h51
-rw-r--r--include/linux/udf_fs_i.h31
-rw-r--r--include/linux/udf_fs_sb.h117
16 files changed, 142 insertions, 216 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 822cc4071527..0ed6e146a0d9 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -27,7 +27,6 @@
27 27
28#include "udfdecl.h" 28#include "udfdecl.h"
29#include <linux/fs.h> 29#include <linux/fs.h>
30#include <linux/udf_fs.h>
31#include <asm/uaccess.h> 30#include <asm/uaccess.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/string.h> /* memset */ 32#include <linux/string.h> /* memset */
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c
index 84360315aca2..c3fb28eee646 100644
--- a/fs/udf/ialloc.c
+++ b/fs/udf/ialloc.c
@@ -21,7 +21,6 @@
21#include "udfdecl.h" 21#include "udfdecl.h"
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/quotaops.h> 23#include <linux/quotaops.h>
24#include <linux/udf_fs.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/slab.h> 25#include <linux/slab.h>
27 26
diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c
index 579bae71e67e..703843f30ffd 100644
--- a/fs/udf/lowlevel.c
+++ b/fs/udf/lowlevel.c
@@ -23,7 +23,6 @@
23#include <linux/cdrom.h> 23#include <linux/cdrom.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25 25
26#include <linux/udf_fs.h>
27#include "udf_sb.h" 26#include "udf_sb.h"
28 27
29unsigned int udf_get_last_session(struct super_block *sb) 28unsigned int udf_get_last_session(struct super_block *sb)
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index a1d6da0caf71..581b6e4cc591 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -23,7 +23,6 @@
23 23
24#include <linux/fs.h> 24#include <linux/fs.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/udf_fs.h>
27#include <linux/buffer_head.h> 26#include <linux/buffer_head.h>
28 27
29#include "udf_i.h" 28#include "udf_i.h"
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index fc533345ab89..307c9c33d184 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -24,7 +24,6 @@
24 24
25#include <linux/fs.h> 25#include <linux/fs.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/udf_fs.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
29#include <linux/buffer_head.h> 28#include <linux/buffer_head.h>
30 29
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 53e1d6e6dd31..02815e92553b 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -57,7 +57,6 @@
57#include <linux/seq_file.h> 57#include <linux/seq_file.h>
58#include <asm/byteorder.h> 58#include <asm/byteorder.h>
59 59
60#include <linux/udf_fs.h>
61#include "udf_sb.h" 60#include "udf_sb.h"
62#include "udf_i.h" 61#include "udf_i.h"
63 62
diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index 6ec99221e50c..c3265e1385d4 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -23,7 +23,6 @@
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/fs.h> 25#include <linux/fs.h>
26#include <linux/udf_fs.h>
27#include <linux/time.h> 26#include <linux/time.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/stat.h> 28#include <linux/stat.h>
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index fe61be17cdab..6111d97902d7 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -22,7 +22,6 @@
22#include "udfdecl.h" 22#include "udfdecl.h"
23#include <linux/fs.h> 23#include <linux/fs.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/udf_fs.h>
26#include <linux/buffer_head.h> 25#include <linux/buffer_head.h>
27 26
28#include "udf_i.h" 27#include "udf_i.h"
diff --git a/fs/udf/udf_i.h b/fs/udf/udf_i.h
index ccc52f16bf7d..d6d9a774a1c1 100644
--- a/fs/udf/udf_i.h
+++ b/fs/udf/udf_i.h
@@ -1,10 +1,32 @@
1#ifndef __LINUX_UDF_I_H 1#ifndef _UDF_I_H
2#define __LINUX_UDF_I_H 2#define _UDF_I_H
3
4struct udf_inode_info {
5 struct timespec i_crtime;
6 /* Physical address of inode */
7 kernel_lb_addr i_location;
8 __u64 i_unique;
9 __u32 i_lenEAttr;
10 __u32 i_lenAlloc;
11 __u64 i_lenExtents;
12 __u32 i_next_alloc_block;
13 __u32 i_next_alloc_goal;
14 unsigned i_alloc_type : 3;
15 unsigned i_efe : 1;
16 unsigned i_use : 1;
17 unsigned i_strat4096 : 1;
18 unsigned reserved : 26;
19 union {
20 short_ad *i_sad;
21 long_ad *i_lad;
22 __u8 *i_data;
23 } i_ext;
24 struct inode vfs_inode;
25};
3 26
4#include <linux/udf_fs_i.h>
5static inline struct udf_inode_info *UDF_I(struct inode *inode) 27static inline struct udf_inode_info *UDF_I(struct inode *inode)
6{ 28{
7 return list_entry(inode, struct udf_inode_info, vfs_inode); 29 return list_entry(inode, struct udf_inode_info, vfs_inode);
8} 30}
9 31
10#endif /* !defined(_LINUX_UDF_I_H) */ 32#endif /* _UDF_I_H) */
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 737d1c604eea..fb2a6e9f8dac 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_UDF_SB_H 1#ifndef __LINUX_UDF_SB_H
2#define __LINUX_UDF_SB_H 2#define __LINUX_UDF_SB_H
3 3
4#include <linux/mutex.h>
5
4/* Since UDF 2.01 is ISO 13346 based... */ 6/* Since UDF 2.01 is ISO 13346 based... */
5#define UDF_SUPER_MAGIC 0x15013346 7#define UDF_SUPER_MAGIC 0x15013346
6 8
@@ -38,6 +40,97 @@
38#define UDF_PART_FLAG_REWRITABLE 0x0040 40#define UDF_PART_FLAG_REWRITABLE 0x0040
39#define UDF_PART_FLAG_OVERWRITABLE 0x0080 41#define UDF_PART_FLAG_OVERWRITABLE 0x0080
40 42
43#define UDF_MAX_BLOCK_LOADED 8
44
45#define UDF_TYPE1_MAP15 0x1511U
46#define UDF_VIRTUAL_MAP15 0x1512U
47#define UDF_VIRTUAL_MAP20 0x2012U
48#define UDF_SPARABLE_MAP15 0x1522U
49
50#pragma pack(1) /* XXX(hch): Why? This file just defines in-core structures */
51
52struct udf_sparing_data {
53 __u16 s_packet_len;
54 struct buffer_head *s_spar_map[4];
55};
56
57struct udf_virtual_data {
58 __u32 s_num_entries;
59 __u16 s_start_offset;
60};
61
62struct udf_bitmap {
63 __u32 s_extLength;
64 __u32 s_extPosition;
65 __u16 s_nr_groups;
66 struct buffer_head **s_block_bitmap;
67};
68
69struct udf_part_map {
70 union {
71 struct udf_bitmap *s_bitmap;
72 struct inode *s_table;
73 } s_uspace;
74 union {
75 struct udf_bitmap *s_bitmap;
76 struct inode *s_table;
77 } s_fspace;
78 __u32 s_partition_root;
79 __u32 s_partition_len;
80 __u16 s_partition_type;
81 __u16 s_partition_num;
82 union {
83 struct udf_sparing_data s_sparing;
84 struct udf_virtual_data s_virtual;
85 } s_type_specific;
86 __u32 (*s_partition_func)(struct super_block *, __u32, __u16, __u32);
87 __u16 s_volumeseqnum;
88 __u16 s_partition_flags;
89};
90
91#pragma pack()
92
93struct udf_sb_info {
94 struct udf_part_map *s_partmaps;
95 __u8 s_volume_ident[32];
96
97 /* Overall info */
98 __u16 s_partitions;
99 __u16 s_partition;
100
101 /* Sector headers */
102 __s32 s_session;
103 __u32 s_anchor[4];
104 __u32 s_last_block;
105
106 struct buffer_head *s_lvid_bh;
107
108 /* Default permissions */
109 mode_t s_umask;
110 gid_t s_gid;
111 uid_t s_uid;
112
113 /* Root Info */
114 struct timespec s_record_time;
115
116 /* Fileset Info */
117 __u16 s_serial_number;
118
119 /* highest UDF revision we have recorded to this media */
120 __u16 s_udfrev;
121
122 /* Miscellaneous flags */
123 __u32 s_flags;
124
125 /* Encoding info */
126 struct nls_table *s_nls_map;
127
128 /* VAT inode */
129 struct inode *s_vat_inode;
130
131 struct mutex s_alloc_mutex;
132};
133
41static inline struct udf_sb_info *UDF_SB(struct super_block *sb) 134static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
42{ 135{
43 return sb->s_fs_info; 136 return sb->s_fs_info;
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 681dc2b66cdb..c9c75856af80 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -1,18 +1,37 @@
1#ifndef __UDF_DECL_H 1#ifndef __UDF_DECL_H
2#define __UDF_DECL_H 2#define __UDF_DECL_H
3 3
4#include <linux/udf_fs.h>
5#include "ecma_167.h" 4#include "ecma_167.h"
6#include "osta_udf.h" 5#include "osta_udf.h"
7 6
8#include <linux/fs.h> 7#include <linux/fs.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/udf_fs_i.h>
11#include <linux/udf_fs_sb.h>
12#include <linux/buffer_head.h> 9#include <linux/buffer_head.h>
10#include <linux/udf_fs_i.h>
13 11
12#include "udf_sb.h"
14#include "udfend.h" 13#include "udfend.h"
15 14
15#define UDF_PREALLOCATE
16#define UDF_DEFAULT_PREALLOC_BLOCKS 8
17
18#undef UDFFS_DEBUG
19
20#ifdef UDFFS_DEBUG
21#define udf_debug(f, a...) \
22do { \
23 printk(KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
24 __FILE__, __LINE__, __func__); \
25 printk(f, ##a); \
26} while (0)
27#else
28#define udf_debug(f, a...) /**/
29#endif
30
31#define udf_info(f, a...) \
32 printk(KERN_INFO "UDF-fs INFO " f, ##a);
33
34
16#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) 35#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
17#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) 36#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
18 37
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c
index e533b11703bf..b9de050ad830 100644
--- a/fs/udf/unicode.c
+++ b/fs/udf/unicode.c
@@ -23,7 +23,6 @@
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/string.h> /* for memset */ 24#include <linux/string.h> /* for memset */
25#include <linux/nls.h> 25#include <linux/nls.h>
26#include <linux/udf_fs.h>
27 26
28#include "udf_sb.h" 27#include "udf_sb.h"
29 28
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index aada32fffec2..897d84e04985 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -149,6 +149,7 @@ header-y += tiocl.h
149header-y += tipc.h 149header-y += tipc.h
150header-y += tipc_config.h 150header-y += tipc_config.h
151header-y += toshiba.h 151header-y += toshiba.h
152header-y += udf_fs_i.h
152header-y += ultrasound.h 153header-y += ultrasound.h
153header-y += un.h 154header-y += un.h
154header-y += utime.h 155header-y += utime.h
@@ -336,7 +337,6 @@ unifdef-y += time.h
336unifdef-y += timex.h 337unifdef-y += timex.h
337unifdef-y += tty.h 338unifdef-y += tty.h
338unifdef-y += types.h 339unifdef-y += types.h
339unifdef-y += udf_fs_i.h
340unifdef-y += udp.h 340unifdef-y += udp.h
341unifdef-y += uinput.h 341unifdef-y += uinput.h
342unifdef-y += uio.h 342unifdef-y += uio.h
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
deleted file mode 100644
index aa88654eb76b..000000000000
--- a/include/linux/udf_fs.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * udf_fs.h
3 *
4 * PURPOSE
5 * Included by fs/filesystems.c
6 *
7 * DESCRIPTION
8 * OSTA-UDF(tm) = Optical Storage Technology Association
9 * Universal Disk Format.
10 *
11 * This code is based on version 2.50 of the UDF specification,
12 * and revision 3 of the ECMA 167 standard [equivalent to ISO 13346].
13 * http://www.osta.org/ * http://www.ecma.ch/
14 * http://www.iso.org/
15 *
16 * COPYRIGHT
17 * This file is distributed under the terms of the GNU General Public
18 * License (GPL). Copies of the GPL can be obtained from:
19 * ftp://prep.ai.mit.edu/pub/gnu/GPL
20 * Each contributing author retains all rights to their own work.
21 *
22 * (C) 1999-2004 Ben Fennema
23 * (C) 1999-2000 Stelias Computing Inc
24 *
25 * HISTORY
26 *
27 */
28
29#ifndef _UDF_FS_H
30#define _UDF_FS_H 1
31
32#define UDF_PREALLOCATE
33#define UDF_DEFAULT_PREALLOC_BLOCKS 8
34
35#undef UDFFS_DEBUG
36
37#ifdef UDFFS_DEBUG
38#define udf_debug(f, a...) \
39 do { \
40 printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
41 __FILE__, __LINE__, __FUNCTION__); \
42 printk (f, ##a); \
43 } while (0)
44#else
45#define udf_debug(f, a...) /**/
46#endif
47
48#define udf_info(f, a...) \
49 printk (KERN_INFO "UDF-fs INFO " f, ##a);
50
51#endif /* _UDF_FS_H */
diff --git a/include/linux/udf_fs_i.h b/include/linux/udf_fs_i.h
index ffaf05679ffb..3536965913b0 100644
--- a/include/linux/udf_fs_i.h
+++ b/include/linux/udf_fs_i.h
@@ -9,41 +9,10 @@
9 * ftp://prep.ai.mit.edu/pub/gnu/GPL 9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 * Each contributing author retains all rights to their own work. 10 * Each contributing author retains all rights to their own work.
11 */ 11 */
12
13#ifndef _UDF_FS_I_H 12#ifndef _UDF_FS_I_H
14#define _UDF_FS_I_H 1 13#define _UDF_FS_I_H 1
15 14
16#ifdef __KERNEL__
17
18struct udf_inode_info
19{
20 struct timespec i_crtime;
21 /* Physical address of inode */
22 kernel_lb_addr i_location;
23 __u64 i_unique;
24 __u32 i_lenEAttr;
25 __u32 i_lenAlloc;
26 __u64 i_lenExtents;
27 __u32 i_next_alloc_block;
28 __u32 i_next_alloc_goal;
29 unsigned i_alloc_type : 3;
30 unsigned i_efe : 1;
31 unsigned i_use : 1;
32 unsigned i_strat4096 : 1;
33 unsigned reserved : 26;
34 union
35 {
36 short_ad *i_sad;
37 long_ad *i_lad;
38 __u8 *i_data;
39 } i_ext;
40 struct inode vfs_inode;
41};
42
43#endif
44
45/* exported IOCTLs, we have 'l', 0x40-0x7f */ 15/* exported IOCTLs, we have 'l', 0x40-0x7f */
46
47#define UDF_GETEASIZE _IOR('l', 0x40, int) 16#define UDF_GETEASIZE _IOR('l', 0x40, int)
48#define UDF_GETEABLOCK _IOR('l', 0x41, void *) 17#define UDF_GETEABLOCK _IOR('l', 0x41, void *)
49#define UDF_GETVOLIDENT _IOR('l', 0x42, void *) 18#define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h
deleted file mode 100644
index 9bc47352b6b4..000000000000
--- a/include/linux/udf_fs_sb.h
+++ /dev/null
@@ -1,117 +0,0 @@
1/*
2 * udf_fs_sb.h
3 *
4 * This include file is for the Linux kernel/module.
5 *
6 * COPYRIGHT
7 * This file is distributed under the terms of the GNU General Public
8 * License (GPL). Copies of the GPL can be obtained from:
9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 * Each contributing author retains all rights to their own work.
11 */
12
13#ifndef _UDF_FS_SB_H
14#define _UDF_FS_SB_H 1
15
16#include <linux/mutex.h>
17
18#pragma pack(1)
19
20#define UDF_MAX_BLOCK_LOADED 8
21
22#define UDF_TYPE1_MAP15 0x1511U
23#define UDF_VIRTUAL_MAP15 0x1512U
24#define UDF_VIRTUAL_MAP20 0x2012U
25#define UDF_SPARABLE_MAP15 0x1522U
26
27struct udf_sparing_data
28{
29 __u16 s_packet_len;
30 struct buffer_head *s_spar_map[4];
31};
32
33struct udf_virtual_data
34{
35 __u32 s_num_entries;
36 __u16 s_start_offset;
37};
38
39struct udf_bitmap
40{
41 __u32 s_extLength;
42 __u32 s_extPosition;
43 __u16 s_nr_groups;
44 struct buffer_head **s_block_bitmap;
45};
46
47struct udf_part_map
48{
49 union
50 {
51 struct udf_bitmap *s_bitmap;
52 struct inode *s_table;
53 } s_uspace;
54 union
55 {
56 struct udf_bitmap *s_bitmap;
57 struct inode *s_table;
58 } s_fspace;
59 __u32 s_partition_root;
60 __u32 s_partition_len;
61 __u16 s_partition_type;
62 __u16 s_partition_num;
63 union
64 {
65 struct udf_sparing_data s_sparing;
66 struct udf_virtual_data s_virtual;
67 } s_type_specific;
68 __u32 (*s_partition_func)(struct super_block *, __u32, __u16, __u32);
69 __u16 s_volumeseqnum;
70 __u16 s_partition_flags;
71};
72
73#pragma pack()
74
75struct udf_sb_info
76{
77 struct udf_part_map *s_partmaps;
78 __u8 s_volume_ident[32];
79
80 /* Overall info */
81 __u16 s_partitions;
82 __u16 s_partition;
83
84 /* Sector headers */
85 __s32 s_session;
86 __u32 s_anchor[4];
87 __u32 s_last_block;
88
89 struct buffer_head *s_lvid_bh;
90
91 /* Default permissions */
92 mode_t s_umask;
93 gid_t s_gid;
94 uid_t s_uid;
95
96 /* Root Info */
97 struct timespec s_record_time;
98
99 /* Fileset Info */
100 __u16 s_serial_number;
101
102 /* highest UDF revision we have recorded to this media */
103 __u16 s_udfrev;
104
105 /* Miscellaneous flags */
106 __u32 s_flags;
107
108 /* Encoding info */
109 struct nls_table *s_nls_map;
110
111 /* VAT inode */
112 struct inode *s_vat_inode;
113
114 struct mutex s_alloc_mutex;
115};
116
117#endif /* _UDF_FS_SB_H */