root/include/linux/smb_fs.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. min
  2. smb_kmalloc
  3. smb_kfree_s

   1 /*
   2  *  smb_fs.h
   3  *
   4  *  Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
   5  *
   6  */
   7 
   8 #ifndef _LINUX_SMB_FS_H
   9 #define _LINUX_SMB_FS_H
  10 
  11 #include <linux/smb.h>
  12 #include <linux/fs.h>
  13 #include <linux/in.h>
  14 #include <linux/types.h>
  15 
  16 #include <linux/smb_mount.h>
  17 #include <linux/smb_fs_sb.h>
  18 #include <linux/smb_fs_i.h>
  19 
  20 /*
  21  * ioctl commands
  22  */
  23 #define SMB_IOC_GETMOUNTUID             _IOR('u', 1, uid_t)
  24 
  25 #ifdef __KERNEL__
  26 
  27 /*
  28  * The readdir cache size controls how many directory entries are cached.
  29  */
  30 #define SMB_READDIR_CACHE_SIZE        64
  31 
  32 /*
  33  * This defines the number of filenames cached in memory to avoid 
  34  * constructing filenames from \
  35  */
  36 #define SMB_CACHE_TABLE_SIZE          64
  37 
  38 #define SMB_SUPER_MAGIC               0x517B
  39 
  40 
  41 
  42 #define SMB_SBP(sb)          ((struct smb_sb_info *)(sb->u.generic_sbp))
  43 #define SMB_INOP(inode)      ((struct smb_inode_info *)(inode->u.generic_ip))
  44 
  45 #define SMB_SERVER(inode)    (&(SMB_SBP(inode->i_sb)->s_server))
  46 #define SMB_SERVATTR(inode)  (&(SMB_SBP(inode->i_sb)->s_attr))
  47 
  48 #define SMB_FINFO(inode)     (&(SMB_INOP(inode)->finfo))
  49 
  50 #define SMB_HEADER_LEN   37     /* includes everything up to, but not
  51                                  * including smb_bcc */
  52 
  53 static inline int min(int a, int b) {
     /* [previous][next][first][last][top][bottom][index][help] */
  54   return a<b ? a : b;
  55 }
  56 
  57 #ifdef DEBUG_SMB_MALLOC
  58 
  59 #include <linux/malloc.h>
  60 
  61 extern int smb_malloced;
  62 extern int smb_current_malloced;
  63 
  64 static inline void *
  65 smb_kmalloc(unsigned int size, int priority)
     /* [previous][next][first][last][top][bottom][index][help] */
  66 {
  67         smb_malloced += 1;
  68         smb_current_malloced += 1;
  69         return kmalloc(size, priority);
  70 }
  71 
  72 static inline void
  73 smb_kfree_s(void *obj, int size)
     /* [previous][next][first][last][top][bottom][index][help] */
  74 {
  75         smb_current_malloced -= 1;
  76         kfree_s(obj, size);
  77 }
  78 
  79 #else /* DEBUG_SMB_MALLOC */
  80 
  81 #define smb_kmalloc(s,p) kmalloc(s,p)
  82 #define smb_kfree_s(o,s) kfree_s(o,s)
  83 
  84 #endif /* DEBUG_SMB_MALLOC */
  85 
  86 #if DEBUG_SMB > 0
  87 #define DPRINTK(format, args...) printk(format , ## args)
  88 #else
  89 #define DPRINTK(format, args...)
  90 #endif
  91 
  92 #if DEBUG_SMB > 1
  93 #define DDPRINTK(format, args...) printk(format , ## args)
  94 #else
  95 #define DDPRINTK(format, args...)
  96 #endif
  97 
  98 
  99 /* linux/fs/smbfs/file.c */
 100 extern struct inode_operations smb_file_inode_operations;
 101 int smb_make_open(struct inode *i, int right);
 102 
 103 /* linux/fs/smbfs/dir.c */
 104 extern struct inode_operations smb_dir_inode_operations;
 105 void smb_free_inode_info(struct smb_inode_info *i);
 106 void smb_free_all_inodes(struct smb_server *server);
 107 void smb_init_root(struct smb_server *server);
 108 int  smb_stat_root(struct smb_server *server);
 109 void smb_init_dir_cache(void);
 110 void smb_invalid_dir_cache(unsigned long ino);
 111 void smb_invalidate_all_inodes(struct smb_server *server);
 112 void smb_free_dir_cache(void);
 113 
 114 /* linux/fs/smbfs/ioctl.c */
 115 int smb_ioctl (struct inode * inode, struct file * filp,
 116                unsigned int cmd, unsigned long arg);
 117 
 118 /* linux/fs/smbfs/inode.c */
 119 struct super_block *smb_read_super(struct super_block *sb,
 120                                    void *raw_data, int silent);
 121 int smb_notify_change(struct inode *inode, struct iattr *attr);
 122 void smb_invalidate_connection(struct smb_server *server);
 123 int smb_conn_is_valid(struct smb_server *server);
 124 
 125 /* linux/fs/smbfs/proc.c */
 126 dword smb_len(unsigned char *packet);
 127 byte *smb_encode_smb_length(byte *p, dword len);
 128 int smb_proc_open(struct smb_server *server, const char *pathname,
 129                   int len, struct smb_dirent *entry);
 130 int smb_proc_close(struct smb_server *server, struct smb_dirent *finfo);
 131 int smb_proc_read(struct smb_server *server, struct smb_dirent *finfo, 
 132                   off_t offset, long count, char *data, int fs);
 133 int smb_proc_read_raw(struct smb_server *server, struct smb_dirent *finfo, 
 134                       off_t offset, long count, char *data);
 135 int smb_proc_write(struct smb_server *server, struct smb_dirent *finfo,
 136                    off_t offset, int count, const char *data);
 137 int smb_proc_write_raw(struct smb_server *server, struct smb_dirent *finfo, 
 138                        off_t offset, long count, const char *data);
 139 int smb_proc_create(struct smb_server *server, const char *path,
 140                     int len, struct smb_dirent *entry);
 141 int smb_proc_mknew(struct smb_server *server, const char *path, int len,
 142                    struct smb_dirent *entry);
 143 int smb_proc_mv(struct smb_server *server, const char *opath, const int olen, 
 144                 const char *npath, const int nlen);
 145 int smb_proc_mkdir(struct smb_server *server, const char *path, const int len);
 146 int smb_proc_rmdir(struct smb_server *server, const char *path, const int len);
 147 int smb_proc_unlink(struct smb_server *server, const char *path,
 148                     const int len);
 149 int smb_proc_readdir(struct smb_server *server, struct inode *dir,
 150                      int fpos, int cache_size, 
 151                      struct smb_dirent *entry);
 152 int smb_proc_getattr(struct smb_server *server, const char *path,
 153                      int len, struct smb_dirent *entry);
 154 int smb_proc_setattr(struct smb_server *server,
 155                      struct inode *ino,
 156                      struct smb_dirent *new_finfo);
 157 int smb_proc_chkpath(struct smb_server *server, char *path, int len,
 158                      int *result);
 159 int smb_proc_dskattr(struct super_block *super, struct smb_dskattr *attr);
 160 int smb_proc_reconnect(struct smb_server *server);
 161 int smb_proc_connect(struct smb_server *server);
 162 int smb_proc_disconnect(struct smb_server *server);
 163 int smb_proc_trunc(struct smb_server *server, word fid, dword length);
 164 
 165 /* linux/fs/smbfs/sock.c */
 166 int smb_release(struct smb_server *server);
 167 int smb_connect(struct smb_server *server);
 168 int smb_request(struct smb_server *server);
 169 int smb_request_read_raw(struct smb_server *server,
 170                          unsigned char *target, int max_len);
 171 int smb_request_write_raw(struct smb_server *server,
 172                           unsigned const char *source, int length);
 173 int smb_catch_keepalive(struct smb_server *server);
 174 int smb_dont_catch_keepalive(struct smb_server *server);
 175 int smb_trans2_request(struct smb_server *server,
 176                        int *data_len, int *param_len,
 177                        char **data, char **param);
 178 
 179 /* linux/fs/smbfs/mmap.c */
 180 int smb_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
 181 
 182 #endif /* __KERNEL__ */
 183 
 184 #endif /* _LINUX_SMB_FS_H */

/* [previous][next][first][last][top][bottom][index][help] */