Lines Matching refs:rpci
42 static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
55 wake_up(&rpci->waitq);
62 struct rpc_inode *rpci =
64 struct inode *inode = &rpci->vfs_inode;
68 if (rpci->ops == NULL) {
72 destroy_msg = rpci->ops->destroy_msg;
73 if (rpci->nreaders == 0) {
74 list_splice_init(&rpci->pipe, &free_list);
75 rpci->pipelen = 0;
78 rpc_purge_list(rpci, &free_list, destroy_msg, -ETIMEDOUT);
94 struct rpc_inode *rpci = RPC_I(inode);
98 if (rpci->ops == NULL)
100 if (rpci->nreaders) {
101 list_add_tail(&msg->list, &rpci->pipe);
102 rpci->pipelen += msg->len;
104 } else if (rpci->flags & RPC_PIPE_WAIT_FOR_OPEN) {
105 if (list_empty(&rpci->pipe))
107 &rpci->queue_timeout,
109 list_add_tail(&msg->list, &rpci->pipe);
110 rpci->pipelen += msg->len;
115 wake_up(&rpci->waitq);
129 struct rpc_inode *rpci = RPC_I(inode);
134 ops = rpci->ops;
138 need_release = rpci->nreaders != 0 || rpci->nwriters != 0;
139 rpci->nreaders = 0;
140 list_splice_init(&rpci->in_upcall, &free_list);
141 list_splice_init(&rpci->pipe, &free_list);
142 rpci->pipelen = 0;
143 rpci->ops = NULL;
145 rpc_purge_list(rpci, &free_list, ops->destroy_msg, -EPIPE);
146 rpci->nwriters = 0;
149 cancel_delayed_work_sync(&rpci->queue_timeout);
158 struct rpc_inode *rpci;
159 rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
160 if (!rpci)
162 return &rpci->vfs_inode;
174 struct rpc_inode *rpci = RPC_I(inode);
179 if (rpci->ops == NULL)
181 first_open = rpci->nreaders == 0 && rpci->nwriters == 0;
182 if (first_open && rpci->ops->open_pipe) {
183 res = rpci->ops->open_pipe(inode);
188 rpci->nreaders++;
190 rpci->nwriters++;
200 struct rpc_inode *rpci = RPC_I(inode);
205 if (rpci->ops == NULL)
213 rpci->ops->destroy_msg(msg);
216 rpci->nwriters --;
218 rpci->nreaders --;
219 if (rpci->nreaders == 0) {
222 list_splice_init(&rpci->pipe, &free_list);
223 rpci->pipelen = 0;
225 rpc_purge_list(rpci, &free_list,
226 rpci->ops->destroy_msg, -EAGAIN);
229 last_close = rpci->nwriters == 0 && rpci->nreaders == 0;
230 if (last_close && rpci->ops->release_pipe)
231 rpci->ops->release_pipe(inode);
241 struct rpc_inode *rpci = RPC_I(inode);
246 if (rpci->ops == NULL) {
253 if (!list_empty(&rpci->pipe)) {
254 msg = list_entry(rpci->pipe.next,
257 list_move(&msg->list, &rpci->in_upcall);
258 rpci->pipelen -= msg->len;
267 res = rpci->ops->upcall(filp, msg, buf, len);
273 rpci->ops->destroy_msg(msg);
284 struct rpc_inode *rpci = RPC_I(inode);
289 if (rpci->ops != NULL)
290 res = rpci->ops->downcall(filp, buf, len);
298 struct rpc_inode *rpci;
301 rpci = RPC_I(filp->f_path.dentry->d_inode);
302 poll_wait(filp, &rpci->waitq, wait);
305 if (rpci->ops == NULL)
307 if (filp->private_data || !list_empty(&rpci->pipe))
315 struct rpc_inode *rpci = RPC_I(filp->f_path.dentry->d_inode);
320 if (rpci->ops == NULL)
322 len = rpci->pipelen;
530 struct rpc_inode *rpci;
536 rpci = RPC_I(dentry->d_inode);
537 rpci->nkern_readwriters = 1;
538 rpci->private = private;
539 rpci->flags = flags;
540 rpci->ops = ops;
570 struct rpc_inode *rpci = RPC_I(inode);
572 rpci->nkern_readwriters--;
573 if (rpci->nkern_readwriters != 0)
796 struct rpc_inode *rpci = RPC_I(dentry->d_inode);
797 if (rpci->private != private ||
798 rpci->ops != ops ||
799 rpci->flags != flags) {
804 rpci->nkern_readwriters++;
1042 struct rpc_inode *rpci = (struct rpc_inode *) foo;
1044 inode_init_once(&rpci->vfs_inode);
1045 rpci->private = NULL;
1046 rpci->nreaders = 0;
1047 rpci->nwriters = 0;
1048 INIT_LIST_HEAD(&rpci->in_upcall);
1049 INIT_LIST_HEAD(&rpci->in_downcall);
1050 INIT_LIST_HEAD(&rpci->pipe);
1051 rpci->pipelen = 0;
1052 init_waitqueue_head(&rpci->waitq);
1053 INIT_DELAYED_WORK(&rpci->queue_timeout,
1055 rpci->ops = NULL;