internal.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 const 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. #ifdef AFS_CACHING_SUPPORT
  66. extern int afs_cache_get_page_cookie(struct page *page,
  67. struct cachefs_page **_page_cookie);
  68. #endif
  69. /*
  70. * inode.c
  71. */
  72. extern int afs_iget(struct super_block *sb, struct afs_fid *fid,
  73. struct inode **_inode);
  74. extern int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry,
  75. struct kstat *stat);
  76. extern void afs_clear_inode(struct inode *inode);
  77. /*
  78. * key_afs.c
  79. */
  80. #ifdef CONFIG_KEYS
  81. extern int afs_key_register(void);
  82. extern void afs_key_unregister(void);
  83. #endif
  84. /*
  85. * main.c
  86. */
  87. #ifdef AFS_CACHING_SUPPORT
  88. extern struct cachefs_netfs afs_cache_netfs;
  89. #endif
  90. /*
  91. * mntpt.c
  92. */
  93. extern struct inode_operations afs_mntpt_inode_operations;
  94. extern const struct file_operations afs_mntpt_file_operations;
  95. extern struct afs_timer afs_mntpt_expiry_timer;
  96. extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
  97. extern unsigned long afs_mntpt_expiry_timeout;
  98. extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
  99. /*
  100. * super.c
  101. */
  102. extern int afs_fs_init(void);
  103. extern void afs_fs_exit(void);
  104. #define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))
  105. extern struct list_head afs_cb_hash_tbl[];
  106. extern spinlock_t afs_cb_hash_lock;
  107. #define afs_cb_hash(SRV,FID) \
  108. afs_cb_hash_tbl[((unsigned long)(SRV) + \
  109. (FID)->vid + (FID)->vnode + (FID)->unique) % \
  110. AFS_CB_HASH_COUNT]
  111. /*
  112. * proc.c
  113. */
  114. extern int afs_proc_init(void);
  115. extern void afs_proc_cleanup(void);
  116. extern int afs_proc_cell_setup(struct afs_cell *cell);
  117. extern void afs_proc_cell_remove(struct afs_cell *cell);
  118. #endif /* AFS_INTERNAL_H */