patch-2.3.99-pre7 linux/include/linux/sched.h
Next file: linux/include/linux/socket.h
Previous file: linux/include/linux/quotaops.h
Back to the patch index
Back to the overall index
- Lines: 173
- Date:
Thu May 11 11:26:54 2000
- Orig file:
v2.3.99-pre6/linux/include/linux/sched.h
- Orig date:
Wed Apr 26 16:34:09 2000
diff -u --recursive --new-file v2.3.99-pre6/linux/include/linux/sched.h linux/include/linux/sched.h
@@ -203,7 +203,7 @@
unsigned long start_code, end_code, start_data, end_data;
unsigned long start_brk, brk, start_stack;
unsigned long arg_start, arg_end, env_start, env_end;
- unsigned long min_flt, maj_flt, rss, total_vm, locked_vm;
+ unsigned long rss, total_vm, locked_vm;
unsigned long def_flags;
unsigned long cpu_vm_mask;
unsigned long swap_cnt; /* number of pages to swap on next pass */
@@ -225,7 +225,7 @@
0, 0, 0, 0, \
0, 0, 0, \
0, 0, 0, 0, \
- 0, 0, 0, 0, 0, \
+ 0, 0, 0, \
0, 0, 0, 0, NULL }
struct signal_struct {
@@ -310,7 +310,6 @@
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
int swappable:1;
- int hog:1;
/* process credentials */
uid_t uid,euid,suid,fsuid;
gid_t gid,egid,sgid,fsgid;
@@ -346,8 +345,8 @@
/* Thread group tracking */
u32 parent_exec_id;
u32 self_exec_id;
-/* Protection of fields allocatio/deallocation */
- struct semaphore exit_sem;
+/* Protection of (de-)allocation: mm, files, fs, tty */
+ spinlock_t alloc_lock;
};
/*
@@ -418,7 +417,7 @@
blocked: {{0}}, \
sigqueue: NULL, \
sigqueue_tail: &tsk.sigqueue, \
- exit_sem: __MUTEX_INITIALIZER(tsk.exit_sem) \
+ alloc_lock: SPIN_LOCK_UNLOCKED \
}
@@ -442,7 +441,7 @@
#define pid_hashfn(x) ((((x) >> 8) ^ (x)) & (PIDHASH_SZ - 1))
-extern __inline__ void hash_pid(struct task_struct *p)
+static inline void hash_pid(struct task_struct *p)
{
struct task_struct **htable = &pidhash[pid_hashfn(p->pid)];
@@ -452,14 +451,14 @@
p->pidhash_pprev = htable;
}
-extern __inline__ void unhash_pid(struct task_struct *p)
+static inline void unhash_pid(struct task_struct *p)
{
if(p->pidhash_next)
p->pidhash_next->pidhash_pprev = p->pidhash_pprev;
*p->pidhash_pprev = p->pidhash_next;
}
-extern __inline__ struct task_struct *find_task_by_pid(int pid)
+static inline struct task_struct *find_task_by_pid(int pid)
{
struct task_struct *p, **htable = &pidhash[pid_hashfn(pid)];
@@ -525,7 +524,7 @@
extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *);
extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long);
-extern inline int signal_pending(struct task_struct *p)
+static inline int signal_pending(struct task_struct *p)
{
return (p->sigpending != 0);
}
@@ -593,7 +592,7 @@
* These will be removed, but in the mean time, when the SECURE_NOROOT
* flag is set, uids don't grant privilege.
*/
-extern inline int suser(void)
+static inline int suser(void)
{
if (!issecure(SECURE_NOROOT) && current->euid == 0) {
current->flags |= PF_SUPERPRIV;
@@ -602,7 +601,7 @@
return 0;
}
-extern inline int fsuser(void)
+static inline int fsuser(void)
{
if (!issecure(SECURE_NOROOT) && current->fsuid == 0) {
current->flags |= PF_SUPERPRIV;
@@ -617,7 +616,7 @@
* fsuser(). See include/linux/capability.h for defined capabilities.
*/
-extern inline int capable(int cap)
+static inline int capable(int cap)
{
#if 1 /* ok now */
if (cap_raised(current->cap_effective, cap))
@@ -707,7 +706,7 @@
extern int do_execve(char *, char **, char **, struct pt_regs *);
extern int do_fork(unsigned long, unsigned long, struct pt_regs *);
-extern inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+static inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
@@ -716,7 +715,7 @@
wq_write_unlock_irqrestore(&q->lock, flags);
}
-extern inline void add_wait_queue_exclusive(wait_queue_head_t *q,
+static inline void add_wait_queue_exclusive(wait_queue_head_t *q,
wait_queue_t * wait)
{
unsigned long flags;
@@ -726,7 +725,7 @@
wq_write_unlock_irqrestore(&q->lock, flags);
}
-extern inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+static inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
@@ -820,12 +819,12 @@
p->run_list.next = NULL;
}
-extern inline int task_on_runqueue(struct task_struct *p)
+static inline int task_on_runqueue(struct task_struct *p)
{
return (p->run_list.next != NULL);
}
-extern inline void unhash_process(struct task_struct *p)
+static inline void unhash_process(struct task_struct *p)
{
if (task_on_runqueue(p)) BUG();
write_lock_irq(&tasklist_lock);
@@ -835,19 +834,14 @@
write_unlock_irq(&tasklist_lock);
}
-static inline int task_lock(struct task_struct *p)
+static inline void task_lock(struct task_struct *p)
{
- down(&p->exit_sem);
- if (p->p_pptr)
- return 1;
- /* He's dead, Jim. You take his wallet, I'll take the tricorder... */
- up(&p->exit_sem);
- return 0;
+ spin_lock(&p->alloc_lock);
}
static inline void task_unlock(struct task_struct *p)
{
- up(&p->exit_sem);
+ spin_unlock(&p->alloc_lock);
}
#endif /* __KERNEL__ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)