~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/sunrpc/rpc_pipe_fs.h

Version: ~ [ linux-5.16 ] ~ [ linux-5.15.13 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.90 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.170 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.224 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.261 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.296 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.298 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
  3 #define _LINUX_SUNRPC_RPC_PIPE_FS_H
  4 
  5 #include <linux/workqueue.h>
  6 
  7 struct rpc_pipe_dir_head {
  8         struct list_head pdh_entries;
  9         struct dentry *pdh_dentry;
 10 };
 11 
 12 struct rpc_pipe_dir_object_ops;
 13 struct rpc_pipe_dir_object {
 14         struct list_head pdo_head;
 15         const struct rpc_pipe_dir_object_ops *pdo_ops;
 16 
 17         void *pdo_data;
 18 };
 19 
 20 struct rpc_pipe_dir_object_ops {
 21         int (*create)(struct dentry *dir,
 22                         struct rpc_pipe_dir_object *pdo);
 23         void (*destroy)(struct dentry *dir,
 24                         struct rpc_pipe_dir_object *pdo);
 25 };
 26 
 27 struct rpc_pipe_msg {
 28         struct list_head list;
 29         void *data;
 30         size_t len;
 31         size_t copied;
 32         int errno;
 33 };
 34 
 35 struct rpc_pipe_ops {
 36         ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t);
 37         ssize_t (*downcall)(struct file *, const char __user *, size_t);
 38         void (*release_pipe)(struct inode *);
 39         int (*open_pipe)(struct inode *);
 40         void (*destroy_msg)(struct rpc_pipe_msg *);
 41 };
 42 
 43 struct rpc_pipe {
 44         struct list_head pipe;
 45         struct list_head in_upcall;
 46         struct list_head in_downcall;
 47         int pipelen;
 48         int nreaders;
 49         int nwriters;
 50 #define RPC_PIPE_WAIT_FOR_OPEN  1
 51         int flags;
 52         struct delayed_work queue_timeout;
 53         const struct rpc_pipe_ops *ops;
 54         spinlock_t lock;
 55         struct dentry *dentry;
 56 };
 57 
 58 struct rpc_inode {
 59         struct inode vfs_inode;
 60         void *private;
 61         struct rpc_pipe *pipe;
 62         wait_queue_head_t waitq;
 63 };
 64 
 65 static inline struct rpc_inode *
 66 RPC_I(struct inode *inode)
 67 {
 68         return container_of(inode, struct rpc_inode, vfs_inode);
 69 }
 70 
 71 enum {
 72         SUNRPC_PIPEFS_NFS_PRIO,
 73         SUNRPC_PIPEFS_RPC_PRIO,
 74 };
 75 
 76 extern int rpc_pipefs_notifier_register(struct notifier_block *);
 77 extern void rpc_pipefs_notifier_unregister(struct notifier_block *);
 78 
 79 enum {
 80         RPC_PIPEFS_MOUNT,
 81         RPC_PIPEFS_UMOUNT,
 82 };
 83 
 84 extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb,
 85                                       const unsigned char *dir_name);
 86 extern int rpc_pipefs_init_net(struct net *net);
 87 extern void rpc_pipefs_exit_net(struct net *net);
 88 extern struct super_block *rpc_get_sb_net(const struct net *net);
 89 extern void rpc_put_sb_net(const struct net *net);
 90 
 91 extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
 92                                        char __user *, size_t);
 93 extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *);
 94 
 95 struct rpc_clnt;
 96 extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *);
 97 extern int rpc_remove_client_dir(struct rpc_clnt *);
 98 
 99 extern void rpc_init_pipe_dir_head(struct rpc_pipe_dir_head *pdh);
100 extern void rpc_init_pipe_dir_object(struct rpc_pipe_dir_object *pdo,
101                 const struct rpc_pipe_dir_object_ops *pdo_ops,
102                 void *pdo_data);
103 extern int rpc_add_pipe_dir_object(struct net *net,
104                 struct rpc_pipe_dir_head *pdh,
105                 struct rpc_pipe_dir_object *pdo);
106 extern void rpc_remove_pipe_dir_object(struct net *net,
107                 struct rpc_pipe_dir_head *pdh,
108                 struct rpc_pipe_dir_object *pdo);
109 extern struct rpc_pipe_dir_object *rpc_find_or_alloc_pipe_dir_object(
110                 struct net *net,
111                 struct rpc_pipe_dir_head *pdh,
112                 int (*match)(struct rpc_pipe_dir_object *, void *),
113                 struct rpc_pipe_dir_object *(*alloc)(void *),
114                 void *data);
115 
116 struct cache_detail;
117 extern struct dentry *rpc_create_cache_dir(struct dentry *,
118                                            const char *,
119                                            umode_t umode,
120                                            struct cache_detail *);
121 extern void rpc_remove_cache_dir(struct dentry *);
122 
123 struct rpc_pipe *rpc_mkpipe_data(const struct rpc_pipe_ops *ops, int flags);
124 void rpc_destroy_pipe_data(struct rpc_pipe *pipe);
125 extern struct dentry *rpc_mkpipe_dentry(struct dentry *, const char *, void *,
126                                         struct rpc_pipe *);
127 extern int rpc_unlink(struct dentry *);
128 extern int register_rpc_pipefs(void);
129 extern void unregister_rpc_pipefs(void);
130 
131 extern bool gssd_running(struct net *net);
132 
133 #endif
134 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp