summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-09-29 06:26:43 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-29 06:26:43 -0700
commitff61d1d6f04ea83aa93d1e30cef2709626d4b166 (patch)
tree68920694b2db7310481b06ccdab86e30e5d6ad38 /include/linux
parentda111000a5a7d55d41683b771d32aa8515f35f30 (diff)
parent113072fa287f3a1018800bbf83b267361c8e3caf (diff)
Merge http://linux-isdn.bkbits.net/linux-2.5.isdn
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h252
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/interrupt.h36
-rw-r--r--include/linux/mii.h15
-rw-r--r--include/linux/mmzone.h19
-rw-r--r--include/linux/msdos_fs.h6
-rw-r--r--include/linux/page-flags.h2
-rw-r--r--include/linux/pci_ids.h13
-rw-r--r--include/linux/reiserfs_fs.h3
-rw-r--r--include/linux/sched.h58
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/smb.h3
-rw-r--r--include/linux/smb_fs.h27
-rw-r--r--include/linux/smbno.h32
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/linux/timer.h39
-rw-r--r--include/linux/tqueue.h89
-rw-r--r--include/linux/tty_flip.h2
19 files changed, 425 insertions, 175 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
new file mode 100644
index 000000000000..5e39e5d0453c
--- /dev/null
+++ b/include/linux/cpufreq.h
@@ -0,0 +1,252 @@
+/*
+ * linux/include/linux/cpufreq.h
+ *
+ * Copyright (C) 2001 Russell King
+ * (C) 2002 Dominik Brodowski <linux@brodo.de>
+ *
+ *
+ * $Id: cpufreq.h,v 1.26 2002/09/21 09:05:29 db Exp $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef _LINUX_CPUFREQ_H
+#define _LINUX_CPUFREQ_H
+
+#include <linux/config.h>
+#include <linux/notifier.h>
+#include <linux/threads.h>
+
+
+/*********************************************************************
+ * CPUFREQ NOTIFIER INTERFACE *
+ *********************************************************************/
+
+int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
+int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
+
+#define CPUFREQ_TRANSITION_NOTIFIER (0)
+#define CPUFREQ_POLICY_NOTIFIER (1)
+
+#define CPUFREQ_ALL_CPUS ((NR_CPUS))
+
+
+/********************** cpufreq policy notifiers *********************/
+
+#define CPUFREQ_POLICY_POWERSAVE (1)
+#define CPUFREQ_POLICY_PERFORMANCE (2)
+
+/* values here are CPU kHz so that hardware which doesn't run with some
+ * frequencies can complain without having to guess what per cent / per
+ * mille means. */
+struct cpufreq_policy {
+ unsigned int cpu; /* cpu nr or CPUFREQ_ALL_CPUS */
+ unsigned int min; /* in kHz */
+ unsigned int max; /* in kHz */
+ unsigned int policy; /* see above */
+ unsigned int max_cpu_freq; /* for information */
+};
+
+#define CPUFREQ_ADJUST (0)
+#define CPUFREQ_INCOMPATIBLE (1)
+#define CPUFREQ_NOTIFY (2)
+
+
+/******************** cpufreq transition notifiers *******************/
+
+#define CPUFREQ_PRECHANGE (0)
+#define CPUFREQ_POSTCHANGE (1)
+
+struct cpufreq_freqs {
+ unsigned int cpu; /* cpu nr or CPUFREQ_ALL_CPUS */
+ unsigned int old;
+ unsigned int new;
+};
+
+
+/**
+ * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch safe)
+ * @old: old value
+ * @div: divisor
+ * @mult: multiplier
+ *
+ * Needed for loops_per_jiffy and similar calculations. We do it
+ * this way to avoid math overflow on 32-bit machines. This will
+ * become architecture dependent once high-resolution-timer is
+ * merged (or any other thing that introduces sc_math.h).
+ *
+ * new = old * mult / div
+ */
+static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mult)
+{
+ unsigned long val, carry;
+
+ mult /= 100;
+ div /= 100;
+ val = (old / div) * mult;
+ carry = old % div;
+ carry = carry * mult / div;
+
+ return carry + val;
+};
+
+
+/*********************************************************************
+ * DYNAMIC CPUFREQ INTERFACE *
+ *********************************************************************/
+#ifdef CONFIG_CPU_FREQ_DYNAMIC
+/* TBD */
+#endif /* CONFIG_CPU_FREQ_DYNAMIC */
+
+
+/*********************************************************************
+ * CPUFREQ DRIVER INTERFACE *
+ *********************************************************************/
+
+typedef void (*cpufreq_policy_t) (struct cpufreq_policy *policy);
+
+struct cpufreq_driver {
+ /* needed by all drivers */
+ cpufreq_policy_t verify;
+ cpufreq_policy_t setpolicy;
+ struct cpufreq_policy *policy;
+#ifdef CONFIG_CPU_FREQ_DYNAMIC
+ /* TBD */
+#endif
+ /* 2.4. compatible API */
+#ifdef CONFIG_CPU_FREQ_24_API
+ unsigned int cpu_min_freq;
+ unsigned int cpu_cur_freq[NR_CPUS];
+#endif
+};
+
+int cpufreq_register(struct cpufreq_driver *driver_data);
+int cpufreq_unregister(void);
+
+void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state);
+
+
+static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max)
+{
+ if (policy->min < min)
+ policy->min = min;
+ if (policy->max < min)
+ policy->max = min;
+ if (policy->min > max)
+ policy->min = max;
+ if (policy->max > max)
+ policy->max = max;
+ if (policy->min > policy->max)
+ policy->min = policy->max;
+ return;
+}
+
+/*********************************************************************
+ * CPUFREQ 2.6. INTERFACE *
+ *********************************************************************/
+int cpufreq_set_policy(struct cpufreq_policy *policy);
+int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
+
+#ifdef CONFIG_CPU_FREQ_26_API
+#ifdef CONFIG_PM
+int cpufreq_restore(void);
+#endif
+#endif
+
+
+#ifdef CONFIG_CPU_FREQ_24_API
+/*********************************************************************
+ * CPUFREQ 2.4. INTERFACE *
+ *********************************************************************/
+int cpufreq_setmax(unsigned int cpu);
+#ifdef CONFIG_PM
+int cpufreq_restore(void);
+#endif
+int cpufreq_set(unsigned int kHz, unsigned int cpu);
+unsigned int cpufreq_get(unsigned int cpu);
+
+/* /proc/sys/cpu */
+enum {
+ CPU_NR = 1, /* compatibilty reasons */
+ CPU_NR_0 = 1,
+ CPU_NR_1 = 2,
+ CPU_NR_2 = 3,
+ CPU_NR_3 = 4,
+ CPU_NR_4 = 5,
+ CPU_NR_5 = 6,
+ CPU_NR_6 = 7,
+ CPU_NR_7 = 8,
+ CPU_NR_8 = 9,
+ CPU_NR_9 = 10,
+ CPU_NR_10 = 11,
+ CPU_NR_11 = 12,
+ CPU_NR_12 = 13,
+ CPU_NR_13 = 14,
+ CPU_NR_14 = 15,
+ CPU_NR_15 = 16,
+ CPU_NR_16 = 17,
+ CPU_NR_17 = 18,
+ CPU_NR_18 = 19,
+ CPU_NR_19 = 20,
+ CPU_NR_20 = 21,
+ CPU_NR_21 = 22,
+ CPU_NR_22 = 23,
+ CPU_NR_23 = 24,
+ CPU_NR_24 = 25,
+ CPU_NR_25 = 26,
+ CPU_NR_26 = 27,
+ CPU_NR_27 = 28,
+ CPU_NR_28 = 29,
+ CPU_NR_29 = 30,
+ CPU_NR_30 = 31,
+ CPU_NR_31 = 32,
+};
+
+/* /proc/sys/cpu/{0,1,...,(NR_CPUS-1)} */
+enum {
+ CPU_NR_FREQ_MAX = 1,
+ CPU_NR_FREQ_MIN = 2,
+ CPU_NR_FREQ = 3,
+};
+
+#define CTL_CPU_VARS_SPEED_MAX { \
+ ctl_name: CPU_NR_FREQ_MAX, \
+ data: &cpu_max_freq, \
+ procname: "speed-max", \
+ maxlen: sizeof(cpu_max_freq),\
+ mode: 0444, \
+ proc_handler: proc_dointvec, }
+
+#define CTL_CPU_VARS_SPEED_MIN { \
+ ctl_name: CPU_NR_FREQ_MIN, \
+ data: &cpu_min_freq, \
+ procname: "speed-min", \
+ maxlen: sizeof(cpu_min_freq),\
+ mode: 0444, \
+ proc_handler: proc_dointvec, }
+
+#define CTL_CPU_VARS_SPEED(cpunr) { \
+ ctl_name: CPU_NR_FREQ, \
+ procname: "speed", \
+ mode: 0644, \
+ proc_handler: cpufreq_procctl, \
+ strategy: cpufreq_sysctl, \
+ extra1: (void*) (cpunr), }
+
+#define CTL_TABLE_CPU_VARS(cpunr) static ctl_table ctl_cpu_vars_##cpunr[] = {\
+ CTL_CPU_VARS_SPEED_MAX, \
+ CTL_CPU_VARS_SPEED_MIN, \
+ CTL_CPU_VARS_SPEED(cpunr), \
+ { ctl_name: 0, }, }
+
+/* the ctl_table entry for each CPU */
+#define CPU_ENUM(s) { \
+ ctl_name: (CPU_NR + s), \
+ procname: #s, \
+ mode: 0555, \
+ child: ctl_cpu_vars_##s }
+
+#endif /* CONFIG_CPU_FREQ_24_API */
+
+#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 437572e2240b..b186f69b7217 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -25,7 +25,6 @@
#define GFP_USER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
#define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS | __GFP_HIGHMEM)
#define GFP_KERNEL ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
-#define GFP_NFS ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
#define GFP_KSWAPD ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 30f24600ea0b..d9b8c5d9b55c 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -90,7 +90,6 @@
.thread = INIT_THREAD, \
.fs = &init_fs, \
.files = &init_files, \
- .sigmask_lock = SPIN_LOCK_UNLOCKED, \
.sig = &init_signals, \
.pending = { NULL, &tsk.pending.head, {{0}}}, \
.blocked = {{0}}, \
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 26588de0b514..99ca09224919 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -22,25 +22,6 @@ struct irqaction {
struct irqaction *next;
};
-
-/* Who gets which entry in bh_base. Things which will occur most often
- should come first */
-
-enum {
- TIMER_BH = 0,
- TQUEUE_BH = 1,
- DIGI_BH = 2,
- SERIAL_BH = 3,
- RISCOM8_BH = 4,
- SPECIALIX_BH = 5,
- AURORA_BH = 6,
- ESP_BH = 7,
- IMMEDIATE_BH = 9,
- CYCLADES_BH = 10,
- MACSERIAL_BH = 13,
- ISICOM_BH = 14
-};
-
#include <asm/hardirq.h>
#include <asm/softirq.h>
@@ -218,23 +199,6 @@ static void name (unsigned long dummy) \
#endif /* CONFIG_SMP */
-
-/* Old BH definitions */
-
-extern struct tasklet_struct bh_task_vec[];
-
-/* It is exported _ONLY_ for wait_on_irq(). */
-extern spinlock_t global_bh_lock;
-
-static inline void mark_bh(int nr)
-{
- tasklet_hi_schedule(bh_task_vec+nr);
-}
-
-extern void init_bh(int nr, void (*routine)(void));
-extern void remove_bh(int nr);
-
-
/*
* Autoprobing for irqs:
*
diff --git a/include/linux/mii.h b/include/linux/mii.h
index dc1b22a562ea..9a5799601ee3 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -107,9 +107,11 @@
struct mii_if_info {
int phy_id;
int advertising;
+ int phy_id_mask;
+ int reg_num_mask;
- unsigned int full_duplex : 1;
- unsigned int duplex_lock : 1;
+ unsigned int full_duplex : 1; /* is full duplex? */
+ unsigned int force_media : 1; /* is autoneg. disabled? */
struct net_device *dev;
int (*mdio_read) (struct net_device *dev, int phy_id, int location);
@@ -117,13 +119,20 @@ struct mii_if_info {
};
struct ethtool_cmd;
+struct mii_ioctl_data;
extern int mii_link_ok (struct mii_if_info *mii);
extern int mii_nway_restart (struct mii_if_info *mii);
extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
extern void mii_check_link (struct mii_if_info *mii);
-extern unsigned int mii_check_media (struct mii_if_info *mii, unsigned int ok_to_print);
+extern unsigned int mii_check_media (struct mii_if_info *mii,
+ unsigned int ok_to_print,
+ unsigned int init_media);
+extern int generic_mii_ioctl(struct mii_if_info *mii_if,
+ struct mii_ioctl_data *mii_data, int cmd,
+ unsigned int *duplex_changed);
+
/* This structure is used in all SIOCxMIIxxx ioctl calls */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 580c39c4dcc1..d7d12a69f505 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -24,10 +24,10 @@
#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
#endif
-typedef struct free_area_struct {
+struct free_area {
struct list_head free_list;
unsigned long *map;
-} free_area_t;
+};
struct pglist_data;
@@ -78,7 +78,7 @@ struct zone {
/*
* free areas of different sizes
*/
- free_area_t free_area[MAX_ORDER];
+ struct free_area free_area[MAX_ORDER];
/*
* wait_table -- the array holding the hash table
@@ -168,6 +168,7 @@ typedef struct pglist_data {
unsigned long node_size;
int node_id;
struct pglist_data *pgdat_next;
+ wait_queue_head_t kswapd_wait;
} pg_data_t;
extern int numnodes;
@@ -248,13 +249,23 @@ static inline struct zone *next_zone(struct zone *zone)
#define for_each_zone(zone) \
for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
+#ifdef CONFIG_NUMA
+#define MAX_NR_MEMBLKS BITS_PER_LONG /* Max number of Memory Blocks */
+#else /* !CONFIG_NUMA */
+#define MAX_NR_MEMBLKS 1
+#endif /* CONFIG_NUMA */
+
+#include <asm/topology.h>
+/* Returns the number of the current Node. */
+#define numa_node_id() (__cpu_to_node(smp_processor_id()))
+
#ifndef CONFIG_DISCONTIGMEM
#define NODE_DATA(nid) (&contig_page_data)
#define NODE_MEM_MAP(nid) mem_map
#define MAX_NR_NODES 1
-#else /* !CONFIG_DISCONTIGMEM */
+#else /* CONFIG_DISCONTIGMEM */
#include <asm/mmzone.h>
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 75d86d869771..2ca3a3abce00 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -68,9 +68,9 @@
MSDOS_SB(s)->fat_bits == 16 ? BAD_FAT16 : BAD_FAT12)
/* standard EOF */
-#define EOF_FAT12 0xFF8
-#define EOF_FAT16 0xFFF8
-#define EOF_FAT32 0xFFFFFF8
+#define EOF_FAT12 0xFFF
+#define EOF_FAT16 0xFFFF
+#define EOF_FAT32 0xFFFFFFF
#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? EOF_FAT32 : \
MSDOS_SB(s)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT12)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0970c101c197..0e32a1b9dd5e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -211,6 +211,8 @@ extern void get_page_state(struct page_state *ret);
extern struct address_space swapper_space;
#define PageSwapCache(page) ((page)->mapping == &swapper_space)
+struct page; /* forward declaration */
+
int test_clear_page_dirty(struct page *page);
static inline void clear_page_dirty(struct page *page)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ea37fd84068d..be4d21956fc5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1713,8 +1713,13 @@
#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b
#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c
#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e
+#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
+#define PCI_DEVICE_ID_INTEL_82801E_2 0x2452
+#define PCI_DEVICE_ID_INTEL_82801E_3 0x2453
#define PCI_DEVICE_ID_INTEL_82801E_9 0x245b
#define PCI_DEVICE_ID_INTEL_82801E_11 PCI_DEVICE_ID_INTEL_82801E_9
+#define PCI_DEVICE_ID_INTEL_82801E_13 0x245d
+#define PCI_DEVICE_ID_INTEL_82801E_14 0x245e
#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
#define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482
#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
@@ -1725,8 +1730,16 @@
#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
+#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0
+#define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2
+#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3
+#define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4
+#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
+#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
+#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24cb
#define PCI_DEVICE_ID_INTEL_82801DB_11 PCI_DEVICE_ID_INTEL_82801DB_9
+#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index a5693b3f4a3f..0deab78dea6b 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1632,9 +1632,6 @@ struct reiserfs_journal_header {
/* 12 */ struct journal_params jh_journal;
} ;
-extern task_queue reiserfs_commit_thread_tq ;
-extern wait_queue_head_t reiserfs_commit_thread_wait ;
-
/* biggest tunable defines are right here */
#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */
#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6e535c5b6ebc..8a361b76cf43 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -172,7 +172,6 @@ extern unsigned long cache_decay_ticks;
extern signed long FASTCALL(schedule_timeout(signed long timeout));
asmlinkage void schedule(void);
-extern void flush_scheduled_tasks(void);
extern int start_context_thread(void);
extern int current_is_keventd(void);
@@ -226,15 +225,15 @@ struct signal_struct {
struct k_sigaction action[_NSIG];
spinlock_t siglock;
- /* current thread group signal load-balancing target: */
- task_t *curr_target;
+ /* current thread group signal load-balancing target: */
+ task_t *curr_target;
+ /* shared signal handling: */
struct sigpending shared_pending;
/* thread group exit support */
int group_exit;
int group_exit_code;
-
struct task_struct *group_exit_task;
};
@@ -380,7 +379,6 @@ struct task_struct {
/* namespace */
struct namespace *namespace;
/* signal handlers */
- spinlock_t sigmask_lock; /* Protects signal and blocked */
struct signal_struct *sig;
sigset_t blocked, real_blocked, shared_unblocked;
@@ -657,7 +655,6 @@ extern void exit_mm(struct task_struct *);
extern void exit_files(struct task_struct *);
extern void exit_sighand(struct task_struct *);
extern void __exit_sighand(struct task_struct *);
-extern void remove_thread_group(struct task_struct *tsk, struct signal_struct *sig);
extern void reparent_to_init(void);
extern void daemonize(void);
@@ -720,6 +717,45 @@ do { \
current->state = TASK_RUNNING; \
remove_wait_queue(&wq, &__wait); \
} while (0)
+
+#define wait_event_interruptible(wq, condition) \
+({ \
+ int __ret = 0; \
+ if (!(condition)) \
+ __wait_event_interruptible(wq, condition, __ret); \
+ __ret; \
+})
+
+#define __wait_event_interruptible_timeout(wq, condition, ret) \
+do { \
+ wait_queue_t __wait; \
+ init_waitqueue_entry(&__wait, current); \
+ \
+ add_wait_queue(&wq, &__wait); \
+ for (;;) { \
+ set_current_state(TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (!signal_pending(current)) { \
+ ret = schedule_timeout(ret); \
+ if (!ret) \
+ break; \
+ continue; \
+ } \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ current->state = TASK_RUNNING; \
+ remove_wait_queue(&wq, &__wait); \
+} while (0)
+
+#define wait_event_interruptible_timeout(wq, condition, timeout) \
+({ \
+ long __ret = timeout; \
+ if (!(condition)) \
+ __wait_event_interruptible_timeout(wq, condition, __ret); \
+ __ret; \
+})
/*
* Must be called with the spinlock in the wait_queue_head_t held.
@@ -740,14 +776,6 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q,
__remove_wait_queue(q, wait);
}
-#define wait_event_interruptible(wq, condition) \
-({ \
- int __ret = 0; \
- if (!(condition)) \
- __wait_event_interruptible(wq, condition, __ret); \
- __ret; \
-})
-
#define remove_parent(p) list_del_init(&(p)->sibling)
#define add_parent(p, parent) list_add_tail(&(p)->sibling,&(parent)->children)
@@ -955,7 +983,7 @@ static inline void cond_resched_lock(spinlock_t * lock)
/* Reevaluate whether the task has signals pending delivery.
This is required every time the blocked sigset_t changes.
- Athread cathreaders should have t->sigmask_lock. */
+ callers must hold sig->siglock. */
extern FASTCALL(void recalc_sigpending_tsk(struct task_struct *t));
extern void recalc_sigpending(void);
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 72b03d90f688..ed45b49325af 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -21,7 +21,6 @@ typedef struct kmem_cache_s kmem_cache_t;
#define SLAB_ATOMIC GFP_ATOMIC
#define SLAB_USER GFP_USER
#define SLAB_KERNEL GFP_KERNEL
-#define SLAB_NFS GFP_NFS
#define SLAB_DMA GFP_DMA
#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS)
diff --git a/include/linux/smb.h b/include/linux/smb.h
index 5b8dce292377..9e4944b6121f 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -76,7 +76,6 @@ struct smb_nls_codepage {
* Contains all relevant data on a SMB networked file.
*/
struct smb_fattr {
-
__u16 attr;
unsigned long f_ino;
@@ -84,12 +83,14 @@ struct smb_fattr {
nlink_t f_nlink;
uid_t f_uid;
gid_t f_gid;
+ dev_t f_rdev;
loff_t f_size;
time_t f_atime;
time_t f_mtime;
time_t f_ctime;
unsigned long f_blksize;
unsigned long f_blocks;
+ int f_unix;
};
enum smb_conn_state {
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index be0f419928bc..41f9cd84c0b9 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -112,19 +112,20 @@ smb_kfree(void *obj)
/* NT1 protocol capability bits */
-#define SMB_CAP_RAW_MODE 0x0001
-#define SMB_CAP_MPX_MODE 0x0002
-#define SMB_CAP_UNICODE 0x0004
-#define SMB_CAP_LARGE_FILES 0x0008
-#define SMB_CAP_NT_SMBS 0x0010
-#define SMB_CAP_RPC_REMOTE_APIS 0x0020
-#define SMB_CAP_STATUS32 0x0040
-#define SMB_CAP_LEVEL_II_OPLOCKS 0x0080
-#define SMB_CAP_LOCK_AND_READ 0x0100
-#define SMB_CAP_NT_FIND 0x0200
-#define SMB_CAP_DFS 0x1000
-#define SMB_CAP_LARGE_READX 0x4000
-#define SMB_CAP_LARGE_WRITEX 0x8000
+#define SMB_CAP_RAW_MODE 0x00000001
+#define SMB_CAP_MPX_MODE 0x00000002
+#define SMB_CAP_UNICODE 0x00000004
+#define SMB_CAP_LARGE_FILES 0x00000008
+#define SMB_CAP_NT_SMBS 0x00000010
+#define SMB_CAP_RPC_REMOTE_APIS 0x00000020
+#define SMB_CAP_STATUS32 0x00000040
+#define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080
+#define SMB_CAP_LOCK_AND_READ 0x00000100
+#define SMB_CAP_NT_FIND 0x00000200
+#define SMB_CAP_DFS 0x00001000
+#define SMB_CAP_LARGE_READX 0x00004000
+#define SMB_CAP_LARGE_WRITEX 0x00008000
+#define SMB_CAP_UNIX 0x00800000 /* unofficial ... */
/*
diff --git a/include/linux/smbno.h b/include/linux/smbno.h
index c1495bba359f..c202e2d6cb80 100644
--- a/include/linux/smbno.h
+++ b/include/linux/smbno.h
@@ -328,4 +328,36 @@
#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
+
+/*
+ * UNIX stuff (from samba trans2.h)
+ */
+#define MIN_UNIX_INFO_LEVEL 0x200
+#define MAX_UNIX_INFO_LEVEL 0x2FF
+#define SMB_FIND_FILE_UNIX 0x202
+#define SMB_QUERY_FILE_UNIX_BASIC 0x200
+#define SMB_QUERY_FILE_UNIX_LINK 0x201
+#define SMB_QUERY_FILE_UNIX_HLINK 0x202
+#define SMB_SET_FILE_UNIX_BASIC 0x200
+#define SMB_SET_FILE_UNIX_LINK 0x201
+#define SMB_SET_FILE_UNIX_HLINK 0x203
+#define SMB_QUERY_CIFS_UNIX_INFO 0x200
+
+/* values which means "don't change it" */
+#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
+#define SMB_UID_NO_CHANGE 0xFFFFFFFF
+#define SMB_GID_NO_CHANGE 0xFFFFFFFF
+#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFF
+#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFF
+
+/* UNIX filetype mappings. */
+#define UNIX_TYPE_FILE 0
+#define UNIX_TYPE_DIR 1
+#define UNIX_TYPE_SYMLINK 2
+#define UNIX_TYPE_CHARDEV 3
+#define UNIX_TYPE_BLKDEV 4
+#define UNIX_TYPE_FIFO 5
+#define UNIX_TYPE_SOCKET 6
+#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
+
#endif /* _SMBNO_H_ */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 8844b1408788..f4acbd1e9b46 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -162,7 +162,6 @@ extern void FASTCALL(activate_page(struct page *));
extern void swap_setup(void);
/* linux/mm/vmscan.c */
-extern wait_queue_head_t kswapd_wait;
extern int try_to_free_pages(struct zone *, unsigned int, unsigned int);
/* linux/mm/page_io.c */
diff --git a/include/linux/timer.h b/include/linux/timer.h
index bb498b6ff871..f890f4f3d668 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -2,11 +2,15 @@
#define _LINUX_TIMER_H
#include <linux/config.h>
+#include <linux/smp.h>
#include <linux/stddef.h>
#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/cache.h>
+
+struct tvec_t_base_s;
/*
- * In Linux 2.4, static timers have been removed from the kernel.
* Timers may be dynamically created and destroyed, and should be initialized
* by a call to init_timer() upon creation.
*
@@ -14,22 +18,31 @@
* timeouts. You can use this field to distinguish between the different
* invocations.
*/
-struct timer_list {
+typedef struct timer_list {
struct list_head list;
unsigned long expires;
unsigned long data;
void (*function)(unsigned long);
-};
-
-extern void add_timer(struct timer_list * timer);
-extern int del_timer(struct timer_list * timer);
+ struct tvec_t_base_s *base;
+} timer_t;
+extern void add_timer(timer_t * timer);
+extern int del_timer(timer_t * timer);
+
#ifdef CONFIG_SMP
-extern int del_timer_sync(struct timer_list * timer);
+extern int del_timer_sync(timer_t * timer);
+extern void sync_timers(void);
+#define timer_enter(base, t) do { base->running_timer = t; mb(); } while (0)
+#define timer_exit(base) do { base->running_timer = NULL; } while (0)
+#define timer_is_running(base,t) (base->running_timer == t)
+#define timer_synchronize(base,t) while (timer_is_running(base,t)) barrier()
#else
#define del_timer_sync(t) del_timer(t)
+#define sync_timers() do { } while (0)
+#define timer_enter(base,t) do { } while (0)
+#define timer_exit(base) do { } while (0)
#endif
-
+
/*
* mod_timer is a more efficient way to update the expire field of an
* active timer (if the timer is inactive it will be activated)
@@ -37,16 +50,20 @@ extern int del_timer_sync(struct timer_list * timer);
* If the timer is known to be not pending (ie, in the handler), mod_timer
* is less efficient than a->expires = b; add_timer(a).
*/
-int mod_timer(struct timer_list *timer, unsigned long expires);
+int mod_timer(timer_t *timer, unsigned long expires);
extern void it_real_fn(unsigned long);
-static inline void init_timer(struct timer_list * timer)
+extern void init_timers(void);
+extern void run_local_timers(void);
+
+static inline void init_timer(timer_t * timer)
{
timer->list.next = timer->list.prev = NULL;
+ timer->base = NULL;
}
-static inline int timer_pending (const struct timer_list * timer)
+static inline int timer_pending(const timer_t * timer)
{
return timer->list.next != NULL;
}
diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h
index d4729c518f22..cca0b193617b 100644
--- a/include/linux/tqueue.h
+++ b/include/linux/tqueue.h
@@ -1,13 +1,12 @@
/*
* tqueue.h --- task queue handling for Linux.
*
- * Mostly based on a proposed bottom-half replacement code written by
- * Kai Petzke, wpp@marie.physik.tu-berlin.de.
+ * Modified version of previous incarnations of task-queues,
+ * written by:
*
+ * (C) 1994 Kai Petzke, wpp@marie.physik.tu-berlin.de
* Modified for use in the Linux kernel by Theodore Ts'o,
- * tytso@mit.edu. Any bugs are my fault, not Kai's.
- *
- * The original comment follows below.
+ * tytso@mit.edu.
*/
#ifndef _LINUX_TQUEUE_H
@@ -18,25 +17,8 @@
#include <linux/bitops.h>
#include <asm/system.h>
-/*
- * New proposed "bottom half" handlers:
- * (C) 1994 Kai Petzke, wpp@marie.physik.tu-berlin.de
- *
- * Advantages:
- * - Bottom halfs are implemented as a linked list. You can have as many
- * of them, as you want.
- * - No more scanning of a bit field is required upon call of a bottom half.
- * - Support for chained bottom half lists. The run_task_queue() function can be
- * used as a bottom half handler. This is for example useful for bottom
- * halfs, which want to be delayed until the next clock tick.
- *
- * Notes:
- * - Bottom halfs are called in the reverse order that they were linked into
- * the list.
- */
-
struct tq_struct {
- struct list_head list; /* linked list of active bh's */
+ struct list_head list; /* linked list of active tq's */
unsigned long sync; /* must be initialized to zero */
void (*routine)(void *); /* function to call */
void *data; /* argument to function */
@@ -61,68 +43,13 @@ struct tq_struct {
PREPARE_TQUEUE((_tq), (_routine), (_data)); \
} while (0)
-typedef struct list_head task_queue;
-
#define DECLARE_TASK_QUEUE(q) LIST_HEAD(q)
-#define TQ_ACTIVE(q) (!list_empty(&q))
-
-extern task_queue tq_timer, tq_immediate;
-
-/*
- * To implement your own list of active bottom halfs, use the following
- * two definitions:
- *
- * DECLARE_TASK_QUEUE(my_tqueue);
- * struct tq_struct my_task = {
- * routine: (void (*)(void *)) my_routine,
- * data: &my_data
- * };
- *
- * To activate a bottom half on a list, use:
- *
- * queue_task(&my_task, &my_tqueue);
- *
- * To later run the queued tasks use
- *
- * run_task_queue(&my_tqueue);
- *
- * This allows you to do deferred processing. For example, you could
- * have a task queue called tq_timer, which is executed within the timer
- * interrupt.
- */
-
-extern spinlock_t tqueue_lock;
-
-/*
- * Queue a task on a tq. Return non-zero if it was successfully
- * added.
- */
-static inline int queue_task(struct tq_struct *bh_pointer, task_queue *bh_list)
-{
- int ret = 0;
- if (!test_and_set_bit(0,&bh_pointer->sync)) {
- unsigned long flags;
- spin_lock_irqsave(&tqueue_lock, flags);
- list_add_tail(&bh_pointer->list, bh_list);
- spin_unlock_irqrestore(&tqueue_lock, flags);
- ret = 1;
- }
- return ret;
-}
/* Schedule a tq to run in process context */
extern int schedule_task(struct tq_struct *task);
-/*
- * Call all "bottom halfs" on a given list.
- */
-
-extern void __run_task_queue(task_queue *list);
+/* finish all currently pending tasks - do not call from irq context */
+extern void flush_scheduled_tasks(void);
-static inline void run_task_queue(task_queue *list)
-{
- if (TQ_ACTIVE(*list))
- __run_task_queue(list);
-}
+#endif
-#endif /* _LINUX_TQUEUE_H */
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 51a74dff1541..738ffcd53264 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -19,7 +19,7 @@ _INLINE_ void tty_insert_flip_char(struct tty_struct *tty,
_INLINE_ void tty_schedule_flip(struct tty_struct *tty)
{
- queue_task(&tty->flip.tqueue, &tq_timer);
+ schedule_task(&tty->flip.tqueue);
}
#undef _INLINE_