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 #define NCP_IOC_NCPREQUEST              _IOR('n', 1, unsigned char *)
  30 #define NCP_IOC_GETMOUNTUID             _IOR('u', 1, uid_t)
  31 
  32 /*
  33  * The packet size to allocate. One page should be enough.
  34  */
  35 #define NCP_PACKET_SIZE 4070
  36 
  37 #define NCP_MAXPATHLEN 255
  38 #define NCP_MAXNAMELEN 14
  39 
  40 #ifdef __KERNEL__
  41 
  42 /* The readdir cache size controls how many directory entries are
  43  * cached.
  44  */
  45 #define NCP_READDIR_CACHE_SIZE        64
  46 
  47 
  48 #define NCP_MAX_RPC_TIMEOUT (60) /* 6 seconds */
  49 
  50 /* Guess, what 0x564c is :-) */
  51 #define NCP_SUPER_MAGIC  0x564c
  52 
  53 
  54 #define NCP_SBP(sb)          ((struct ncp_server *)((sb)->u.generic_sbp))
  55 #define NCP_INOP(inode)      ((struct ncp_inode_info *)((inode)->u.generic_ip))
  56 
  57 #define NCP_SERVER(inode)    NCP_SBP((inode)->i_sb)
  58 #define NCP_FINFO(inode)     (&(NCP_INOP(inode)->finfo))
  59 #define NCP_ISTRUCT(inode)   (&(NCP_FINFO(inode)->i))
  60 
  61 #ifdef DEBUG_NCP_MALLOC
  62 
  63 #include <linux/malloc.h>
  64 
  65 extern int ncp_malloced;
  66 extern int ncp_current_malloced;
  67 
  68 static inline void *
  69 ncp_kmalloc(unsigned int size, int priority)
     /* [previous][next][first][last][top][bottom][index][help] */
  70 {
  71         ncp_malloced += 1;
  72         ncp_current_malloced += 1;
  73         return kmalloc(size, priority);
  74 }
  75 
  76 static inline void
  77 ncp_kfree_s(void *obj, int size)
     /* [previous][next][first][last][top][bottom][index][help] */
  78 {
  79         ncp_current_malloced -= 1;
  80         kfree_s(obj, size);
  81 }
  82 
  83 #else /* DEBUG_NCP_MALLOC */
  84 
  85 #define ncp_kmalloc(s,p) kmalloc(s,p)
  86 #define ncp_kfree_s(o,s) kfree_s(o,s)
  87 
  88 #endif /* DEBUG_NCP_MALLOC */
  89 
  90 #if DEBUG_NCP > 0
  91 #define DPRINTK(format, args...) printk(format , ## args)
  92 #else
  93 #define DPRINTK(format, args...)
  94 #endif
  95 
  96 #if DEBUG_NCP > 1
  97 #define DDPRINTK(format, args...) printk(format , ## args)
  98 #else
  99 #define DDPRINTK(format, args...)
 100 #endif
 101 
 102 
 103 /* linux/fs/ncpfs/file.c */
 104 extern struct inode_operations ncp_file_inode_operations;
 105 int ncp_make_open(struct inode *i, int right);
 106 
 107 /* linux/fs/ncpfs/dir.c */
 108 extern struct inode_operations ncp_dir_inode_operations;
 109 void ncp_free_inode_info(struct ncp_inode_info *i);
 110 void ncp_free_all_inodes(struct ncp_server *server);
 111 void ncp_init_root(struct ncp_server *server);
 112 int  ncp_stat_root(struct ncp_server *server);
 113 void ncp_init_dir_cache(void);
 114 void ncp_invalid_dir_cache(unsigned long ino);
 115 void ncp_invalidate_all_inodes(struct ncp_server *server);
 116 void ncp_free_dir_cache(void);
 117 int  ncp_date_dos2unix(__u16 time, __u16 date);
 118 void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
 119 
 120 
 121 /* linux/fs/ncpfs/ioctl.c */
 122 int ncp_ioctl (struct inode * inode, struct file * filp,
 123                unsigned int cmd, unsigned long arg);
 124 
 125 /* linux/fs/ncpfs/inode.c */
 126 struct super_block *ncp_read_super(struct super_block *sb,
 127                                    void *raw_data, int silent);
 128 void ncp_invalidate_connection(struct ncp_server *server);
 129 int ncp_conn_is_valid(struct ncp_server *server);
 130 
 131 /* linux/fs/ncpfs/sock.c */
 132 int ncp_request(struct ncp_server *server, int function);
 133 int ncp_connect(struct ncp_server *server);
 134 int ncp_disconnect(struct ncp_server *server);
 135 int ncp_catch_watchdog(struct ncp_server *server);
 136 int ncp_dont_catch_watchdog(struct ncp_server *server);
 137 void ncp_lock_server(struct ncp_server *server);
 138 void ncp_unlock_server(struct ncp_server *server);
 139 
 140 /* linux/fs/ncpfs/mmap.c */
 141 int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
 142 
 143 #endif /* __KERNEL__ */
 144 
 145 #endif /* _LINUX_NCP_FS_H */

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