David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 1 | /* internal AFS stuff |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
| 20 | /* |
| 21 | * debug tracing |
| 22 | */ |
| 23 | #define kenter(FMT, a...) printk("==> %s("FMT")\n",__FUNCTION__ , ## a) |
| 24 | #define kleave(FMT, a...) printk("<== %s()"FMT"\n",__FUNCTION__ , ## a) |
| 25 | #define kdebug(FMT, a...) printk(FMT"\n" , ## a) |
| 26 | #define kproto(FMT, a...) printk("### "FMT"\n" , ## a) |
| 27 | #define knet(FMT, a...) printk(FMT"\n" , ## a) |
| 28 | |
| 29 | #ifdef __KDEBUG |
| 30 | #define _enter(FMT, a...) kenter(FMT , ## a) |
| 31 | #define _leave(FMT, a...) kleave(FMT , ## a) |
| 32 | #define _debug(FMT, a...) kdebug(FMT , ## a) |
| 33 | #define _proto(FMT, a...) kproto(FMT , ## a) |
| 34 | #define _net(FMT, a...) knet(FMT , ## a) |
| 35 | #else |
| 36 | #define _enter(FMT, a...) do { } while(0) |
| 37 | #define _leave(FMT, a...) do { } while(0) |
| 38 | #define _debug(FMT, a...) do { } while(0) |
| 39 | #define _proto(FMT, a...) do { } while(0) |
| 40 | #define _net(FMT, a...) do { } while(0) |
| 41 | #endif |
| 42 | |
| 43 | static inline void afs_discard_my_signals(void) |
| 44 | { |
| 45 | while (signal_pending(current)) { |
| 46 | siginfo_t sinfo; |
| 47 | |
| 48 | spin_lock_irq(¤t->sighand->siglock); |
| 49 | dequeue_signal(current,¤t->blocked, &sinfo); |
| 50 | spin_unlock_irq(¤t->sighand->siglock); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * cell.c |
| 56 | */ |
| 57 | extern struct rw_semaphore afs_proc_cells_sem; |
| 58 | extern struct list_head afs_proc_cells; |
| 59 | #ifdef AFS_CACHING_SUPPORT |
| 60 | extern struct cachefs_index_def afs_cache_cell_index_def; |
| 61 | #endif |
| 62 | |
| 63 | /* |
| 64 | * dir.c |
| 65 | */ |
Arjan van de Ven | 754661f | 2007-02-12 00:55:38 -0800 | [diff] [blame] | 66 | extern const struct inode_operations afs_dir_inode_operations; |
Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 67 | extern const struct file_operations afs_dir_file_operations; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
| 69 | /* |
| 70 | * file.c |
| 71 | */ |
Christoph Hellwig | f5e54d6 | 2006-06-28 04:26:44 -0700 | [diff] [blame] | 72 | extern const struct address_space_operations afs_fs_aops; |
Arjan van de Ven | 754661f | 2007-02-12 00:55:38 -0800 | [diff] [blame] | 73 | extern const struct inode_operations afs_file_inode_operations; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
| 75 | #ifdef AFS_CACHING_SUPPORT |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 76 | extern int afs_cache_get_page_cookie(struct page *, struct cachefs_page **); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | #endif |
| 78 | |
| 79 | /* |
| 80 | * inode.c |
| 81 | */ |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 82 | extern int afs_iget(struct super_block *, struct afs_fid *, struct inode **); |
| 83 | extern int afs_inode_getattr(struct vfsmount *, struct dentry *, |
| 84 | struct kstat *); |
| 85 | extern void afs_clear_inode(struct inode *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | |
| 87 | /* |
| 88 | * main.c |
| 89 | */ |
| 90 | #ifdef AFS_CACHING_SUPPORT |
| 91 | extern struct cachefs_netfs afs_cache_netfs; |
| 92 | #endif |
| 93 | |
| 94 | /* |
| 95 | * mntpt.c |
| 96 | */ |
Arjan van de Ven | 754661f | 2007-02-12 00:55:38 -0800 | [diff] [blame] | 97 | extern const struct inode_operations afs_mntpt_inode_operations; |
Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 98 | extern const struct file_operations afs_mntpt_file_operations; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | extern struct afs_timer afs_mntpt_expiry_timer; |
| 100 | extern struct afs_timer_ops afs_mntpt_expiry_timer_ops; |
| 101 | extern unsigned long afs_mntpt_expiry_timeout; |
| 102 | |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 103 | extern int afs_mntpt_check_symlink(struct afs_vnode *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | |
| 105 | /* |
| 106 | * super.c |
| 107 | */ |
| 108 | extern int afs_fs_init(void); |
| 109 | extern void afs_fs_exit(void); |
| 110 | |
| 111 | #define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head)) |
| 112 | |
| 113 | extern struct list_head afs_cb_hash_tbl[]; |
| 114 | extern spinlock_t afs_cb_hash_lock; |
| 115 | |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 116 | #define afs_cb_hash(SRV, FID) \ |
| 117 | afs_cb_hash_tbl[((unsigned long)(SRV) + \ |
| 118 | (FID)->vid + (FID)->vnode + (FID)->unique) & \ |
| 119 | (AFS_CB_HASH_COUNT - 1)] |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | |
| 121 | /* |
| 122 | * proc.c |
| 123 | */ |
| 124 | extern int afs_proc_init(void); |
| 125 | extern void afs_proc_cleanup(void); |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame^] | 126 | extern int afs_proc_cell_setup(struct afs_cell *); |
| 127 | extern void afs_proc_cell_remove(struct afs_cell *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | |
| 129 | #endif /* AFS_INTERNAL_H */ |