patch-2.1.58 linux/include/linux/smb_fs.h

Next file: linux/include/linux/smb_fs_i.h
Previous file: linux/include/linux/proc_fs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.57/linux/include/linux/smb_fs.h linux/include/linux/smb_fs.h
@@ -9,6 +9,7 @@
 #ifndef _LINUX_SMB_FS_H
 #define _LINUX_SMB_FS_H
 
+#include <linux/dirent.h>
 #include <linux/smb.h>
 
 /*
@@ -71,30 +72,24 @@
 
 /* linux/fs/smbfs/dir.c */
 extern struct inode_operations smb_dir_inode_operations;
-struct smb_inode_info *smb_find_inode(struct smb_sb_info *server, ino_t ino);
-void smb_free_inode_info(struct smb_inode_info *i);
-void smb_free_all_inodes(struct smb_sb_info *server);
-void smb_init_root(struct smb_sb_info *server);
-int  smb_stat_root(struct smb_sb_info *server);
-void smb_init_dir_cache(void);
-void smb_invalid_dir_cache(struct inode *);
-void smb_free_dir_cache(void);
+void smb_init_root(struct smb_sb_info *);
+int  smb_stat_root(struct smb_sb_info *);
+void smb_renew_times(struct dentry *);
 
 /* linux/fs/smbfs/ioctl.c */
 int smb_ioctl (struct inode * inode, struct file * filp,
                unsigned int cmd, unsigned long arg);
 
 /* linux/fs/smbfs/inode.c */
-struct super_block *smb_read_super(struct super_block *sb,
-                                   void *raw_data, int silent);
+struct super_block *smb_read_super(struct super_block *, void *, int);
 extern int init_smb_fs(void);
-void smb_invalidate_inodes(struct smb_sb_info *server);
-int smb_revalidate_inode(struct inode *i);
-int smb_refresh_inode(struct inode *i);
-int smb_notify_change(struct inode *inode, struct iattr *attr);
-void smb_invalidate_connection(struct smb_sb_info *server);
-int smb_conn_is_valid(struct smb_sb_info *server);
-unsigned long smb_invent_inos(unsigned long n);
+void smb_invalidate_inodes(struct smb_sb_info *);
+int  smb_revalidate_inode(struct inode *);
+int  smb_refresh_inode(struct inode *);
+int  smb_notify_change(struct inode *, struct iattr *);
+void smb_invalidate_connection(struct smb_sb_info *);
+int  smb_conn_is_valid(struct smb_sb_info *);
+unsigned long smb_invent_inos(unsigned long);
 struct inode *smb_iget(struct super_block *, struct smb_fattr *);
 
 /* linux/fs/smbfs/proc.c */
@@ -105,6 +100,7 @@
 int smb_offerconn(struct smb_sb_info *server);
 int smb_newconn(struct smb_sb_info *server, struct smb_conn_opt *opt);
 int smb_close(struct inode *);
+void smb_close_dentry(struct dentry *);
 int smb_open(struct dentry *, int);
 static inline int
 smb_is_open(struct inode *i)
@@ -112,34 +108,31 @@
 	return (i->u.smbfs_i.open == SMB_SERVER(i)->generation);
 }
 
-int smb_proc_read(struct inode *, off_t, long, char *);
+int smb_proc_read(struct inode *, off_t, int, char *);
 int smb_proc_write(struct inode *, off_t, int, const char *);
 int smb_proc_create(struct dentry *, struct qstr *, __u16, time_t);
 int smb_proc_mv(struct dentry *, struct qstr *, struct dentry *, struct qstr *);
 int smb_proc_mkdir(struct dentry *, struct qstr *);
 int smb_proc_rmdir(struct dentry *, struct qstr *);
 int smb_proc_unlink(struct dentry *dir, struct qstr *);
