summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:33:54 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:33:54 -0800
commit1040c54c3b98ac4f8d91bc313cdc9d6669481da3 (patch)
treed2c91b7b7e2aa5ffc88774ce1aa9aef08d4c709f /include
parent5aa875d2cbee34727963bd81aa992b64480045ca (diff)
v2.4.14.8 -> v2.4.14.9
- David Brownell: usbnet update - Greg KH: USB and PCI hotplug update - Ingo/me: fix SCHED_FIFO for UP/SMP for good (flw). - Add back direct_IO now that it works again.
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h14
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/sched.h26
4 files changed, 35 insertions, 7 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 9dbef2980770..cdb196ca50fb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -195,11 +195,15 @@ extern void drive_stat_acct (kdev_t dev, int rw,
static inline int get_hardsect_size(kdev_t dev)
{
- extern int *hardsect_size[];
- if (hardsect_size[MAJOR(dev)] != NULL)
- return hardsect_size[MAJOR(dev)][MINOR(dev)];
- else
- return 512;
+ int retval = 512;
+ int major = MAJOR(dev);
+
+ if (hardsect_size[major]) {
+ int minor = MINOR(dev);
+ if (hardsect_size[major][minor])
+ retval = hardsect_size[major][minor];
+ }
+ return retval;
}
#define blk_finished_io(nsects) do { } while (0)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f170f9e036ec..867aa6ce8f5b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1386,6 +1386,7 @@ extern int block_sync_page(struct page *);
int generic_block_bmap(struct address_space *, long, get_block_t *);
int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
int block_truncate_page(struct address_space *, loff_t, get_block_t *);
+extern int generic_direct_IO(int, struct inode *, struct kiobuf *, unsigned long, int, get_block_t *);
extern int waitfor_one_page(struct page*);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7737d585b0a2..5a85039279b0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -416,6 +416,7 @@ extern int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long d
extern int ptrace_attach(struct task_struct *tsk);
extern int ptrace_detach(struct task_struct *, unsigned int);
extern void ptrace_disable(struct task_struct *);
+extern int ptrace_check_attach(struct task_struct *task, int kill);
/*
* On a two-level page table, this ends up being trivial. Thus the
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9cdc5e05d025..97c574fe85d2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -304,8 +304,16 @@ struct task_struct {
long nice;
unsigned long policy;
struct mm_struct *mm;
- int has_cpu, processor;
- unsigned long cpus_allowed;
+ int processor;
+ /*
+ * cpus_runnable is ~0 if the process is not running on any
+ * CPU. It's (1 << cpu) if it's running on a CPU. This mask
+ * is updated under the runqueue lock.
+ *
+ * To determine whether a process might run on a CPU, this
+ * mask is AND-ed with cpus_allowed.
+ */
+ unsigned long cpus_runnable, cpus_allowed;
/*
* (only the 'next' pointer fits into the cacheline, but
* that's just fine.)
@@ -464,6 +472,7 @@ extern struct exec_domain default_exec_domain;
policy: SCHED_OTHER, \
mm: NULL, \
active_mm: &init_mm, \
+ cpus_runnable: -1, \
cpus_allowed: -1, \
run_list: LIST_HEAD_INIT(tsk.run_list), \
next_task: &tsk, \
@@ -541,6 +550,19 @@ static inline struct task_struct *find_task_by_pid(int pid)
return p;
}
+#define task_has_cpu(tsk) ((tsk)->cpus_runnable != ~0UL)
+
+static inline void task_set_cpu(struct task_struct *tsk, unsigned int cpu)
+{
+ tsk->processor = cpu;
+ tsk->cpus_runnable = 1UL << cpu;
+}
+
+static inline void task_release_cpu(struct task_struct *tsk)
+{
+ tsk->cpus_runnable = ~0UL;
+}
+
/* per-UID process charging. */
extern struct user_struct * alloc_uid(uid_t);
extern void free_uid(struct user_struct *);