ncp_fs.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #include <linux/ncp_fs.h>
  2. #include "ncp_fs_i.h"
  3. #include "ncp_fs_sb.h"
  4. #undef NCPFS_PARANOIA
  5. #ifdef NCPFS_PARANOIA
  6. #define ncp_vdbg(fmt, ...) \
  7. pr_debug(fmt, ##__VA_ARGS__)
  8. #else
  9. #define ncp_vdbg(fmt, ...) \
  10. do { \
  11. if (0) \
  12. pr_debug(fmt, ##__VA_ARGS__); \
  13. } while (0)
  14. #endif
  15. #ifndef DEBUG_NCP
  16. #define DEBUG_NCP 0
  17. #endif
  18. #if DEBUG_NCP > 0 && !defined(DEBUG)
  19. #define DEBUG
  20. #endif
  21. #define ncp_dbg(level, fmt, ...) \
  22. do { \
  23. if (level <= DEBUG_NCP) \
  24. pr_debug(fmt, ##__VA_ARGS__); \
  25. } while (0)
  26. #define NCP_MAX_RPC_TIMEOUT (6*HZ)
  27. struct ncp_entry_info {
  28. struct nw_info_struct i;
  29. ino_t ino;
  30. int opened;
  31. int access;
  32. unsigned int volume;
  33. __u8 file_handle[6];
  34. };
  35. static inline struct ncp_server *NCP_SBP(const struct super_block *sb)
  36. {
  37. return sb->s_fs_info;
  38. }
  39. #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
  40. static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode)
  41. {
  42. return container_of(inode, struct ncp_inode_info, vfs_inode);
  43. }
  44. /* linux/fs/ncpfs/inode.c */
  45. int ncp_notify_change(struct dentry *, struct iattr *);
  46. struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
  47. void ncp_update_inode(struct inode *, struct ncp_entry_info *);
  48. void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
  49. /* linux/fs/ncpfs/dir.c */
  50. extern const struct inode_operations ncp_dir_inode_operations;
  51. extern const struct file_operations ncp_dir_operations;
  52. extern const struct dentry_operations ncp_dentry_operations;
  53. int ncp_conn_logged_in(struct super_block *);
  54. int ncp_date_dos2unix(__le16 time, __le16 date);
  55. void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
  56. /* linux/fs/ncpfs/ioctl.c */
  57. long ncp_ioctl(struct file *, unsigned int, unsigned long);
  58. long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
  59. /* linux/fs/ncpfs/sock.c */
  60. int ncp_request2(struct ncp_server *server, int function,
  61. void* reply, int max_reply_size);
  62. static inline int ncp_request(struct ncp_server *server, int function) {
  63. return ncp_request2(server, function, server->packet, server->packet_size);
  64. }
  65. int ncp_connect(struct ncp_server *server);
  66. int ncp_disconnect(struct ncp_server *server);
  67. void ncp_lock_server(struct ncp_server *server);
  68. void ncp_unlock_server(struct ncp_server *server);
  69. /* linux/fs/ncpfs/symlink.c */
  70. #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
  71. extern const struct address_space_operations ncp_symlink_aops;
  72. int ncp_symlink(struct inode*, struct dentry*, const char*);
  73. #endif
  74. /* linux/fs/ncpfs/file.c */
  75. extern const struct inode_operations ncp_file_inode_operations;
  76. extern const struct file_operations ncp_file_operations;
  77. int ncp_make_open(struct inode *, int);
  78. /* linux/fs/ncpfs/mmap.c */
  79. int ncp_mmap(struct file *, struct vm_area_struct *);
  80. /* linux/fs/ncpfs/ncplib_kernel.c */
  81. int ncp_make_closed(struct inode *);
  82. #include "ncplib_kernel.h"