-int smb_proc_readdir(struct dentry *dir, int fpos, int cache_size, struct smb_dirent *entry);
-int smb_proc_getattr(struct dentry *dir, struct qstr *name,
-		     struct smb_fattr *entry);
-int smb_proc_setattr(struct smb_sb_info *server,
-                     struct dentry *dir,
-                     struct smb_fattr *new_finfo);
-int smb_proc_dskattr(struct super_block *sb, struct statfs *attr);
-int smb_proc_reconnect(struct smb_sb_info *server);
-int smb_proc_connect(struct smb_sb_info *server);
-int smb_proc_disconnect(struct smb_sb_info *server);
-int smb_proc_trunc(struct smb_sb_info *server, __u16 fid, __u32 length);
+int smb_proc_readdir(struct dentry *, int, void *);
+int smb_proc_getattr(struct dentry *, struct qstr *, struct smb_fattr *);
+int smb_proc_setattr(struct smb_sb_info *, struct dentry *, struct smb_fattr *);
+int smb_proc_dskattr(struct super_block *, struct statfs *);
+int smb_proc_reconnect(struct smb_sb_info *);
+int smb_proc_connect(struct smb_sb_info *);
+int smb_proc_disconnect(struct smb_sb_info *);
+int smb_proc_trunc(struct smb_sb_info *, __u16, __u32);
 void smb_init_root_dirent(struct smb_sb_info *server, struct smb_fattr *);
 
 /* linux/fs/smbfs/sock.c */
+int smb_valid_socket(struct inode *);
+void smb_close_socket(struct smb_sb_info *);
 int smb_release(struct smb_sb_info *server);
 int smb_connect(struct smb_sb_info *server);
 int smb_request(struct smb_sb_info *server);
-int smb_request_read_raw(struct smb_sb_info *server,
-                         unsigned char *target, int max_len);
-int smb_request_write_raw(struct smb_sb_info *server,
-                          unsigned const char *source, int length);
+int smb_request_read_raw(struct smb_sb_info *, unsigned char *, int);
+int smb_request_write_raw(struct smb_sb_info *, unsigned const char *, int);
 int smb_catch_keepalive(struct smb_sb_info *server);
 int smb_dont_catch_keepalive(struct smb_sb_info *server);
 int smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command,
@@ -150,6 +143,72 @@
 
 /* linux/fs/smbfs/mmap.c */
 int smb_mmap(struct file * file, struct vm_area_struct * vma);
+
+/* fs/smbfs/cache.c */
+
+/*
+ * The cache index describes the pages mapped starting
+ * at offset PAGE_SIZE.  We keep only a minimal amount
+ * of information here.
+ */
+struct cache_index {
+	unsigned short num_entries;
+	unsigned short space;
+	struct cache_block * block;
+};
+
+#define NINDEX (PAGE_SIZE-64)/sizeof(struct cache_index)
+/*
+ * The cache head is mapped as the page at offset 0.
+ */
+struct cache_head {
+	int	valid;
+	int	status;		/* error code or 0 */
+	int	entries;	/* total entries */
+	int	pages;		/* number of data pages */
+	int	idx;		/* index of current data page */
+	struct cache_index index[NINDEX];
+};
+
+/*
+ * An array of cache_entry structures holds information
+ * for each object in the cache_block.
+ */
+struct cache_entry {
+	ino_t ino;
+	unsigned short namelen;
+	unsigned short offset;
+};
+
+/*
+ * The cache blocks hold the actual data.  The entry table grows up
+ * while the names grow down, and we have space until they meet.
+ */
+struct cache_block {
+	union {
+		struct cache_entry table[1];
+		char	names[PAGE_SIZE];
+	} cb_data;
+};
+
+/*
+ * To return an entry, we can pass a reference to the
+ * name instead of having to copy it.
+ */
+struct cache_dirent {
+	ino_t ino;
+	unsigned long pos;
+	int len;
+	char * name;
+};
+
+struct cache_head * smb_get_dircache(struct dentry *);
+void smb_init_dircache(struct cache_head *);
+void smb_free_dircache(struct cache_head *);
+int  smb_refill_dircache(struct cache_head *, struct dentry *);
+void smb_add_to_cache(struct cache_head *, struct dirent *, off_t);
+int  smb_find_in_cache(struct cache_head *, off_t, struct cache_dirent *);
+void smb_invalid_dir_cache(struct inode *);
 
 #endif /* __KERNEL__ */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov