root/include/linux/smb_fs.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. smb_kmalloc
  2. 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 #ifdef DEBUG_SMB_MALLOC
  54 
  55 #include <linux/malloc.h>
  56 
  57 extern int smb_malloced;
  58 extern int smb_current_malloced;
  59 
  60 static inline void *
  61 smb_kmalloc(unsigned int size, int priority)
     /* [previous][next][first][last][top][bottom][index][help] */
  62 {
  63         smb_malloced += 1;
  64         smb_current_malloced += 1;
  65         return kmalloc(size, priority);
  66 }
  67 
  68 static inline void
  69 smb_kfree_s(void *obj, int size)
     /* [previous][next][first][last][top][bottom][index][help] */
  70 {
  71         smb_current_malloced -= 1;
  72         kfree_s(obj, size);
  73 }
  74 
  75 #else /* DEBUG_SMB_MALLOC */
  76 
  77 #define smb_kmalloc(s,p) kmalloc(s,p)
  78 #define smb_kfree_s(o,s) kfree_s(o,s)
  79 
  80 #endif /* DEBUG_SMB_MALLOC */
  81 
  82 #if DEBUG_SMB > 0
  83 #define DPRINTK(format, args...) printk(format , ## args)
  84 #else
  85 #define DPRINTK(format, args...)
  86 #endif
  87 
  88 #if DEBUG_SMB > 1
  89 #define DDPRINTK(format, args...) printk(format , ## args)
  90 #else
  91 #define DDPRINTK(format, args...)
  92 #endif
  93 
  94 
  95 /* linux/fs/smbfs/file.c */
  96 extern struct inode_operations smb_file_inode_operations;
  97 int smb_make_open(struct inode *i, int right);
  98 
  99 /* linux/fs/smbfs/dir.c */
 100 extern struct inode_operations smb_dir_inode_operations;
 101 void smb_free_inode_info(struct smb_inode_info *i);
 102 void smb_free_all_inodes(struct smb_server *server);
 103 void smb_init_root(struct smb_server *server);
 104 int  smb_stat_root(struct smb_server *server);
 105 void smb_init_dir_cache(void);
 106 void smb_invalid_dir_cache(unsigned long ino);
 107 void smb_invalidate_all_inodes(struct smb_server *server);
 108 void smb_free_dir_cache(void);
 109 
 110 /* linux/fs/smbfs/ioctl.c */
 111 int smb_ioctl (struct inode * inode, struct file * filp,
 112                unsigned int cmd, unsigned long arg);
 113 
 114 /* linux/fs/smbfs/inode.c */
 115 struct super_block *smb_read_super(struct super_block *sb,
 116                                    void *raw_data, int silent);
 117 int smb_notify_change(struct inode *inode, struct iattr *attr);
 118 void smb_invalidate_connection(struct smb_server *server);
 119 int smb_conn_is_valid(struct smb_server *server);
 120 
 121 /* linux/fs/smbfs/proc.c */
 122 dword smb_len(unsigned char *packet);
 123 byte *smb_encode_smb_length(byte *p, dword len);
 124 int smb_proc_open(struct smb_server *server, const char *pathname,
 125                   int len, struct smb_dirent *entry);
 126 int smb_proc_close(struct smb_server *server, struct smb_dirent *finfo);
 127 int smb_proc_read(struct smb_server *server, struct smb_dirent *finfo, 
 128                   off_t offset, long count, char *data, int fs);
 129 int smb_proc_read_raw(struct smb_server *server, struct smb_dirent *finfo, 
 130                       off_t offset, long count, char *data);
 131 int smb_proc_write(struct smb_server *server, struct smb_dirent *finfo,
 132                    off_t offset, int count, const char *data);
 133 int smb_proc_write_raw(struct smb_server *server, struct smb_dirent *finfo, 
 134                        off_t offset, long count, const char *data);
 135 int smb_proc_create(struct smb_server *server, const char *path,
 136                     int len, struct smb_dirent *entry);
 137 int smb_proc_mknew(struct smb_server *server, const char *path, int len,
 138                    struct smb_dirent *entry);
 139 int smb_proc_mv(struct smb_server *server, const char *opath, const int olen, 
 140                 const char *npath, const int nlen);
 141 int smb_proc_mkdir(struct smb_server *server, const char *path, const int len);
 142 int smb_proc_rmdir(struct smb_server *server, const char *path, const int len);
 143 int smb_proc_unlink(struct smb_server *server, const char *path,
 144                     const int len);
 145 int smb_proc_readdir(struct smb_server *server, struct inode *dir,
 146                      int fpos, int cache_size, 
 147                      struct smb_dirent *entry);
 148 int smb_proc_getattr(struct smb_server *server, const char *path,
 149                      int len, struct smb_dirent *entry);
 150 int smb_proc_setattr(struct smb_server *server,
 151                      struct inode *ino,
 152                      struct smb_dirent *new_finfo);
 153 int smb_proc_chkpath(struct smb_server *server, char *path, int len,
 154                      int *result);
 155 int smb_proc_dskattr(struct super_block *super, struct smb_dskattr *attr);
 156 int smb_proc_reconnect(struct smb_server *server);
 157 int smb_proc_connect(struct smb_server *server);
 158 int smb_proc_disconnect(struct smb_server *server);
 159 int smb_proc_trunc(struct smb_server *server, word fid, dword length);
 160 
 161 /* linux/fs/smbfs/sock.c */
 162 int smb_release(struct smb_server *server);
 163 int smb_connect(struct smb_server *server);
 164 int smb_request(struct smb_server *server);
 165 int smb_request_read_raw(struct smb_server *server,
 166                          unsigned char *target, int max_len);
 167 int smb_request_write_raw(struct smb_server *server,
 168                           unsigned const char *source, int length);
 169 int smb_catch_keepalive(struct smb_server *server);
 170 int smb_dont_catch_keepalive(struct smb_server *server);
 171 int smb_trans2_request(struct smb_server *server,
 172                        int *data_len, int *param_len,
 173                        char **data, char **param);
 174 
 175 /* linux/fs/smbfs/mmap.c */
 176 int smb_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
 177 
 178 #endif /* __KERNEL__ */
 179 
 180 #endif /* _LINUX_SMB_FS_H */

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