Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipc/sem.c: remove private structures from public header file

include/linux/sem.h contains several structures that are only used within
ipc/sem.c.

The patch moves them into ipc/sem.c - there is no need to expose the
structures to the whole kernel.

No functional changes, only whitespace cleanups and 80-char per line
fixes.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Manfred Spraul and committed by
Linus Torvalds
e57940d7 0b0577f6

+46 -42
-42
include/linux/sem.h
··· 83 83 84 84 struct task_struct; 85 85 86 - /* One semaphore structure for each semaphore in the system. */ 87 - struct sem { 88 - int semval; /* current value */ 89 - int sempid; /* pid of last operation */ 90 - struct list_head sem_pending; /* pending single-sop operations */ 91 - }; 92 - 93 86 /* One sem_array data structure for each set of semaphores in the system. */ 94 87 struct sem_array { 95 88 struct kern_ipc_perm ____cacheline_aligned_in_smp ··· 94 101 struct list_head list_id; /* undo requests on this array */ 95 102 int sem_nsems; /* no. of semaphores in array */ 96 103 int complex_count; /* pending complex operations */ 97 - }; 98 - 99 - /* One queue for each sleeping process in the system. */ 100 - struct sem_queue { 101 - struct list_head simple_list; /* queue of pending operations */ 102 - struct list_head list; /* queue of pending operations */ 103 - struct task_struct *sleeper; /* this process */ 104 - struct sem_undo *undo; /* undo structure */ 105 - int pid; /* process id of requesting process */ 106 - int status; /* completion status of operation */ 107 - struct sembuf *sops; /* array of pending operations */ 108 - int nsops; /* number of operations */ 109 - int alter; /* does the operation alter the array? */ 110 - }; 111 - 112 - /* Each task has a list of undo requests. They are executed automatically 113 - * when the process exits. 114 - */ 115 - struct sem_undo { 116 - struct list_head list_proc; /* per-process list: all undos from one process. */ 117 - /* rcu protected */ 118 - struct rcu_head rcu; /* rcu struct for sem_undo() */ 119 - struct sem_undo_list *ulp; /* sem_undo_list for the process */ 120 - struct list_head list_id; /* per semaphore array list: all undos for one array */ 121 - int semid; /* semaphore set identifier */ 122 - short * semadj; /* array of adjustments, one per semaphore */ 123 - }; 124 - 125 - /* sem_undo_list controls shared access to the list of sem_undo structures 126 - * that may be shared among all a CLONE_SYSVSEM task group. 127 - */ 128 - struct sem_undo_list { 129 - atomic_t refcnt; 130 - spinlock_t lock; 131 - struct list_head list_proc; 132 104 }; 133 105 134 106 struct sysv_sem {
+46
ipc/sem.c
··· 90 90 #include <asm/uaccess.h> 91 91 #include "util.h" 92 92 93 + /* One semaphore structure for each semaphore in the system. */ 94 + struct sem { 95 + int semval; /* current value */ 96 + int sempid; /* pid of last operation */ 97 + struct list_head sem_pending; /* pending single-sop operations */ 98 + }; 99 + 100 + /* One queue for each sleeping process in the system. */ 101 + struct sem_queue { 102 + struct list_head simple_list; /* queue of pending operations */ 103 + struct list_head list; /* queue of pending operations */ 104 + struct task_struct *sleeper; /* this process */ 105 + struct sem_undo *undo; /* undo structure */ 106 + int pid; /* process id of requesting process */ 107 + int status; /* completion status of operation */ 108 + struct sembuf *sops; /* array of pending operations */ 109 + int nsops; /* number of operations */ 110 + int alter; /* does *sops alter the array? */ 111 + }; 112 + 113 + /* Each task has a list of undo requests. They are executed automatically 114 + * when the process exits. 115 + */ 116 + struct sem_undo { 117 + struct list_head list_proc; /* per-process list: * 118 + * all undos from one process 119 + * rcu protected */ 120 + struct rcu_head rcu; /* rcu struct for sem_undo */ 121 + struct sem_undo_list *ulp; /* back ptr to sem_undo_list */ 122 + struct list_head list_id; /* per semaphore array list: 123 + * all undos for one array */ 124 + int semid; /* semaphore set identifier */ 125 + short *semadj; /* array of adjustments */ 126 + /* one per semaphore */ 127 + }; 128 + 129 + /* sem_undo_list controls shared access to the list of sem_undo structures 130 + * that may be shared among all a CLONE_SYSVSEM task group. 131 + */ 132 + struct sem_undo_list { 133 + atomic_t refcnt; 134 + spinlock_t lock; 135 + struct list_head list_proc; 136 + }; 137 + 138 + 93 139 #define sem_ids(ns) ((ns)->ids[IPC_SEM_IDS]) 94 140 95 141 #define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm)