floppy: handle device_create_file() failure while init
[linux-2.6/zen-sources.git] / ipc / util.c
blob0ad5b1c3ca0128470f39458f6d29386e116d0ba8
1 /*
2 * linux/ipc/util.c
3 * Copyright (C) 1992 Krishna Balasubramanian
5 * Sep 1997 - Call suser() last after "normal" permission checks so we
6 * get BSD style process accounting right.
7 * Occurs in several places in the IPC code.
8 * Chris Evans, <chris@ferret.lmh.ox.ac.uk>
9 * Nov 1999 - ipc helper functions, unified SMP locking
10 * Manfred Spraul <manfred@colorfullife.com>
11 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary().
12 * Mingming Cao <cmm@us.ibm.com>
13 * Mar 2006 - support for audit of ipc object properties
14 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
15 * Jun 2006 - namespaces ssupport
16 * OpenVZ, SWsoft Inc.
17 * Pavel Emelianov <xemul@openvz.org>
20 #include <linux/mm.h>
21 #include <linux/shm.h>
22 #include <linux/init.h>
23 #include <linux/msg.h>
24 #include <linux/smp_lock.h>
25 #include <linux/vmalloc.h>
26 #include <linux/slab.h>
27 #include <linux/capability.h>
28 #include <linux/highuid.h>
29 #include <linux/security.h>
30 #include <linux/rcupdate.h>
31 #include <linux/workqueue.h>
32 #include <linux/seq_file.h>
33 #include <linux/proc_fs.h>
34 #include <linux/audit.h>
35 #include <linux/nsproxy.h>
37 #include <asm/unistd.h>
39 #include "util.h"
41 struct ipc_proc_iface {
42 const char *path;
43 const char *header;
44 int ids;
45 int (*show)(struct seq_file *, void *);
48 struct ipc_namespace init_ipc_ns = {
49 .kref = {
50 .refcount = ATOMIC_INIT(2),
54 #ifdef CONFIG_IPC_NS
55 static struct ipc_namespace *clone_ipc_ns(struct ipc_namespace *old_ns)
57 int err;
58 struct ipc_namespace *ns;
60 err = -ENOMEM;
61 ns = kmalloc(sizeof(struct ipc_namespace), GFP_KERNEL);
62 if (ns == NULL)
63 goto err_mem;
65 err = sem_init_ns(ns);
66 if (err)
67 goto err_sem;
68 err = msg_init_ns(ns);
69 if (err)
70 goto err_msg;
71 err = shm_init_ns(ns);
72 if (err)
73 goto err_shm;
75 kref_init(&ns->kref);
76 return ns;
78 err_shm:
79 msg_exit_ns(ns);
80 err_msg:
81 sem_exit_ns(ns);
82 err_sem:
83 kfree(ns);
84 err_mem:
85 return ERR_PTR(err);
88 struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns)
90 struct ipc_namespace *new_ns;
92 BUG_ON(!ns);
93 get_ipc_ns(ns);
95 if (!(flags & CLONE_NEWIPC))
96 return ns;
98 new_ns = clone_ipc_ns(ns);
100 put_ipc_ns(ns);
101 return new_ns;
104 void free_ipc_ns(struct kref *kref)
106 struct ipc_namespace *ns;
108 ns = container_of(kref, struct ipc_namespace, kref);
109 sem_exit_ns(ns);
110 msg_exit_ns(ns);
111 shm_exit_ns(ns);
112 kfree(ns);
114 #else
115 struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns)
117 if (flags & CLONE_NEWIPC)
118 return ERR_PTR(-EINVAL);
119 return ns;
121 #endif
124 * ipc_init - initialise IPC subsystem
126 * The various system5 IPC resources (semaphores, messages and shared
127 * memory) are initialised
130 static int __init ipc_init(void)
132 sem_init();
133 msg_init();
134 shm_init();
135 return 0;
137 __initcall(ipc_init);
140 * ipc_init_ids - initialise IPC identifiers
141 * @ids: Identifier set
142 * @size: Number of identifiers
144 * Given a size for the ipc identifier range (limited below IPCMNI)
145 * set up the sequence range to use then allocate and initialise the
146 * array itself.
149 void __ipc_init ipc_init_ids(struct ipc_ids* ids, int size)
151 int i;
153 mutex_init(&ids->mutex);
155 if(size > IPCMNI)
156 size = IPCMNI;
157 ids->in_use = 0;
158 ids->max_id = -1;
159 ids->seq = 0;
161 int seq_limit = INT_MAX/SEQ_MULTIPLIER;
162 if(seq_limit > USHRT_MAX)
163 ids->seq_max = USHRT_MAX;
164 else
165 ids->seq_max = seq_limit;
168 ids->entries = ipc_rcu_alloc(sizeof(struct kern_ipc_perm *)*size +
169 sizeof(struct ipc_id_ary));
171 if(ids->entries == NULL) {
172 printk(KERN_ERR "ipc_init_ids() failed, ipc service disabled.\n");
173 size = 0;
174 ids->entries = &ids->nullentry;
176 ids->entries->size = size;
177 for(i=0;i<size;i++)
178 ids->entries->p[i] = NULL;
181 #ifdef CONFIG_PROC_FS
182 static const struct file_operations sysvipc_proc_fops;
184 * ipc_init_proc_interface - Create a proc interface for sysipc types using a seq_file interface.
185 * @path: Path in procfs
186 * @header: Banner to be printed at the beginning of the file.
187 * @ids: ipc id table to iterate.
188 * @show: show routine.
190 void __init ipc_init_proc_interface(const char *path, const char *header,
191 int ids, int (*show)(struct seq_file *, void *))
193 struct proc_dir_entry *pde;
194 struct ipc_proc_iface *iface;
196 iface = kmalloc(sizeof(*iface), GFP_KERNEL);
197 if (!iface)
198 return;
199 iface->path = path;
200 iface->header = header;
201 iface->ids = ids;
202 iface->show = show;
204 pde = create_proc_entry(path,
205 S_IRUGO, /* world readable */
206 NULL /* parent dir */);
207 if (pde) {
208 pde->data = iface;
209 pde->proc_fops = &sysvipc_proc_fops;
210 } else {
211 kfree(iface);
214 #endif
217 * ipc_findkey - find a key in an ipc identifier set
218 * @ids: Identifier set
219 * @key: The key to find
221 * Requires ipc_ids.mutex locked.
222 * Returns the identifier if found or -1 if not.
225 int ipc_findkey(struct ipc_ids* ids, key_t key)
227 int id;
228 struct kern_ipc_perm* p;
229 int max_id = ids->max_id;
232 * rcu_dereference() is not needed here
233 * since ipc_ids.mutex is held
235 for (id = 0; id <= max_id; id++) {
236 p = ids->entries->p[id];
237 if(p==NULL)
238 continue;
239 if (key == p->key)
240 return id;
242 return -1;
246 * Requires ipc_ids.mutex locked
248 static int grow_ary(struct ipc_ids* ids, int newsize)
250 struct ipc_id_ary* new;
251 struct ipc_id_ary* old;
252 int i;
253 int size = ids->entries->size;
255 if(newsize > IPCMNI)
256 newsize = IPCMNI;
257 if(newsize <= size)
258 return newsize;
260 new = ipc_rcu_alloc(sizeof(struct kern_ipc_perm *)*newsize +
261 sizeof(struct ipc_id_ary));
262 if(new == NULL)
263 return size;
264 new->size = newsize;
265 memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size);
266 for(i=size;i<newsize;i++) {
267 new->p[i] = NULL;
269 old = ids->entries;
272 * Use rcu_assign_pointer() to make sure the memcpyed contents
273 * of the new array are visible before the new array becomes visible.
275 rcu_assign_pointer(ids->entries, new);
277 __ipc_fini_ids(ids, old);
278 return newsize;
282 * ipc_addid - add an IPC identifier
283 * @ids: IPC identifier set
284 * @new: new IPC permission set
285 * @size: new size limit for the id array
287 * Add an entry 'new' to the IPC arrays. The permissions object is
288 * initialised and the first free entry is set up and the id assigned
289 * is returned. The list is returned in a locked state on success.
290 * On failure the list is not locked and -1 is returned.
292 * Called with ipc_ids.mutex held.
295 int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
297 int id;
299 size = grow_ary(ids,size);
302 * rcu_dereference()() is not needed here since
303 * ipc_ids.mutex is held
305 for (id = 0; id < size; id++) {
306 if(ids->entries->p[id] == NULL)
307 goto found;
309 return -1;
310 found:
311 ids->in_use++;
312 if (id > ids->max_id)
313 ids->max_id = id;
315 new->cuid = new->uid = current->euid;
316 new->gid = new->cgid = current->egid;
318 new->seq = ids->seq++;
319 if(ids->seq > ids->seq_max)
320 ids->seq = 0;
322 spin_lock_init(&new->lock);
323 new->deleted = 0;
324 rcu_read_lock();
325 spin_lock(&new->lock);
326 ids->entries->p[id] = new;
327 return id;
331 * ipc_rmid - remove an IPC identifier
332 * @ids: identifier set
333 * @id: Identifier to remove
335 * The identifier must be valid, and in use. The kernel will panic if
336 * fed an invalid identifier. The entry is removed and internal
337 * variables recomputed. The object associated with the identifier
338 * is returned.
339 * ipc_ids.mutex and the spinlock for this ID is hold before this function
340 * is called, and remain locked on the exit.
343 struct kern_ipc_perm* ipc_rmid(struct ipc_ids* ids, int id)
345 struct kern_ipc_perm* p;
346 int lid = id % SEQ_MULTIPLIER;
347 BUG_ON(lid >= ids->entries->size);
350 * do not need a rcu_dereference()() here to force ordering
351 * on Alpha, since the ipc_ids.mutex is held.
353 p = ids->entries->p[lid];
354 ids->entries->p[lid] = NULL;
355 BUG_ON(p==NULL);
356 ids->in_use--;
358 if (lid == ids->max_id) {
359 do {
360 lid--;
361 if(lid == -1)
362 break;
363 } while (ids->entries->p[lid] == NULL);
364 ids->max_id = lid;
366 p->deleted = 1;
367 return p;
371 * ipc_alloc - allocate ipc space
372 * @size: size desired
374 * Allocate memory from the appropriate pools and return a pointer to it.
375 * NULL is returned if the allocation fails
378 void* ipc_alloc(int size)
380 void* out;
381 if(size > PAGE_SIZE)
382 out = vmalloc(size);
383 else
384 out = kmalloc(size, GFP_KERNEL);
385 return out;
389 * ipc_free - free ipc space
390 * @ptr: pointer returned by ipc_alloc
391 * @size: size of block
393 * Free a block created with ipc_alloc(). The caller must know the size
394 * used in the allocation call.
397 void ipc_free(void* ptr, int size)
399 if(size > PAGE_SIZE)
400 vfree(ptr);
401 else
402 kfree(ptr);
406 * rcu allocations:
407 * There are three headers that are prepended to the actual allocation:
408 * - during use: ipc_rcu_hdr.
409 * - during the rcu grace period: ipc_rcu_grace.
410 * - [only if vmalloc]: ipc_rcu_sched.
411 * Their lifetime doesn't overlap, thus the headers share the same memory.
412 * Unlike a normal union, they are right-aligned, thus some container_of
413 * forward/backward casting is necessary:
415 struct ipc_rcu_hdr
417 int refcount;
418 int is_vmalloc;
419 void *data[0];
423 struct ipc_rcu_grace
425 struct rcu_head rcu;
426 /* "void *" makes sure alignment of following data is sane. */
427 void *data[0];
430 struct ipc_rcu_sched
432 struct work_struct work;
433 /* "void *" makes sure alignment of following data is sane. */
434 void *data[0];
437 #define HDRLEN_KMALLOC (sizeof(struct ipc_rcu_grace) > sizeof(struct ipc_rcu_hdr) ? \
438 sizeof(struct ipc_rcu_grace) : sizeof(struct ipc_rcu_hdr))
439 #define HDRLEN_VMALLOC (sizeof(struct ipc_rcu_sched) > HDRLEN_KMALLOC ? \
440 sizeof(struct ipc_rcu_sched) : HDRLEN_KMALLOC)
442 static inline int rcu_use_vmalloc(int size)
444 /* Too big for a single page? */
445 if (HDRLEN_KMALLOC + size > PAGE_SIZE)
446 return 1;
447 return 0;
451 * ipc_rcu_alloc - allocate ipc and rcu space
452 * @size: size desired
454 * Allocate memory for the rcu header structure + the object.
455 * Returns the pointer to the object.
456 * NULL is returned if the allocation fails.
459 void* ipc_rcu_alloc(int size)
461 void* out;
463 * We prepend the allocation with the rcu struct, and
464 * workqueue if necessary (for vmalloc).
466 if (rcu_use_vmalloc(size)) {
467 out = vmalloc(HDRLEN_VMALLOC + size);
468 if (out) {
469 out += HDRLEN_VMALLOC;
470 container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 1;
471 container_of(out, struct ipc_rcu_hdr, data)->refcount = 1;
473 } else {
474 out = kmalloc(HDRLEN_KMALLOC + size, GFP_KERNEL);
475 if (out) {
476 out += HDRLEN_KMALLOC;
477 container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 0;
478 container_of(out, struct ipc_rcu_hdr, data)->refcount = 1;
482 return out;
485 void ipc_rcu_getref(void *ptr)
487 container_of(ptr, struct ipc_rcu_hdr, data)->refcount++;
490 static void ipc_do_vfree(struct work_struct *work)
492 vfree(container_of(work, struct ipc_rcu_sched, work));
496 * ipc_schedule_free - free ipc + rcu space
497 * @head: RCU callback structure for queued work
499 * Since RCU callback function is called in bh,
500 * we need to defer the vfree to schedule_work().
502 static void ipc_schedule_free(struct rcu_head *head)
504 struct ipc_rcu_grace *grace =
505 container_of(head, struct ipc_rcu_grace, rcu);
506 struct ipc_rcu_sched *sched =
507 container_of(&(grace->data[0]), struct ipc_rcu_sched, data[0]);
509 INIT_WORK(&sched->work, ipc_do_vfree);
510 schedule_work(&sched->work);
514 * ipc_immediate_free - free ipc + rcu space
515 * @head: RCU callback structure that contains pointer to be freed
517 * Free from the RCU callback context.
519 static void ipc_immediate_free(struct rcu_head *head)
521 struct ipc_rcu_grace *free =
522 container_of(head, struct ipc_rcu_grace, rcu);
523 kfree(free);
526 void ipc_rcu_putref(void *ptr)
528 if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0)
529 return;
531 if (container_of(ptr, struct ipc_rcu_hdr, data)->is_vmalloc) {
532 call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
533 ipc_schedule_free);
534 } else {
535 call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
536 ipc_immediate_free);
541 * ipcperms - check IPC permissions
542 * @ipcp: IPC permission set
543 * @flag: desired permission set.
545 * Check user, group, other permissions for access
546 * to ipc resources. return 0 if allowed
549 int ipcperms (struct kern_ipc_perm *ipcp, short flag)
550 { /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */
551 int requested_mode, granted_mode, err;
553 if (unlikely((err = audit_ipc_obj(ipcp))))
554 return err;
555 requested_mode = (flag >> 6) | (flag >> 3) | flag;
556 granted_mode = ipcp->mode;
557 if (current->euid == ipcp->cuid || current->euid == ipcp->uid)
558 granted_mode >>= 6;
559 else if (in_group_p(ipcp->cgid) || in_group_p(ipcp->gid))
560 granted_mode >>= 3;
561 /* is there some bit set in requested_mode but not in granted_mode? */
562 if ((requested_mode & ~granted_mode & 0007) &&
563 !capable(CAP_IPC_OWNER))
564 return -1;
566 return security_ipc_permission(ipcp, flag);
570 * Functions to convert between the kern_ipc_perm structure and the
571 * old/new ipc_perm structures
575 * kernel_to_ipc64_perm - convert kernel ipc permissions to user
576 * @in: kernel permissions
577 * @out: new style IPC permissions
579 * Turn the kernel object @in into a set of permissions descriptions
580 * for returning to userspace (@out).
584 void kernel_to_ipc64_perm (struct kern_ipc_perm *in, struct ipc64_perm *out)
586 out->key = in->key;
587 out->uid = in->uid;
588 out->gid = in->gid;
589 out->cuid = in->cuid;
590 out->cgid = in->cgid;
591 out->mode = in->mode;
592 out->seq = in->seq;
596 * ipc64_perm_to_ipc_perm - convert old ipc permissions to new
597 * @in: new style IPC permissions
598 * @out: old style IPC permissions
600 * Turn the new style permissions object @in into a compatibility
601 * object and store it into the @out pointer.
604 void ipc64_perm_to_ipc_perm (struct ipc64_perm *in, struct ipc_perm *out)
606 out->key = in->key;
607 SET_UID(out->uid, in->uid);
608 SET_GID(out->gid, in->gid);
609 SET_UID(out->cuid, in->cuid);
610 SET_GID(out->cgid, in->cgid);
611 out->mode = in->mode;
612 out->seq = in->seq;
616 * So far only shm_get_stat() calls ipc_get() via shm_get(), so ipc_get()
617 * is called with shm_ids.mutex locked. Since grow_ary() is also called with
618 * shm_ids.mutex down(for Shared Memory), there is no need to add read
619 * barriers here to gurantee the writes in grow_ary() are seen in order
620 * here (for Alpha).
622 * However ipc_get() itself does not necessary require ipc_ids.mutex down. So
623 * if in the future ipc_get() is used by other places without ipc_ids.mutex
624 * down, then ipc_get() needs read memery barriers as ipc_lock() does.
626 struct kern_ipc_perm* ipc_get(struct ipc_ids* ids, int id)
628 struct kern_ipc_perm* out;
629 int lid = id % SEQ_MULTIPLIER;
630 if(lid >= ids->entries->size)
631 return NULL;
632 out = ids->entries->p[lid];
633 return out;
636 struct kern_ipc_perm* ipc_lock(struct ipc_ids* ids, int id)
638 struct kern_ipc_perm* out;
639 int lid = id % SEQ_MULTIPLIER;
640 struct ipc_id_ary* entries;
642 rcu_read_lock();
643 entries = rcu_dereference(ids->entries);
644 if(lid >= entries->size) {
645 rcu_read_unlock();
646 return NULL;
648 out = entries->p[lid];
649 if(out == NULL) {
650 rcu_read_unlock();
651 return NULL;
653 spin_lock(&out->lock);
655 /* ipc_rmid() may have already freed the ID while ipc_lock
656 * was spinning: here verify that the structure is still valid
658 if (out->deleted) {
659 spin_unlock(&out->lock);
660 rcu_read_unlock();
661 return NULL;
663 return out;
666 void ipc_lock_by_ptr(struct kern_ipc_perm *perm)
668 rcu_read_lock();
669 spin_lock(&perm->lock);
672 void ipc_unlock(struct kern_ipc_perm* perm)
674 spin_unlock(&perm->lock);
675 rcu_read_unlock();
678 int ipc_buildid(struct ipc_ids* ids, int id, int seq)
680 return SEQ_MULTIPLIER*seq + id;
683 int ipc_checkid(struct ipc_ids* ids, struct kern_ipc_perm* ipcp, int uid)
685 if(uid/SEQ_MULTIPLIER != ipcp->seq)
686 return 1;
687 return 0;
690 #ifdef __ARCH_WANT_IPC_PARSE_VERSION
694 * ipc_parse_version - IPC call version
695 * @cmd: pointer to command
697 * Return IPC_64 for new style IPC and IPC_OLD for old style IPC.
698 * The @cmd value is turned from an encoding command and version into
699 * just the command code.
702 int ipc_parse_version (int *cmd)
704 if (*cmd & IPC_64) {
705 *cmd ^= IPC_64;
706 return IPC_64;
707 } else {
708 return IPC_OLD;
712 #endif /* __ARCH_WANT_IPC_PARSE_VERSION */
714 #ifdef CONFIG_PROC_FS
715 struct ipc_proc_iter {
716 struct ipc_namespace *ns;
717 struct ipc_proc_iface *iface;
720 static void *sysvipc_proc_next(struct seq_file *s, void *it, loff_t *pos)
722 struct ipc_proc_iter *iter = s->private;
723 struct ipc_proc_iface *iface = iter->iface;
724 struct kern_ipc_perm *ipc = it;
725 loff_t p;
726 struct ipc_ids *ids;
728 ids = iter->ns->ids[iface->ids];
730 /* If we had an ipc id locked before, unlock it */
731 if (ipc && ipc != SEQ_START_TOKEN)
732 ipc_unlock(ipc);
735 * p = *pos - 1 (because id 0 starts at position 1)
736 * + 1 (because we increment the position by one)
738 for (p = *pos; p <= ids->max_id; p++) {
739 if ((ipc = ipc_lock(ids, p)) != NULL) {
740 *pos = p + 1;
741 return ipc;
745 /* Out of range - return NULL to terminate iteration */
746 return NULL;
750 * File positions: pos 0 -> header, pos n -> ipc id + 1.
751 * SeqFile iterator: iterator value locked shp or SEQ_TOKEN_START.
753 static void *sysvipc_proc_start(struct seq_file *s, loff_t *pos)
755 struct ipc_proc_iter *iter = s->private;
756 struct ipc_proc_iface *iface = iter->iface;
757 struct kern_ipc_perm *ipc;
758 loff_t p;
759 struct ipc_ids *ids;
761 ids = iter->ns->ids[iface->ids];
764 * Take the lock - this will be released by the corresponding
765 * call to stop().
767 mutex_lock(&ids->mutex);
769 /* pos < 0 is invalid */
770 if (*pos < 0)
771 return NULL;
773 /* pos == 0 means header */
774 if (*pos == 0)
775 return SEQ_START_TOKEN;
777 /* Find the (pos-1)th ipc */
778 for (p = *pos - 1; p <= ids->max_id; p++) {
779 if ((ipc = ipc_lock(ids, p)) != NULL) {
780 *pos = p + 1;
781 return ipc;
784 return NULL;
787 static void sysvipc_proc_stop(struct seq_file *s, void *it)
789 struct kern_ipc_perm *ipc = it;
790 struct ipc_proc_iter *iter = s->private;
791 struct ipc_proc_iface *iface = iter->iface;
792 struct ipc_ids *ids;
794 /* If we had a locked segment, release it */
795 if (ipc && ipc != SEQ_START_TOKEN)
796 ipc_unlock(ipc);
798 ids = iter->ns->ids[iface->ids];
799 /* Release the lock we took in start() */
800 mutex_unlock(&ids->mutex);
803 static int sysvipc_proc_show(struct seq_file *s, void *it)
805 struct ipc_proc_iter *iter = s->private;
806 struct ipc_proc_iface *iface = iter->iface;
808 if (it == SEQ_START_TOKEN)
809 return seq_puts(s, iface->header);
811 return iface->show(s, it);
814 static struct seq_operations sysvipc_proc_seqops = {
815 .start = sysvipc_proc_start,
816 .stop = sysvipc_proc_stop,
817 .next = sysvipc_proc_next,
818 .show = sysvipc_proc_show,
821 static int sysvipc_proc_open(struct inode *inode, struct file *file)
823 int ret;
824 struct seq_file *seq;
825 struct ipc_proc_iter *iter;
827 ret = -ENOMEM;
828 iter = kmalloc(sizeof(*iter), GFP_KERNEL);
829 if (!iter)
830 goto out;
832 ret = seq_open(file, &sysvipc_proc_seqops);
833 if (ret)
834 goto out_kfree;
836 seq = file->private_data;
837 seq->private = iter;
839 iter->iface = PDE(inode)->data;
840 iter->ns = get_ipc_ns(current->nsproxy->ipc_ns);
841 out:
842 return ret;
843 out_kfree:
844 kfree(iter);
845 goto out;
848 static int sysvipc_proc_release(struct inode *inode, struct file *file)
850 struct seq_file *seq = file->private_data;
851 struct ipc_proc_iter *iter = seq->private;
852 put_ipc_ns(iter->ns);
853 return seq_release_private(inode, file);
856 static const struct file_operations sysvipc_proc_fops = {
857 .open = sysvipc_proc_open,
858 .read = seq_read,
859 .llseek = seq_lseek,
860 .release = sysvipc_proc_release,
862 #endif /* CONFIG_PROC_FS */