diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 16:36:09 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 20:02:48 -0500 |
commit | 31a203df9c109480fc6d48ba0a68763e89199acb (patch) | |
tree | 6f7f1f839a7d3e3e9010baf10468a33c3ad675ba /fs | |
parent | 9501e4c48e1561443e1a16c2c9917ec6c63118a4 (diff) |
take coda-private headers out of include/linux
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/coda/cache.c | 5 | ||||
-rw-r--r-- | fs/coda/cnode.c | 3 | ||||
-rw-r--r-- | fs/coda/coda_cache.h | 22 | ||||
-rw-r--r-- | fs/coda/coda_fs_i.h | 58 | ||||
-rw-r--r-- | fs/coda/coda_linux.c | 3 | ||||
-rw-r--r-- | fs/coda/coda_linux.h | 101 | ||||
-rw-r--r-- | fs/coda/dir.c | 5 | ||||
-rw-r--r-- | fs/coda/file.c | 3 | ||||
-rw-r--r-- | fs/coda/inode.c | 5 | ||||
-rw-r--r-- | fs/coda/pioctl.c | 4 | ||||
-rw-r--r-- | fs/coda/psdev.c | 4 | ||||
-rw-r--r-- | fs/coda/symlink.c | 4 | ||||
-rw-r--r-- | fs/coda/upcall.c | 5 |
13 files changed, 198 insertions, 24 deletions
diff --git a/fs/coda/cache.c b/fs/coda/cache.c index 5525e1c660fd..690157876184 100644 --- a/fs/coda/cache.c +++ b/fs/coda/cache.c | |||
@@ -20,10 +20,9 @@ | |||
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | 21 | ||
22 | #include <linux/coda.h> | 22 | #include <linux/coda.h> |
23 | #include <linux/coda_linux.h> | ||
24 | #include <linux/coda_psdev.h> | 23 | #include <linux/coda_psdev.h> |
25 | #include <linux/coda_fs_i.h> | 24 | #include "coda_linux.h" |
26 | #include <linux/coda_cache.h> | 25 | #include "coda_cache.h" |
27 | 26 | ||
28 | static atomic_t permission_epoch = ATOMIC_INIT(0); | 27 | static atomic_t permission_epoch = ATOMIC_INIT(0); |
29 | 28 | ||
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c index 602240569c89..6475877b0763 100644 --- a/fs/coda/cnode.c +++ b/fs/coda/cnode.c | |||
@@ -7,9 +7,8 @@ | |||
7 | #include <linux/time.h> | 7 | #include <linux/time.h> |
8 | 8 | ||
9 | #include <linux/coda.h> | 9 | #include <linux/coda.h> |
10 | #include <linux/coda_linux.h> | ||
11 | #include <linux/coda_fs_i.h> | ||
12 | #include <linux/coda_psdev.h> | 10 | #include <linux/coda_psdev.h> |
11 | #include "coda_linux.h" | ||
13 | 12 | ||
14 | static inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2) | 13 | static inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2) |
15 | { | 14 | { |
diff --git a/fs/coda/coda_cache.h b/fs/coda/coda_cache.h new file mode 100644 index 000000000000..c910b5eb1ceb --- /dev/null +++ b/fs/coda/coda_cache.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Coda filesystem -- Linux Minicache | ||
2 | * | ||
3 | * Copyright (C) 1989 - 1997 Carnegie Mellon University | ||
4 | * | ||
5 | * Carnegie Mellon University encourages users of this software to | ||
6 | * contribute improvements to the Coda project. Contact Peter Braam | ||
7 | * <coda@cs.cmu.edu> | ||
8 | */ | ||
9 | |||
10 | #ifndef _CFSNC_HEADER_ | ||
11 | #define _CFSNC_HEADER_ | ||
12 | |||
13 | /* credential cache */ | ||
14 | void coda_cache_enter(struct inode *inode, int mask); | ||
15 | void coda_cache_clear_inode(struct inode *); | ||
16 | void coda_cache_clear_all(struct super_block *sb); | ||
17 | int coda_cache_check(struct inode *inode, int mask); | ||
18 | |||
19 | /* for downcalls and attributes and lookups */ | ||
20 | void coda_flag_inode_children(struct inode *inode, int flag); | ||
21 | |||
22 | #endif /* _CFSNC_HEADER_ */ | ||
diff --git a/fs/coda/coda_fs_i.h b/fs/coda/coda_fs_i.h new file mode 100644 index 000000000000..e35071b1de0e --- /dev/null +++ b/fs/coda/coda_fs_i.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * coda_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1998 Carnegie Mellon University | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_CODA_FS_I | ||
9 | #define _LINUX_CODA_FS_I | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/list.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/coda.h> | ||
15 | |||
16 | /* | ||
17 | * coda fs inode data | ||
18 | * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and | ||
19 | * c_cached_perm. | ||
20 | * vfs_inode is set only when the inode is created and never changes. | ||
21 | * c_fid is set when the inode is created and should be considered immutable. | ||
22 | */ | ||
23 | struct coda_inode_info { | ||
24 | struct CodaFid c_fid; /* Coda identifier */ | ||
25 | u_short c_flags; /* flags (see below) */ | ||
26 | unsigned int c_mapcount; /* nr of times this inode is mapped */ | ||
27 | unsigned int c_cached_epoch; /* epoch for cached permissions */ | ||
28 | vuid_t c_uid; /* fsuid for cached permissions */ | ||
29 | unsigned int c_cached_perm; /* cached access permissions */ | ||
30 | spinlock_t c_lock; | ||
31 | struct inode vfs_inode; | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * coda fs file private data | ||
36 | */ | ||
37 | #define CODA_MAGIC 0xC0DAC0DA | ||
38 | struct coda_file_info { | ||
39 | int cfi_magic; /* magic number */ | ||
40 | struct file *cfi_container; /* container file for this cnode */ | ||
41 | unsigned int cfi_mapcount; /* nr of times this file is mapped */ | ||
42 | }; | ||
43 | |||
44 | #define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data)) | ||
45 | |||
46 | /* flags */ | ||
47 | #define C_VATTR 0x1 /* Validity of vattr in inode */ | ||
48 | #define C_FLUSH 0x2 /* used after a flush */ | ||
49 | #define C_DYING 0x4 /* from venus (which died) */ | ||
50 | #define C_PURGE 0x8 | ||
51 | |||
52 | int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *); | ||
53 | struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr); | ||
54 | int coda_cnode_makectl(struct inode **inode, struct super_block *sb); | ||
55 | struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb); | ||
56 | void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *); | ||
57 | |||
58 | #endif | ||
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index bf4a3fd3c8e3..2bdbcc11b373 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c | |||
@@ -17,9 +17,8 @@ | |||
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | 18 | ||
19 | #include <linux/coda.h> | 19 | #include <linux/coda.h> |
20 | #include <linux/coda_linux.h> | ||
21 | #include <linux/coda_psdev.h> | 20 | #include <linux/coda_psdev.h> |
22 | #include <linux/coda_fs_i.h> | 21 | #include "coda_linux.h" |
23 | 22 | ||
24 | /* initialize the debugging variables */ | 23 | /* initialize the debugging variables */ |
25 | int coda_fake_statfs; | 24 | int coda_fake_statfs; |
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h new file mode 100644 index 000000000000..9b0c5323890b --- /dev/null +++ b/fs/coda/coda_linux.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * Coda File System, Linux Kernel module | ||
3 | * | ||
4 | * Original version, adapted from cfs_mach.c, (C) Carnegie Mellon University | ||
5 | * Linux modifications (C) 1996, Peter J. Braam | ||
6 | * Rewritten for Linux 2.1 (C) 1997 Carnegie Mellon University | ||
7 | * | ||
8 | * Carnegie Mellon University encourages users of this software to | ||
9 | * contribute improvements to the Coda project. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_CODA_FS | ||
13 | #define _LINUX_CODA_FS | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/param.h> | ||
17 | #include <linux/mm.h> | ||
18 | #include <linux/vmalloc.h> | ||
19 | #include <linux/slab.h> | ||
20 | #include <linux/wait.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/fs.h> | ||
23 | #include "coda_fs_i.h" | ||
24 | |||
25 | /* operations */ | ||
26 | extern const struct inode_operations coda_dir_inode_operations; | ||
27 | extern const struct inode_operations coda_file_inode_operations; | ||
28 | extern const struct inode_operations coda_ioctl_inode_operations; | ||
29 | |||
30 | extern const struct dentry_operations coda_dentry_operations; | ||
31 | |||
32 | extern const struct address_space_operations coda_file_aops; | ||
33 | extern const struct address_space_operations coda_symlink_aops; | ||
34 | |||
35 | extern const struct file_operations coda_dir_operations; | ||
36 | extern const struct file_operations coda_file_operations; | ||
37 | extern const struct file_operations coda_ioctl_operations; | ||
38 | |||
39 | /* operations shared over more than one file */ | ||
40 | int coda_open(struct inode *i, struct file *f); | ||
41 | int coda_release(struct inode *i, struct file *f); | ||
42 | int coda_permission(struct inode *inode, int mask, unsigned int flags); | ||
43 | int coda_revalidate_inode(struct dentry *); | ||
44 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | ||
45 | int coda_setattr(struct dentry *, struct iattr *); | ||
46 | |||
47 | /* this file: heloers */ | ||
48 | char *coda_f2s(struct CodaFid *f); | ||
49 | int coda_isroot(struct inode *i); | ||
50 | int coda_iscontrol(const char *name, size_t length); | ||
51 | |||
52 | void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); | ||
53 | void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); | ||
54 | unsigned short coda_flags_to_cflags(unsigned short); | ||
55 | |||
56 | /* sysctl.h */ | ||
57 | void coda_sysctl_init(void); | ||
58 | void coda_sysctl_clean(void); | ||
59 | |||
60 | #define CODA_ALLOC(ptr, cast, size) do { \ | ||
61 | if (size < PAGE_SIZE) \ | ||
62 | ptr = kmalloc((unsigned long) size, GFP_KERNEL); \ | ||
63 | else \ | ||
64 | ptr = (cast)vmalloc((unsigned long) size); \ | ||
65 | if (!ptr) \ | ||
66 | printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ | ||
67 | else memset( ptr, 0, size ); \ | ||
68 | } while (0) | ||
69 | |||
70 | |||
71 | #define CODA_FREE(ptr,size) \ | ||
72 | do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0) | ||
73 | |||
74 | /* inode to cnode access functions */ | ||
75 | |||
76 | static inline struct coda_inode_info *ITOC(struct inode *inode) | ||
77 | { | ||
78 | return list_entry(inode, struct coda_inode_info, vfs_inode); | ||
79 | } | ||
80 | |||
81 | static __inline__ struct CodaFid *coda_i2f(struct inode *inode) | ||
82 | { | ||
83 | return &(ITOC(inode)->c_fid); | ||
84 | } | ||
85 | |||
86 | static __inline__ char *coda_i2s(struct inode *inode) | ||
87 | { | ||
88 | return coda_f2s(&(ITOC(inode)->c_fid)); | ||
89 | } | ||
90 | |||
91 | /* this will not zap the inode away */ | ||
92 | static __inline__ void coda_flag_inode(struct inode *inode, int flag) | ||
93 | { | ||
94 | struct coda_inode_info *cii = ITOC(inode); | ||
95 | |||
96 | spin_lock(&cii->c_lock); | ||
97 | cii->c_flags |= flag; | ||
98 | spin_unlock(&cii->c_lock); | ||
99 | } | ||
100 | |||
101 | #endif | ||
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 9df71f0eb218..2b8dae4d121e 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -23,10 +23,9 @@ | |||
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
24 | 24 | ||
25 | #include <linux/coda.h> | 25 | #include <linux/coda.h> |
26 | #include <linux/coda_linux.h> | ||
27 | #include <linux/coda_psdev.h> | 26 | #include <linux/coda_psdev.h> |
28 | #include <linux/coda_fs_i.h> | 27 | #include "coda_linux.h" |
29 | #include <linux/coda_cache.h> | 28 | #include "coda_cache.h" |
30 | 29 | ||
31 | #include "coda_int.h" | 30 | #include "coda_int.h" |
32 | 31 | ||
diff --git a/fs/coda/file.c b/fs/coda/file.c index c8b50ba4366a..0433057be330 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -21,10 +21,9 @@ | |||
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | 22 | ||
23 | #include <linux/coda.h> | 23 | #include <linux/coda.h> |
24 | #include <linux/coda_linux.h> | ||
25 | #include <linux/coda_fs_i.h> | ||
26 | #include <linux/coda_psdev.h> | 24 | #include <linux/coda_psdev.h> |
27 | 25 | ||
26 | #include "coda_linux.h" | ||
28 | #include "coda_int.h" | 27 | #include "coda_int.h" |
29 | 28 | ||
30 | static ssize_t | 29 | static ssize_t |
diff --git a/fs/coda/inode.c b/fs/coda/inode.c index bd7fde2721a8..261d86f9caec 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c | |||
@@ -28,10 +28,9 @@ | |||
28 | #include <linux/vmalloc.h> | 28 | #include <linux/vmalloc.h> |
29 | 29 | ||
30 | #include <linux/coda.h> | 30 | #include <linux/coda.h> |
31 | #include <linux/coda_linux.h> | ||
32 | #include <linux/coda_psdev.h> | 31 | #include <linux/coda_psdev.h> |
33 | #include <linux/coda_fs_i.h> | 32 | #include "coda_linux.h" |
34 | #include <linux/coda_cache.h> | 33 | #include "coda_cache.h" |
35 | 34 | ||
36 | #include "coda_int.h" | 35 | #include "coda_int.h" |
37 | 36 | ||
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index 741f0bd03918..6cbb3afb36dc 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -19,10 +19,10 @@ | |||
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | 20 | ||
21 | #include <linux/coda.h> | 21 | #include <linux/coda.h> |
22 | #include <linux/coda_linux.h> | ||
23 | #include <linux/coda_fs_i.h> | ||
24 | #include <linux/coda_psdev.h> | 22 | #include <linux/coda_psdev.h> |
25 | 23 | ||
24 | #include "coda_linux.h" | ||
25 | |||
26 | /* pioctl ops */ | 26 | /* pioctl ops */ |
27 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags); | 27 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags); |
28 | static long coda_pioctl(struct file *filp, unsigned int cmd, | 28 | static long coda_pioctl(struct file *filp, unsigned int cmd, |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 62647a8595e4..8f616e0e252c 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -43,10 +43,10 @@ | |||
43 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
44 | 44 | ||
45 | #include <linux/coda.h> | 45 | #include <linux/coda.h> |
46 | #include <linux/coda_linux.h> | ||
47 | #include <linux/coda_fs_i.h> | ||
48 | #include <linux/coda_psdev.h> | 46 | #include <linux/coda_psdev.h> |
49 | 47 | ||
48 | #include "coda_linux.h" | ||
49 | |||
50 | #include "coda_int.h" | 50 | #include "coda_int.h" |
51 | 51 | ||
52 | /* statistics */ | 52 | /* statistics */ |
diff --git a/fs/coda/symlink.c b/fs/coda/symlink.c index af78f007a2b0..ab94ef63caef 100644 --- a/fs/coda/symlink.c +++ b/fs/coda/symlink.c | |||
@@ -16,9 +16,9 @@ | |||
16 | #include <linux/pagemap.h> | 16 | #include <linux/pagemap.h> |
17 | 17 | ||
18 | #include <linux/coda.h> | 18 | #include <linux/coda.h> |
19 | #include <linux/coda_linux.h> | ||
20 | #include <linux/coda_psdev.h> | 19 | #include <linux/coda_psdev.h> |
21 | #include <linux/coda_fs_i.h> | 20 | |
21 | #include "coda_linux.h" | ||
22 | 22 | ||
23 | static int coda_symlink_filler(struct file *file, struct page *page) | 23 | static int coda_symlink_filler(struct file *file, struct page *page) |
24 | { | 24 | { |
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index c3563cab9758..9727e0c52579 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c | |||
@@ -33,10 +33,9 @@ | |||
33 | #include <linux/vfs.h> | 33 | #include <linux/vfs.h> |
34 | 34 | ||
35 | #include <linux/coda.h> | 35 | #include <linux/coda.h> |
36 | #include <linux/coda_linux.h> | ||
37 | #include <linux/coda_psdev.h> | 36 | #include <linux/coda_psdev.h> |
38 | #include <linux/coda_fs_i.h> | 37 | #include "coda_linux.h" |
39 | #include <linux/coda_cache.h> | 38 | #include "coda_cache.h" |
40 | 39 | ||
41 | #include "coda_int.h" | 40 | #include "coda_int.h" |
42 | 41 | ||