internal.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. #ifndef AFS_INTERNAL_H
  12. #define AFS_INTERNAL_H
  13. #include <linux/compiler.h>
  14. #include <linux/kernel.h>
  15. #include <linux/fs.h>
  16. #include <linux/pagemap.h>
  17. /*
  18. * debug tracing
  19. */
  20. #define kenter(FMT, a...) printk("==> %s("FMT")\n",__FUNCTION__ , ## a)
  21. #define kleave(FMT, a...) printk("<== %s()"FMT"\n",__FUNCTION__ , ## a)
  22. #define kdebug(FMT, a...) printk(FMT"\n" , ## a)
  23. #define kproto(FMT, a...) printk("### "FMT"\n" , ## a)
  24. #define knet(FMT, a...) printk(FMT"\n" , ## a)
  25. #ifdef __KDEBUG
  26. #define _enter(FMT, a...) kenter(FMT , ## a)
  27. #define _leave(FMT, a...) kleave(FMT , ## a)
  28. #define _debug(FMT, a...) kdebug(FMT , ## a)
  29. #define _proto(FMT, a...) kproto(FMT , ## a)
  30. #define _net(FMT, a...) knet(FMT , ## a)
  31. #else
  32. #define _enter(FMT, a...) do { } while(0)
  33. #define _leave(FMT, a...) do { } while(0)
  34. #define _debug(FMT, a...) do { } while(0)
  35. #define _proto(FMT, a...) do { } while(0)
  36. #define _net(FMT, a...) do { } while(0)
  37. #endif
  38. static inline void afs_discard_my_signals(void)
  39. {
  40. while (signal_pending(current)) {
  41. siginfo_t sinfo;
  42. spin_lock_irq(&current->sighand->siglock);
  43. dequeue_signal(current,&current->blocked, &sinfo);
  44. spin_unlock_irq(&current->sighand->siglock);
  45. }
  46. }
  47. /*
  48. * cell.c
  49. */
  50. extern struct rw_semaphore afs_proc_cells_sem;
  51. extern struct list_head afs_proc_cells;
  52. #ifdef AFS_CACHING_SUPPORT
  53. extern struct cachefs_index_def afs_cache_cell_index_def;
  54. #endif
  55. /*
  56. * dir.c
  57. */
  58. extern struct inode_operations afs_dir_inode_operations;
  59. extern struct file_operations afs_dir_file_operations;
  60. /*
  61. * file.c
  62. */
  63. extern struct address_space_operations afs_fs_aops;
  64. extern struct inode_operations afs_file_inode_operations;
  65. extern struct file_operations afs_file_file_operations;
  66. #ifdef AFS_CACHING_SUPPORT
  67. extern int afs_cache_get_page_cookie(struct page *page,
  68. struct cachefs_page **_page_cookie);
  69. #endif
  70. /*
  71. * inode.c
  72. */
  73. extern int afs_iget(struct super_block *sb, struct afs_fid *fid,
  74. struct inode **_inode);
  75. extern int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry,
  76. struct kstat *stat);
  77. extern void afs_clear_inode(struct inode *inode);
  78. /*
  79. * key_afs.c
  80. */
  81. #ifdef CONFIG_KEYS
  82. extern int afs_key_register(void);
  83. extern void afs_key_unregister(void);
  84. #endif
  85. /*
  86. * main.c
  87. */
  88. #ifdef AFS_CACHING_SUPPORT
  89. extern struct cachefs_netfs afs_cache_netfs;
  90. #endif
  91. /*
  92. * mntpt.c
  93. */
  94. extern struct inode_operations afs_mntpt_inode_operations;
  95. extern struct file_operations afs_mntpt_file_operations;
  96. extern struct afs_timer afs_mntpt_expiry_timer;
  97. extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
  98. extern unsigned long afs_mntpt_expiry_timeout;
  99. extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
  100. /*
  101. * super.c
  102. */
  103. extern int afs_fs_init(void);
  104. extern void afs_fs_exit(void);
  105. #define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))
  106. extern struct list_head afs_cb_hash_tbl[];
  107. extern spinlock_t afs_cb_hash_lock;
  108. #define afs_cb_hash(SRV,FID) \
  109. afs_cb_hash_tbl[((unsigned long)(SRV) + \
  110. (FID)->vid + (FID)->vnode + (FID)->unique) % \
  111. AFS_CB_HASH_COUNT]
  112. /*
  113. * proc.c
  114. */
  115. extern int afs_proc_init(void);
  116. extern void afs_proc_cleanup(void);
  117. extern int afs_proc_cell_setup(struct afs_cell *cell);
  118. extern void afs_proc_cell_remove(struct afs_cell *cell);
  119. #endif /* AFS_INTERNAL_H */