root/include/linux/ncp_fs.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. ncp_kmalloc
  2. ncp_kfree_s

   1 /*
   2  *  ncp_fs.h
   3  *
   4  *  Copyright (C) 1995 by Volker Lendecke
   5  *
   6  */
   7 
   8 #ifndef _LINUX_NCP_FS_H
   9 #define _LINUX_NCP_FS_H
  10 
  11 #include <linux/fs.h>
  12 #include <linux/in.h>
  13 #include <linux/types.h>
  14 
  15 #include <linux/ncp_mount.h>
  16 #include <linux/ncp_fs_sb.h>
  17 #include <linux/ncp_fs_i.h>
  18 
  19 /*
  20  * ioctl commands
  21  */
  22 
  23 struct ncp_ioctl_request {
  24         unsigned int   function;
  25         unsigned int   size;
  26         char          *data;
  27 };
  28 
  29 struct ncp_fs_info {
  30         int    version;
  31         struct sockaddr_ipx addr;
  32         uid_t  mounted_uid;
  33         int    connection;      /* Connection number the server assigned us */
  34         int    buffer_size;     /* The negotiated buffer size, to be
  35                                    used for read/write requests! */
  36 
  37         /* Not used yet, but here some day the namespace numbers will be
  38            stored. */
  39         int    volume_number;
  40         __u32  directory_id;
  41 };      
  42 
  43 #define NCP_IOC_NCPREQUEST              _IOR('n', 1, unsigned char *)
  44 #define NCP_IOC_GETMOUNTUID             _IOR('u', 1, uid_t)
  45 
  46 #define NCP_GET_FS_INFO_VERSION (1)
  47 #define NCP_IOC_GET_FS_INFO             _IOWR('i', 1, unsigned char *)
  48 
  49 /*
  50  * The packet size to allocate. One page should be enough.
  51  */
  52 #define NCP_PACKET_SIZE 4070
  53 
  54 #define NCP_MAXPATHLEN 255
  55 #define NCP_MAXNAMELEN 14
  56 
  57 #define NCP_MSG_COMMAND "/sbin/nwmsg"
  58 
  59 #ifdef __KERNEL__
  60 
  61 /* The readdir cache size controls how many directory entries are
  62  * cached.
  63  */
  64 #define NCP_READDIR_CACHE_SIZE        64
  65 
  66 
  67 #define NCP_MAX_RPC_TIMEOUT (60) /* 6 seconds */
  68 
  69 /* Guess, what 0x564c is :-) */
  70 #define NCP_SUPER_MAGIC  0x564c
  71 
  72 
  73 #define NCP_SBP(sb)          ((struct ncp_server *)((sb)->u.generic_sbp))
  74 #define NCP_INOP(inode)      ((struct ncp_inode_info *)((inode)->u.generic_ip))
  75 
  76 #define NCP_SERVER(inode)    NCP_SBP((inode)->i_sb)
  77 #define NCP_FINFO(inode)     (&(NCP_INOP(inode)->finfo))
  78 #define NCP_ISTRUCT(inode)   (&(NCP_FINFO(inode)->i))
  79 
  80 #ifdef DEBUG_NCP_MALLOC
  81 
  82 #include <linux/malloc.h>
  83 
  84 extern int ncp_malloced;
  85 extern int ncp_current_malloced;
  86 
  87 static inline void *
  88 ncp_kmalloc(unsigned int size, int priority)
     /* [previous][next][first][last][top][bottom][index][help] */
  89 {
  90         ncp_malloced += 1;
  91         ncp_current_malloced += 1;
  92         return kmalloc(size, priority);
  93 }
  94 
  95 static inline void
  96 ncp_kfree_s(void *obj, int size)
     /* [previous][next][first][last][top][bottom][index][help] */
  97 {
  98         ncp_current_malloced -= 1;
  99         kfree_s(obj, size);
 100 }
 101 
 102 #else /* DEBUG_NCP_MALLOC */
 103 
 104 #define ncp_kmalloc(s,p) kmalloc(s,p)
 105 #define ncp_kfree_s(o,s) kfree_s(o,s)
 106 
 107 #endif /* DEBUG_NCP_MALLOC */
 108 
 109 #if DEBUG_NCP > 0
 110 #define DPRINTK(format, args...) printk(format , ## args)
 111 #else
 112 #define DPRINTK(format, args...)
 113 #endif
 114 
 115 #if DEBUG_NCP > 1
 116 #define DDPRINTK(format, args...) printk(format , ## args)
 117 #else
 118 #define DDPRINTK(format, args...)
 119 #endif
 120 
 121 
 122 /* linux/fs/ncpfs/file.c */
 123 extern struct inode_operations ncp_file_inode_operations;
 124 int ncp_make_open(struct inode *i, int right);
 125 
 126 /* linux/fs/ncpfs/dir.c */
 127 extern struct inode_operations ncp_dir_inode_operations;
 128 void ncp_free_inode_info(struct ncp_inode_info *i);
 129 void ncp_free_all_inodes(struct ncp_server *server);
 130 void ncp_init_root(struct ncp_server *server);
 131 int  ncp_stat_root(struct ncp_server *server);
 132 void ncp_init_dir_cache(void);
 133 void ncp_invalid_dir_cache(unsigned long ino);
 134 void ncp_invalidate_all_inodes(struct ncp_server *server);
 135 void ncp_free_dir_cache(void);
 136 int  ncp_date_dos2unix(__u16 time, __u16 date);
 137 void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
 138 
 139 
 140 /* linux/fs/ncpfs/ioctl.c */
 141 int ncp_ioctl (struct inode * inode, struct file * filp,
 142                unsigned int cmd, unsigned long arg);
 143 
 144 /* linux/fs/ncpfs/inode.c */
 145 struct super_block *ncp_read_super(struct super_block *sb,
 146                                    void *raw_data, int silent);
 147 extern int init_ncp_fs(void);
 148 void ncp_invalidate_connection(struct ncp_server *server);
 149 int ncp_conn_is_valid(struct ncp_server *server);
 150 void ncp_trigger_message(struct ncp_server *server);
 151 
 152 /* linux/fs/ncpfs/sock.c */
 153 int ncp_request(struct ncp_server *server, int function);
 154 int ncp_connect(struct ncp_server *server);
 155 int ncp_disconnect(struct ncp_server *server);
 156 int ncp_catch_watchdog(struct ncp_server *server);
 157 int ncp_dont_catch_watchdog(struct ncp_server *server);
 158 int ncp_catch_message(struct ncp_server *server);
 159 void ncp_lock_server(struct ncp_server *server);
 160 void ncp_unlock_server(struct ncp_server *server);
 161 
 162 /* linux/fs/ncpfs/mmap.c */
 163 int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
 164 
 165 #endif /* __KERNEL__ */
 166 
 167 #endif /* _LINUX_NCP_FS_H */

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