Commit 15aebd2866b21a568d8defec134bf29f9aea9088

Authored by Christoph Hellwig
Committed by Jan Kara
1 parent b1e321266d

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>

Showing 16 changed files with 142 additions and 216 deletions Side-by-side Diff

... ... @@ -27,7 +27,6 @@
27 27  
28 28 #include "udfdecl.h"
29 29 #include <linux/fs.h>
30   -#include <linux/udf_fs.h>
31 30 #include <asm/uaccess.h>
32 31 #include <linux/kernel.h>
33 32 #include <linux/string.h> /* memset */
... ... @@ -21,7 +21,6 @@
21 21 #include "udfdecl.h"
22 22 #include <linux/fs.h>
23 23 #include <linux/quotaops.h>
24   -#include <linux/udf_fs.h>
25 24 #include <linux/sched.h>
26 25 #include <linux/slab.h>
27 26  
... ... @@ -23,7 +23,6 @@
23 23 #include <linux/cdrom.h>
24 24 #include <asm/uaccess.h>
25 25  
26   -#include <linux/udf_fs.h>
27 26 #include "udf_sb.h"
28 27  
29 28 unsigned int udf_get_last_session(struct super_block *sb)
... ... @@ -23,7 +23,6 @@
23 23  
24 24 #include <linux/fs.h>
25 25 #include <linux/string.h>
26   -#include <linux/udf_fs.h>
27 26 #include <linux/buffer_head.h>
28 27  
29 28 #include "udf_i.h"
... ... @@ -24,7 +24,6 @@
24 24  
25 25 #include <linux/fs.h>
26 26 #include <linux/string.h>
27   -#include <linux/udf_fs.h>
28 27 #include <linux/slab.h>
29 28 #include <linux/buffer_head.h>
30 29  
... ... @@ -57,7 +57,6 @@
57 57 #include <linux/seq_file.h>
58 58 #include <asm/byteorder.h>
59 59  
60   -#include <linux/udf_fs.h>
61 60 #include "udf_sb.h"
62 61 #include "udf_i.h"
63 62  
... ... @@ -23,7 +23,6 @@
23 23 #include <asm/uaccess.h>
24 24 #include <linux/errno.h>
25 25 #include <linux/fs.h>
26   -#include <linux/udf_fs.h>
27 26 #include <linux/time.h>
28 27 #include <linux/mm.h>
29 28 #include <linux/stat.h>
... ... @@ -22,7 +22,6 @@
22 22 #include "udfdecl.h"
23 23 #include <linux/fs.h>
24 24 #include <linux/mm.h>
25   -#include <linux/udf_fs.h>
26 25 #include <linux/buffer_head.h>
27 26  
28 27 #include "udf_i.h"
1   -#ifndef __LINUX_UDF_I_H
2   -#define __LINUX_UDF_I_H
  1 +#ifndef _UDF_I_H
  2 +#define _UDF_I_H
3 3  
4   -#include <linux/udf_fs_i.h>
  4 +struct 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 +};
  26 +
5 27 static inline struct udf_inode_info *UDF_I(struct inode *inode)
6 28 {
7 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) */
1 1 #ifndef __LINUX_UDF_SB_H
2 2 #define __LINUX_UDF_SB_H
3 3  
  4 +#include <linux/mutex.h>
  5 +
4 6 /* Since UDF 2.01 is ISO 13346 based... */
5 7 #define UDF_SUPER_MAGIC 0x15013346
6 8  
... ... @@ -37,6 +39,97 @@
37 39 #define UDF_PART_FLAG_WRITE_ONCE 0x0020
38 40 #define UDF_PART_FLAG_REWRITABLE 0x0040
39 41 #define UDF_PART_FLAG_OVERWRITABLE 0x0080
  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 +
  52 +struct udf_sparing_data {
  53 + __u16 s_packet_len;
  54 + struct buffer_head *s_spar_map[4];
  55 +};
  56 +
  57 +struct udf_virtual_data {
  58 + __u32 s_num_entries;
  59 + __u16 s_start_offset;
  60 +};
  61 +
  62 +struct udf_bitmap {
  63 + __u32 s_extLength;
  64 + __u32 s_extPosition;
  65 + __u16 s_nr_groups;
  66 + struct buffer_head **s_block_bitmap;
  67 +};
  68 +
  69 +struct 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 +
  93 +struct 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 +};
40 133  
41 134 static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
42 135 {
1 1 #ifndef __UDF_DECL_H
2 2 #define __UDF_DECL_H
3 3  
4   -#include <linux/udf_fs.h>
5 4 #include "ecma_167.h"
6 5 #include "osta_udf.h"
7 6  
8 7 #include <linux/fs.h>
9 8 #include <linux/types.h>
10   -#include <linux/udf_fs_i.h>
11   -#include <linux/udf_fs_sb.h>
12 9 #include <linux/buffer_head.h>
  10 +#include <linux/udf_fs_i.h>
13 11  
  12 +#include "udf_sb.h"
14 13 #include "udfend.h"
  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...) \
  22 +do { \
  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 +
15 34  
16 35 #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
17 36 #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
... ... @@ -23,7 +23,6 @@
23 23 #include <linux/kernel.h>
24 24 #include <linux/string.h> /* for memset */
25 25 #include <linux/nls.h>
26   -#include <linux/udf_fs.h>
27 26  
28 27 #include "udf_sb.h"
29 28  
include/linux/Kbuild
... ... @@ -149,6 +149,7 @@
149 149 header-y += tipc.h
150 150 header-y += tipc_config.h
151 151 header-y += toshiba.h
  152 +header-y += udf_fs_i.h
152 153 header-y += ultrasound.h
153 154 header-y += un.h
154 155 header-y += utime.h
... ... @@ -336,7 +337,6 @@
336 337 unifdef-y += timex.h
337 338 unifdef-y += tty.h
338 339 unifdef-y += types.h
339   -unifdef-y += udf_fs_i.h
340 340 unifdef-y += udp.h
341 341 unifdef-y += uinput.h
342 342 unifdef-y += uio.h
include/linux/udf_fs.h
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 */
include/linux/udf_fs_i.h
... ... @@ -9,41 +9,10 @@
9 9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 10 * Each contributing author retains all rights to their own work.
11 11 */
12   -
13 12 #ifndef _UDF_FS_I_H
14 13 #define _UDF_FS_I_H 1
15 14  
16   -#ifdef __KERNEL__
17   -
18   -struct 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 15 /* exported IOCTLs, we have 'l', 0x40-0x7f */
46   -
47 16 #define UDF_GETEASIZE _IOR('l', 0x40, int)
48 17 #define UDF_GETEABLOCK _IOR('l', 0x41, void *)
49 18 #define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
include/linux/udf_fs_sb.h
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   -
27   -struct udf_sparing_data
28   -{
29   - __u16 s_packet_len;
30   - struct buffer_head *s_spar_map[4];
31   -};
32   -
33   -struct udf_virtual_data
34   -{
35   - __u32 s_num_entries;
36   - __u16 s_start_offset;
37   -};
38   -
39   -struct 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   -
47   -struct 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   -
75   -struct 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 */