internal.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* 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 const struct inode_operations afs_dir_inode_operations;
  59. extern const struct file_operations afs_dir_file_operations;
  60. /*
  61. * file.c
  62. */
  63. extern const struct address_space_operations afs_fs_aops;
  64. extern const struct inode_operations afs_file_inode_operations;
  65. #ifdef AFS_CACHING_SUPPORT
  66. extern int afs_cache_get_page_cookie(struct page *, struct cachefs_page **);
  67. #endif
  68. /*
  69. * inode.c
  70. */
  71. extern int afs_iget(struct super_block *, struct afs_fid *, struct inode **);
  72. extern int afs_inode_getattr(struct vfsmount *, struct dentry *,
  73. struct kstat *);
  74. extern void afs_clear_inode(struct inode *);
  75. /*
  76. * main.c
  77. */
  78. #ifdef AFS_CACHING_SUPPORT
  79. extern struct cachefs_netfs afs_cache_netfs;
  80. #endif
  81. /*
  82. * mntpt.c
  83. */
  84. extern const struct inode_operations afs_mntpt_inode_operations;
  85. extern const struct file_operations afs_mntpt_file_operations;
  86. extern struct afs_timer afs_mntpt_expiry_timer;
  87. extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
  88. extern unsigned long afs_mntpt_expiry_timeout;
  89. extern int afs_mntpt_check_symlink(struct afs_vnode *);
  90. /*
  91. * super.c
  92. */
  93. extern int afs_fs_init(void);
  94. extern void afs_fs_exit(void);
  95. #define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))
  96. extern struct list_head afs_cb_hash_tbl[];
  97. extern spinlock_t afs_cb_hash_lock;
  98. #define afs_cb_hash(SRV, FID) \
  99. afs_cb_hash_tbl[((unsigned long)(SRV) + \
  100. (FID)->vid + (FID)->vnode + (FID)->unique) & \
  101. (AFS_CB_HASH_COUNT - 1)]
  102. /*
  103. * proc.c
  104. */
  105. extern int afs_proc_init(void);
  106. extern void afs_proc_cleanup(void);
  107. extern int afs_proc_cell_setup(struct afs_cell *);
  108. extern void afs_proc_cell_remove(struct afs_cell *);
  109. #endif /* AFS_INTERNAL_H */