Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / afs / internal.h
1 /* internal.h: internal AFS stuff
2  *
3  * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells (dhowells@redhat.com)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version
9  * 2 of the License, or (at your option) any later version.
10  */
11
12 #ifndef AFS_INTERNAL_H
13 #define AFS_INTERNAL_H
14
15 #include <linux/compiler.h>
16 #include <linux/kernel.h>
17 #include <linux/fs.h>
18 #include <linux/pagemap.h>
19 #include <linux/fscache.h>
20
21 /*
22  * debug tracing
23  */
24 #define __kdbg(FMT, a...)       printk("[%05d] "FMT"\n", current->pid , ## a)
25 #define kenter(FMT, a...)       __kdbg("==> %s("FMT")", __FUNCTION__ , ## a)
26 #define kleave(FMT, a...)       __kdbg("<== %s()"FMT, __FUNCTION__ , ## a)
27 #define kdebug(FMT, a...)       __kdbg(FMT , ## a)
28 #define kproto(FMT, a...)       __kdbg("### "FMT , ## a)
29 #define knet(FMT, a...)         __kdbg(FMT , ## a)
30
31 #ifdef __KDEBUG
32 #define _enter(FMT, a...)       kenter(FMT , ## a)
33 #define _leave(FMT, a...)       kleave(FMT , ## a)
34 #define _debug(FMT, a...)       kdebug(FMT , ## a)
35 #define _proto(FMT, a...)       kproto(FMT , ## a)
36 #define _net(FMT, a...)         knet(FMT , ## a)
37 #else
38 #define _enter(FMT, a...)       do { } while(0)
39 #define _leave(FMT, a...)       do { } while(0)
40 #define _debug(FMT, a...)       do { } while(0)
41 #define _proto(FMT, a...)       do { } while(0)
42 #define _net(FMT, a...)         do { } while(0)
43 #endif
44
45 static inline void afs_discard_my_signals(void)
46 {
47         while (signal_pending(current)) {
48                 siginfo_t sinfo;
49
50                 spin_lock_irq(&current->sighand->siglock);
51                 dequeue_signal(current,&current->blocked, &sinfo);
52                 spin_unlock_irq(&current->sighand->siglock);
53         }
54 }
55
56 /*
57  * cell.c
58  */
59 extern struct rw_semaphore afs_proc_cells_sem;
60 extern struct list_head afs_proc_cells;
61
62 /*
63  * dir.c
64  */
65 extern struct inode_operations afs_dir_inode_operations;
66 extern const struct file_operations afs_dir_file_operations;
67
68 /*
69  * file.c
70  */
71 extern const struct address_space_operations afs_fs_aops;
72 extern struct inode_operations afs_file_inode_operations;
73 extern const struct file_operations afs_file_file_operations;
74
75 /*
76  * inode.c
77  */
78 extern int afs_iget(struct super_block *sb, struct afs_fid *fid,
79                     struct inode **_inode);
80 extern int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry,
81                              struct kstat *stat);
82 extern void afs_clear_inode(struct inode *inode);
83
84 /*
85  * key_afs.c
86  */
87 #ifdef CONFIG_KEYS
88 extern int afs_key_register(void);
89 extern void afs_key_unregister(void);
90 #endif
91
92 /*
93  * main.c
94  */
95 #ifdef CONFIG_AFS_FSCACHE
96 extern struct fscache_netfs afs_cache_netfs;
97 #endif
98
99 /*
100  * mntpt.c
101  */
102 extern struct inode_operations afs_mntpt_inode_operations;
103 extern const struct file_operations afs_mntpt_file_operations;
104 extern struct afs_timer afs_mntpt_expiry_timer;
105 extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
106 extern unsigned long afs_mntpt_expiry_timeout;
107
108 extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
109
110 /*
111  * super.c
112  */
113 extern int afs_fs_init(void);
114 extern void afs_fs_exit(void);
115
116 #define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))
117
118 extern struct list_head afs_cb_hash_tbl[];
119 extern spinlock_t afs_cb_hash_lock;
120
121 #define afs_cb_hash(SRV,FID) \
122         afs_cb_hash_tbl[((unsigned long)(SRV) + \
123                         (FID)->vid + (FID)->vnode + (FID)->unique) % \
124                         AFS_CB_HASH_COUNT]
125
126 /*
127  * proc.c
128  */
129 extern int afs_proc_init(void);
130 extern void afs_proc_cleanup(void);
131 extern int afs_proc_cell_setup(struct afs_cell *cell);
132 extern void afs_proc_cell_remove(struct afs_cell *cell);
133
134 #endif /* AFS_INTERNAL_H */