smb_fs_sb.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  smb_fs_sb.h
  3.  *
  4.  *  Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
  5.  *  Copyright (C) 1997 by Volker Lendecke
  6.  *
  7.  */
  8. #ifndef _SMB_FS_SB
  9. #define _SMB_FS_SB
  10. #ifdef __KERNEL__
  11. #include <linux/types.h>
  12. #include <linux/smb.h>
  13. /* structure access macros */
  14. #define server_from_inode(inode) (&(inode)->i_sb->u.smbfs_sb)
  15. #define server_from_dentry(dentry) (&(dentry)->d_sb->u.smbfs_sb)
  16. #define SB_of(server) ((struct super_block *) ((char *)(server) - 
  17. (unsigned long)(&((struct super_block *)0)->u.smbfs_sb)))
  18. struct smb_sb_info {
  19.         enum smb_conn_state state;
  20. struct file * sock_file;
  21.         struct smb_mount_data_kernel *mnt;
  22.         unsigned char *temp_buf;
  23. /* Connections are counted. Each time a new socket arrives,
  24.  * generation is incremented.
  25.  */
  26. unsigned int generation;
  27. pid_t conn_pid;
  28. struct smb_conn_opt opt;
  29. struct semaphore sem;
  30. wait_queue_head_t wait;
  31. __u32              packet_size;
  32. unsigned char *    packet;
  33.         unsigned short     rcls; /* The error codes we received */
  34.         unsigned short     err;
  35.         /* We use our own data_ready callback, but need the original one */
  36.         void *data_ready;
  37. /* nls pointers for codepage conversions */
  38. struct nls_table *remote_nls;
  39. struct nls_table *local_nls;
  40. /* utf8 can make strings longer so we can't do in-place conversion.
  41.    This is a buffer for temporary stuff. We only need one so no need
  42.    to put it on the stack. This points to temp_buf space. */
  43. char *name_buf;
  44. int (*convert)(char *, int, const char *, int,
  45.        struct nls_table *, struct nls_table *);
  46. };
  47. static inline void
  48. smb_lock_server(struct smb_sb_info *server)
  49. {
  50. down(&(server->sem));
  51. }
  52. static inline void
  53. smb_unlock_server(struct smb_sb_info *server)
  54. {
  55. up(&(server->sem));
  56. }
  57. #endif /* __KERNEL__ */
  58. #endif