diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/smb_fs_sb.h | |
download | linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.gz linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.bz2 linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.zip |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/smb_fs_sb.h')
-rw-r--r-- | include/linux/smb_fs_sb.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h new file mode 100644 index 000000000000..5b4ae2cc445c --- /dev/null +++ b/include/linux/smb_fs_sb.h @@ -0,0 +1,101 @@ +/* + * smb_fs_sb.h + * + * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke + * Copyright (C) 1997 by Volker Lendecke + * + */ + +#ifndef _SMB_FS_SB +#define _SMB_FS_SB + +#ifdef __KERNEL__ + +#include <linux/types.h> +#include <linux/smb.h> + +/* + * Upper limit on the total number of active smb_request structs. + */ +#define MAX_REQUEST_HARD 256 + +enum smb_receive_state { + SMB_RECV_START, /* No data read, looking for length + sig */ + SMB_RECV_HEADER, /* Reading the header data */ + SMB_RECV_HCOMPLETE, /* Done with the header */ + SMB_RECV_PARAM, /* Reading parameter words */ + SMB_RECV_DATA, /* Reading data bytes */ + SMB_RECV_END, /* End of request */ + SMB_RECV_DROP, /* Dropping this SMB */ + SMB_RECV_REQUEST, /* Received a request and not a reply */ +}; + +/* structure access macros */ +#define server_from_inode(inode) SMB_SB((inode)->i_sb) +#define server_from_dentry(dentry) SMB_SB((dentry)->d_sb) +#define SB_of(server) ((server)->super_block) + +struct smb_sb_info { + /* List of all smbfs superblocks */ + struct list_head entry; + + enum smb_conn_state state; + struct file * sock_file; + int conn_error; + enum smb_receive_state rstate; + + atomic_t nr_requests; + struct list_head xmitq; + struct list_head recvq; + u16 mid; + + struct smb_mount_data_kernel *mnt; + + /* Connections are counted. Each time a new socket arrives, + * generation is incremented. + */ + unsigned int generation; + pid_t conn_pid; + struct smb_conn_opt opt; + wait_queue_head_t conn_wq; + int conn_complete; + struct semaphore sem; + + unsigned char header[SMB_HEADER_LEN + 20*2 + 2]; + u32 header_len; + u32 smb_len; + u32 smb_read; + + /* We use our own data_ready callback, but need the original one */ + void *data_ready; + + /* nls pointers for codepage conversions */ + struct nls_table *remote_nls; + struct nls_table *local_nls; + + struct smb_ops *ops; + + struct super_block *super_block; +}; + +static inline int +smb_lock_server_interruptible(struct smb_sb_info *server) +{ + return down_interruptible(&(server->sem)); +} + +static inline void +smb_lock_server(struct smb_sb_info *server) +{ + down(&(server->sem)); +} + +static inline void +smb_unlock_server(struct smb_sb_info *server) +{ + up(&(server->sem)); +} + +#endif /* __KERNEL__ */ + +#endif |