diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2004-10-18 17:31:35 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-10-18 17:31:35 -0700 |
| commit | 7081675f58b38ee61497b7a1ea206a7fde0d00ca (patch) | |
| tree | aeb558edb87dcd64bbe2f7168f3a5dfb7962dc73 /include/linux | |
| parent | c6fcf5a9eadb0aed33c07b4e829ca9c6614f3807 (diff) | |
| parent | a4946826c30c56a5830326552a395c5b6afc13ef (diff) | |
Merge kroah.com:/home/greg/linux/BK/bleed-2.6
into kroah.com:/home/greg/linux/BK/usb-2.6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acct.h | 23 | ||||
| -rw-r--r-- | include/linux/compiler.h | 7 | ||||
| -rw-r--r-- | include/linux/hardirq.h | 42 | ||||
| -rw-r--r-- | include/linux/highmem.h | 4 | ||||
| -rw-r--r-- | include/linux/init_task.h | 2 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 9 | ||||
| -rw-r--r-- | include/linux/irq.h | 18 | ||||
| -rw-r--r-- | include/linux/libata.h | 2 | ||||
| -rw-r--r-- | include/linux/linkage.h | 4 | ||||
| -rw-r--r-- | include/linux/mm.h | 2 | ||||
| -rw-r--r-- | include/linux/notifier.h | 10 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
| -rw-r--r-- | include/linux/ptrace.h | 1 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs.h | 63 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs_sb.h | 42 | ||||
| -rw-r--r-- | include/linux/sched.h | 101 | ||||
| -rw-r--r-- | include/linux/security.h | 2 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 1 | ||||
| -rw-r--r-- | include/linux/times.h | 20 | ||||
| -rw-r--r-- | include/linux/topology.h | 72 | ||||
| -rw-r--r-- | include/linux/videodev.h | 1 |
21 files changed, 357 insertions, 71 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index b46ce1ac1c6a..a6ab17c49aa1 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -172,17 +172,24 @@ static inline u32 jiffies_to_AHZ(unsigned long x) #endif } -static inline u64 jiffies_64_to_AHZ(u64 x) +static inline u64 nsec_to_AHZ(u64 x) { -#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 -#if HZ != AHZ - do_div(x, HZ / AHZ); -#endif -#else - x *= TICK_NSEC; +#if (NSEC_PER_SEC % AHZ) == 0 do_div(x, (NSEC_PER_SEC / AHZ)); +#elif (AHZ % 512) == 0 + x *= AHZ/512; + do_div(x, (NSEC_PER_SEC / 512)); +#else + /* + * max relative error 5.7e-8 (1.8s per year) for AHZ <= 1024, + * overflow after 64.99 years. + * exact for AHZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... + */ + x *= 9; + do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (AHZ/2)) + / AHZ)); #endif - return x; + return x; } #endif /* __KERNEL */ diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 62949aa638bb..b1a757d315a5 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -1,6 +1,8 @@ #ifndef __LINUX_COMPILER_H #define __LINUX_COMPILER_H +#ifndef __ASSEMBLY__ + #ifdef __CHECKER__ # define __user __attribute__((noderef, address_space(1))) # define __kernel /* default address space */ @@ -17,11 +19,11 @@ extern void __chk_io_ptr(void __iomem *); # define __iomem # define __chk_user_ptr(x) (void)0 # define __chk_io_ptr(x) (void)0 +# define __builtin_warning(x, y...) (1) #endif #ifdef __KERNEL__ -#ifndef __ASSEMBLY__ #if __GNUC__ > 3 # include <linux/compiler-gcc+.h> /* catch-all for GCC 4, 5, etc. */ #elif __GNUC__ == 3 @@ -31,7 +33,6 @@ extern void __chk_io_ptr(void __iomem *); #else # error Sorry, your compiler is too old/not recognized. #endif -#endif /* Intel compiler defines __GNUC__. So we will overwrite implementations * coming from above header files here @@ -61,6 +62,8 @@ extern void __chk_io_ptr(void __iomem *); (typeof(ptr)) (__ptr + (off)); }) #endif +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ /* diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 7e1aad3947e7..97343be12ad8 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -5,6 +5,40 @@ #include <linux/smp_lock.h> #include <asm/hardirq.h> +#ifdef CONFIG_GENERIC_HARDIRQS +/* + * We put the hardirq and softirq counter into the preemption + * counter. The bitmask has the following meaning: + * + * - bits 0-7 are the preemption count (max preemption depth: 256) + * - bits 8-15 are the softirq count (max # of softirqs: 256) + * - bits 16-27 are the hardirq count (max # of hardirqs: 4096) + * + * - ( bit 26 is the PREEMPT_ACTIVE flag. ) + * + * PREEMPT_MASK: 0x000000ff + * SOFTIRQ_MASK: 0x0000ff00 + * HARDIRQ_MASK: 0x0fff0000 + */ + +#define PREEMPT_BITS 8 +#define SOFTIRQ_BITS 8 +#define HARDIRQ_BITS 12 + +#define PREEMPT_SHIFT 0 +#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) +#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) + +/* + * The hardirq mask has to be large enough to have + * space for potentially all IRQ sources in the system + * nesting on a single CPU: + */ +#if (1 << HARDIRQ_BITS) < NR_IRQS +# error HARDIRQ_BITS is too low! +#endif +#endif /* CONFIG_GENERIC_HARDIRQS */ + #define __IRQ_MASK(x) ((1UL << (x))-1) #define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT) @@ -43,4 +77,12 @@ extern void synchronize_irq(unsigned int irq); # define synchronize_irq(irq) barrier() #endif +#ifdef CONFIG_GENERIC_HARDIRQS +#define nmi_enter() (preempt_count() += HARDIRQ_OFFSET) +#define nmi_exit() (preempt_count() -= HARDIRQ_OFFSET) + +#define irq_enter() (preempt_count() += HARDIRQ_OFFSET) +extern void irq_exit(void); +#endif + #endif /* LINUX_HARDIRQ_H */ diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 232d8fdb557c..7153aef34d5c 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -40,6 +40,8 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) void *addr = kmap_atomic(page, KM_USER0); clear_user_page(addr, vaddr, page); kunmap_atomic(addr, KM_USER0); + /* Make sure this page is cleared on other CPU's too before using it */ + smp_wmb(); } static inline void clear_highpage(struct page *page) @@ -73,6 +75,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign copy_user_page(vto, vfrom, vaddr, to); kunmap_atomic(vfrom, KM_USER0); kunmap_atomic(vto, KM_USER1); + /* Make sure this page is cleared on other CPU's too before using it */ + smp_wmb(); } static inline void copy_highpage(struct page *to, struct page *from) diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 9937c8df8d7c..803d8efb1c4a 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -50,6 +50,7 @@ .list = LIST_HEAD_INIT(sig.shared_pending.list), \ .signal = {{0}}}, \ .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ + .rlim = INIT_RLIMITS, \ } #define INIT_SIGHAND(sighand) { \ @@ -96,7 +97,6 @@ extern struct group_info init_groups; .cap_inheritable = CAP_INIT_INH_SET, \ .cap_permitted = CAP_FULL_SET, \ .keep_capabilities = 0, \ - .rlim = INIT_RLIMITS, \ .user = INIT_USER, \ .comm = "swapper", \ .thread = INIT_THREAD, \ diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c7bf37959009..2b0f7331f9c3 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -40,6 +40,8 @@ struct irqaction { const char *name; void *dev_id; struct irqaction *next; + int irq; + struct proc_dir_entry *dir; }; extern irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs); @@ -48,6 +50,13 @@ extern int request_irq(unsigned int, unsigned long, const char *, void *); extern void free_irq(unsigned int, void *); + +#ifdef CONFIG_GENERIC_HARDIRQS +extern void disable_irq_nosync(unsigned int irq); +extern void disable_irq(unsigned int irq); +extern void enable_irq(unsigned int irq); +#endif + /* * Temporary defines for UP kernels, until all code gets fixed. */ diff --git a/include/linux/irq.h b/include/linux/irq.h index 5bc740d9bc47..fa3677deff3c 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -13,6 +13,7 @@ #if !defined(CONFIG_ARCH_S390) +#include <linux/linkage.h> #include <linux/cache.h> #include <linux/spinlock.h> #include <linux/cpumask.h> @@ -71,7 +72,22 @@ extern irq_desc_t irq_desc [NR_IRQS]; #include <asm/hw_irq.h> /* the arch dependent stuff */ -extern int setup_irq(unsigned int , struct irqaction * ); +extern int setup_irq(unsigned int irq, struct irqaction * new); + +#ifdef CONFIG_GENERIC_HARDIRQS +extern cpumask_t irq_affinity[NR_IRQS]; +extern int no_irq_affinity; +extern int noirqdebug_setup(char *str); + +extern asmlinkage int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, + struct irqaction *action); +extern asmlinkage unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); +extern void note_interrupt(unsigned int irq, irq_desc_t *desc, int action_ret); +extern void report_bad_irq(unsigned int irq, irq_desc_t *desc, int action_ret); +extern int can_request_irq(unsigned int irq, unsigned long irqflags); + +extern void init_irq_proc(void); +#endif extern hw_irq_controller no_irq_type; /* needed in every arch ? */ diff --git a/include/linux/libata.h b/include/linux/libata.h index 171b06794ada..407b4adc06d1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -189,6 +189,7 @@ struct ata_probe_ent { Scsi_Host_Template *sht; struct ata_ioports port[ATA_MAX_PORTS]; unsigned int n_ports; + unsigned int hard_port_no; unsigned int pio_mask; unsigned int mwdma_mask; unsigned int udma_mask; @@ -273,6 +274,7 @@ struct ata_port { unsigned long flags; /* ATA_FLAG_xxx */ unsigned int id; /* unique id req'd by scsi midlyr */ unsigned int port_no; /* unique port #; from zero */ + unsigned int hard_port_no; /* hardware port #; from zero */ struct ata_prd *prd; /* our SG list */ dma_addr_t prd_dma; /* and its DMA mapping */ diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 09955c0ce848..338f7795d8a0 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -14,6 +14,10 @@ #define asmlinkage CPP_ASMLINKAGE #endif +#ifndef prevent_tail_call +# define prevent_tail_call(ret) do { } while (0) +#endif + #ifndef __ALIGN #define __ALIGN .align 4,0x90 #define __ALIGN_STR ".align 4,0x90" diff --git a/include/linux/mm.h b/include/linux/mm.h index 65ff5b5e896a..158ee1c501f0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -540,7 +540,7 @@ static inline int can_do_mlock(void) { if (capable(CAP_IPC_LOCK)) return 1; - if (current->rlim[RLIMIT_MEMLOCK].rlim_cur != 0) + if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0) return 1; return 0; } diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 900d43e88005..9303a003e9ab 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -64,10 +64,12 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi #define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ -#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ -#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ -#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ -#define CPU_DEAD 0x0006 /* CPU (unsigned)v dead */ +#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ +#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ +#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ +#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ +#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ +#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ #endif /* __KERNEL__ */ #endif /* _LINUX_NOTIFIER_H */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index eed506d0196d..271f3eb29a60 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2205,6 +2205,8 @@ #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 #define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582 #define PCI_DEVICE_ID_INTEL_SMCH 0x3590 +#define PCI_DEVICE_ID_INTEL_E7320_MCH 0x3592 +#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e #define PCI_DEVICE_ID_INTEL_80310 0x530d #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 53132cd80429..f18247125091 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -63,6 +63,7 @@ #define PT_TRACE_EXEC 0x00000080 #define PT_TRACE_VFORK_DONE 0x00000100 #define PT_TRACE_EXIT 0x00000200 +#define PT_ATTACHED 0x00000400 /* parent != real_parent */ #define PT_TRACE_MASK 0x000003f4 diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 2bcb5bb73ebb..6eacc2c653f1 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -1711,14 +1711,29 @@ struct reiserfs_journal_header { #define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize) enum reiserfs_bh_state_bits { - BH_JDirty = BH_PrivateStart, + BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */ BH_JDirty_wait, - BH_JNew, + BH_JNew, /* disk block was taken off free list before + * being in a finished transaction, or + * written to disk. Can be reused immed. */ BH_JPrepared, BH_JRestore_dirty, BH_JTest, // debugging only will go away }; +BUFFER_FNS(JDirty, journaled); +TAS_BUFFER_FNS(JDirty, journaled); +BUFFER_FNS(JDirty_wait, journal_dirty); +TAS_BUFFER_FNS(JDirty_wait, journal_dirty); +BUFFER_FNS(JNew, journal_new); +TAS_BUFFER_FNS(JNew, journal_new); +BUFFER_FNS(JPrepared, journal_prepared); +TAS_BUFFER_FNS(JPrepared, journal_prepared); +BUFFER_FNS(JRestore_dirty, journal_restore_dirty); +TAS_BUFFER_FNS(JRestore_dirty, journal_restore_dirty); +BUFFER_FNS(JTest, journal_test); +TAS_BUFFER_FNS(JTest, journal_test); + /* ** transaction handle which is passed around for all journal calls */ @@ -1736,6 +1751,7 @@ struct reiserfs_transaction_handle { void *t_handle_save ; /* save existing current->journal_info */ unsigned displace_new_blocks:1; /* if new block allocation occurres, that block should be displaced from others */ + struct list_head t_list; } ; /* used to keep track of ordered and tail writes, attached to the buffer @@ -1795,41 +1811,14 @@ int journal_mark_freed(struct reiserfs_transaction_handle *, struct super_block int journal_transaction_should_end(struct reiserfs_transaction_handle *, int) ; int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr, int searchall, b_blocknr_t *next) ; int journal_begin(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; - -int buffer_journaled(const struct buffer_head *bh) ; -int mark_buffer_journal_new(struct buffer_head *bh) ; +int journal_join_abort(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; +void reiserfs_journal_abort (struct super_block *sb, int errno); +void reiserfs_abort (struct super_block *sb, int errno, const char *fmt, ...); int reiserfs_allocate_list_bitmaps(struct super_block *s, struct reiserfs_list_bitmap *, int) ; - /* why is this kerplunked right here? */ -static inline int reiserfs_buffer_prepared(const struct buffer_head *bh) { - if (bh && test_bit(BH_JPrepared, &bh->b_state)) - return 1 ; - else - return 0 ; -} - -/* buffer was journaled, waiting to get to disk */ -static inline int buffer_journal_dirty(const struct buffer_head *bh) { - if (bh) - return test_bit(BH_JDirty_wait, &bh->b_state) ; - else - return 0 ; -} -static inline int mark_buffer_notjournal_dirty(struct buffer_head *bh) { - if (bh) - clear_bit(BH_JDirty_wait, &bh->b_state) ; - return 0 ; -} -static inline int mark_buffer_notjournal_new(struct buffer_head *bh) { - if (bh) { - clear_bit(BH_JNew, &bh->b_state) ; - } - return 0 ; -} - void add_save_link (struct reiserfs_transaction_handle * th, struct inode * inode, int truncate); -void remove_save_link (struct inode * inode, int truncate); +int remove_save_link (struct inode * inode, int truncate); /* objectid.c */ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th); @@ -1925,8 +1914,8 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th, void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th, struct inode *inode, struct key * key); -void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode); -void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, +int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode); +int reiserfs_do_truncate (struct reiserfs_transaction_handle *th, struct inode * p_s_inode, struct page *, int update_timestamps); @@ -1940,7 +1929,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, void padd_item (char * item, int total_length, int length); /* inode.c */ -void restart_transaction(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *path); +int restart_transaction(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *path); void reiserfs_read_locked_inode(struct inode * inode, struct reiserfs_iget_args *args) ; int reiserfs_find_actor(struct inode * inode, void *p) ; int reiserfs_init_locked_inode(struct inode * inode, void *p) ; @@ -1955,7 +1944,7 @@ int reiserfs_encode_fh( struct dentry *dentry, __u32 *data, int *lenp, int connectable ); int reiserfs_prepare_write(struct file *, struct page *, unsigned, unsigned) ; -void reiserfs_truncate_file(struct inode *, int update_timestamps) ; +int reiserfs_truncate_file(struct inode *, int update_timestamps) ; void make_cpu_key (struct cpu_key * cpu_key, struct inode * inode, loff_t offset, int type, int key_length); void make_le_item_head (struct item_head * ih, const struct cpu_key * key, diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 16d340b08e7d..891418bb525a 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -206,11 +206,11 @@ struct reiserfs_journal { int j_cnode_used ; /* number of cnodes on the used list */ int j_cnode_free ; /* number of cnodes on the free list */ - unsigned int s_journal_trans_max ; /* max number of blocks in a transaction. */ - unsigned int s_journal_max_batch ; /* max number of blocks to batch into a trans */ - unsigned int s_journal_max_commit_age ; /* in seconds, how old can an async commit be */ - unsigned int s_journal_default_max_commit_age ; /* the default for the max commit age */ - unsigned int s_journal_max_trans_age ; /* in seconds, how old can a transaction be */ + unsigned int j_trans_max ; /* max number of blocks in a transaction. */ + unsigned int j_max_batch ; /* max number of blocks to batch into a trans */ + unsigned int j_max_commit_age ; /* in seconds, how old can an async commit be */ + unsigned int j_max_trans_age ; /* in seconds, how old can a transaction be */ + unsigned int j_default_max_commit_age ; /* the default for the max commit age */ struct reiserfs_journal_cnode *j_cnode_free_list ; struct reiserfs_journal_cnode *j_cnode_free_orig ; /* orig pointer returned from vmalloc */ @@ -242,14 +242,24 @@ struct reiserfs_journal { struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE] ; /* hash table for all the real buffer heads in all the transactions */ struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */ + int j_persistent_trans; unsigned long j_max_trans_size ; unsigned long j_max_batch_size ; + int j_errno; + /* when flushing ordered buffers, throttle new ordered writers */ struct work_struct j_work; atomic_t j_async_throttle; }; +enum journal_state_bits { + J_WRITERS_BLOCKED = 1, /* set when new writers not allowed */ + J_WRITERS_QUEUED, /* set when log is full due to too many writers */ + J_ABORTED, /* set when log is aborted */ +}; + + #define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */ typedef __u32 (*hashf_t) (const signed char *, int); @@ -399,6 +409,7 @@ struct reiserfs_sb_info struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ struct rw_semaphore xattr_dir_sem; + int j_errno; }; /* Definitions of reiserfs on-disk properties: */ @@ -447,6 +458,11 @@ enum reiserfs_mount_options { REISERFS_BARRIER_NONE, REISERFS_BARRIER_FLUSH, + /* Actions on error */ + REISERFS_ERROR_PANIC, + REISERFS_ERROR_RO, + REISERFS_ERROR_CONTINUE, + REISERFS_TEST1, REISERFS_TEST2, REISERFS_TEST3, @@ -478,6 +494,10 @@ enum reiserfs_mount_options { #define reiserfs_barrier_none(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_NONE)) #define reiserfs_barrier_flush(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_FLUSH)) +#define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC)) +#define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO)) +#define reiserfs_error_continue(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_CONTINUE)) + void reiserfs_file_buffer (struct buffer_head * bh, int list); extern struct file_system_type reiserfs_fs_type; int reiserfs_resize(struct super_block *, unsigned long) ; @@ -494,12 +514,6 @@ int reiserfs_resize(struct super_block *, unsigned long) ; #define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->) -#define SB_JOURNAL_TRANS_MAX(s) (SB_JOURNAL(s)->s_journal_trans_max) -#define SB_JOURNAL_MAX_BATCH(s) (SB_JOURNAL(s)->s_journal_max_batch) -#define SB_JOURNAL_MAX_COMMIT_AGE(s) (SB_JOURNAL(s)->s_journal_max_commit_age) -#define SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(s) (SB_JOURNAL(s)->s_journal_default_max_commit_age) -#define SB_JOURNAL_MAX_TRANS_AGE(s) (SB_JOURNAL(s)->s_journal_max_trans_age) - /* A safe version of the "bdevname", which returns the "s_id" field of * a superblock or else "Null superblock" if the super block is NULL. */ @@ -508,4 +522,10 @@ static inline char *reiserfs_bdevname(struct super_block *s) return (s == NULL) ? "Null superblock" : s -> s_id; } +#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal))) +static inline int __reiserfs_is_journal_aborted (struct reiserfs_journal *journal) +{ + return test_bit (J_ABORTED, &journal->j_state); +} + #endif /* _LINUX_REISER_FS_SB */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 90f5cb645116..dc3f297a726d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -29,6 +29,7 @@ #include <linux/completion.h> #include <linux/pid.h> #include <linux/percpu.h> +#include <linux/topology.h> struct exec_domain; @@ -107,8 +108,8 @@ extern unsigned long nr_iowait(void); #define TASK_UNINTERRUPTIBLE 2 #define TASK_STOPPED 4 #define TASK_TRACED 8 -#define TASK_ZOMBIE 16 -#define TASK_DEAD 32 +#define EXIT_ZOMBIE 16 +#define EXIT_DEAD 32 #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) @@ -312,6 +313,17 @@ struct signal_struct { unsigned long utime, stime, cutime, cstime; unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; + + /* + * We don't bother to synchronize most readers of this at all, + * because there is no reader checking a limit that actually needs + * to get both rlim_cur and rlim_max atomically, and either one + * alone is a single word that can safely be read normally. + * getrlimit/setrlimit use task_lock(current->group_leader) to + * protect this instead of the siglock, because they really + * have no need to disable irqs. + */ + struct rlimit rlim[RLIM_NLIMITS]; }; /* @@ -395,6 +407,86 @@ struct sched_info { extern struct file_operations proc_schedstat_operations; #endif +enum idle_type +{ + SCHED_IDLE, + NOT_IDLE, + NEWLY_IDLE, + MAX_IDLE_TYPES +}; + +/* + * sched-domains (multiprocessor balancing) declarations: + */ +#ifdef CONFIG_SMP +#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ + +#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ +#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ +#define SD_BALANCE_EXEC 4 /* Balance on exec */ +#define SD_WAKE_IDLE 8 /* Wake to idle CPU on task wakeup */ +#define SD_WAKE_AFFINE 16 /* Wake task to waking CPU */ +#define SD_WAKE_BALANCE 32 /* Perform balancing at task wakeup */ +#define SD_SHARE_CPUPOWER 64 /* Domain members share cpu power */ + +struct sched_group { + struct sched_group *next; /* Must be a circular list */ + cpumask_t cpumask; + + /* + * CPU power of this group, SCHED_LOAD_SCALE being max power for a + * single CPU. This is read only (except for setup, hotplug CPU). + */ + unsigned long cpu_power; +}; + +struct sched_domain { + /* These fields must be setup */ + struct sched_domain *parent; /* top domain must be null terminated */ + struct sched_group *groups; /* the balancing groups of the domain */ + cpumask_t span; /* span of all CPUs in this domain */ + unsigned long min_interval; /* Minimum balance interval ms */ + unsigned long max_interval; /* Maximum balance interval ms */ + unsigned int busy_factor; /* less balancing by factor if busy */ + unsigned int imbalance_pct; /* No balance until over watermark */ + unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ + unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ + unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ + int flags; /* See SD_* */ + + /* Runtime fields. */ + unsigned long last_balance; /* init to jiffies. units in jiffies */ + unsigned int balance_interval; /* initialise to 1. units in ms. */ + unsigned int nr_balance_failed; /* initialise to 0 */ + +#ifdef CONFIG_SCHEDSTATS + /* load_balance() stats */ + unsigned long lb_cnt[MAX_IDLE_TYPES]; + unsigned long lb_failed[MAX_IDLE_TYPES]; + unsigned long lb_imbalance[MAX_IDLE_TYPES]; + unsigned long lb_nobusyg[MAX_IDLE_TYPES]; + unsigned long lb_nobusyq[MAX_IDLE_TYPES]; + + /* sched_balance_exec() stats */ + unsigned long sbe_attempts; + unsigned long sbe_pushed; + + /* try_to_wake_up() stats */ + unsigned long ttwu_wake_affine; + unsigned long ttwu_wake_balance; +#endif +}; + +#ifdef ARCH_HAS_SCHED_DOMAIN +/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */ +extern cpumask_t cpu_isolated_map; +extern void init_sched_build_groups(struct sched_group groups[], + cpumask_t span, int (*group_fn)(int cpu)); +extern void cpu_attach_domain(struct sched_domain *sd, int cpu); +#endif /* ARCH_HAS_SCHED_DOMAIN */ +#endif /* CONFIG_SMP */ + + struct io_context; /* See blkdev.h */ void exit_io_context(void); @@ -472,6 +564,7 @@ struct task_struct { /* task state */ struct linux_binfmt *binfmt; + long exit_state; int exit_code, exit_signal; int pdeath_signal; /* The signal sent when the parent dies */ /* ??? */ @@ -508,7 +601,7 @@ struct task_struct { struct timer_list real_timer; unsigned long utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ - u64 start_time; + struct timespec start_time; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt; /* process credentials */ @@ -518,8 +611,6 @@ struct task_struct { kernel_cap_t cap_effective, cap_inheritable, cap_permitted; unsigned keep_capabilities:1; struct user_struct *user; -/* limits */ - struct rlimit rlim[RLIM_NLIMITS]; unsigned short used_math; char comm[16]; /* file system info */ diff --git a/include/linux/security.h b/include/linux/security.h index 983d7c2265bc..a1dee9a60587 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -582,7 +582,7 @@ struct swap_info_struct; * @task_setrlimit: * Check permission before setting the resource limits of the current * process for @resource to @new_rlim. The old resource limit values can - * be examined by dereferencing (current->rlim + resource). + * be examined by dereferencing (current->signal->rlim + resource). * @resource contains the resource whose limit is being set. * @new_rlim contains the new limits for @resource. * Return 0 if permission is granted. diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index bd26cf298d9a..2a8c7faf2dcc 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -489,6 +489,7 @@ asmlinkage long sys_nfsservctl(int cmd, void __user *res); asmlinkage long sys_syslog(int type, char __user *buf, int len); asmlinkage long sys_uselib(const char __user *library); +asmlinkage long sys_setaltroot(const char __user *altroot); asmlinkage long sys_ni_syscall(void); #endif diff --git a/include/linux/times.h b/include/linux/times.h index ff00f334ffaa..0c5aa078dad4 100644 --- a/include/linux/times.h +++ b/include/linux/times.h @@ -55,6 +55,26 @@ static inline u64 jiffies_64_to_clock_t(u64 x) } #endif +static inline u64 nsec_to_clock_t(u64 x) +{ +#if (NSEC_PER_SEC % USER_HZ) == 0 + do_div(x, (NSEC_PER_SEC / USER_HZ)); +#elif (USER_HZ % 512) == 0 + x *= USER_HZ/512; + do_div(x, (NSEC_PER_SEC / 512)); +#else + /* + * max relative error 5.7e-8 (1.8s per year) for USER_HZ <= 1024, + * overflow after 64.99 years. + * exact for HZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... + */ + x *= 9; + do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (USER_HZ/2)) + / USER_HZ)); +#endif + return x; +} + struct tms { clock_t tms_utime; clock_t tms_stime; diff --git a/include/linux/topology.h b/include/linux/topology.h index fbaa8774a431..10df2542653b 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -61,4 +61,76 @@ static inline int __next_node_with_cpus(int node) #define PENALTY_FOR_NODE_WITH_CPUS (1) #endif +/* + * Below are the 3 major initializers used in building sched_domains: + * SD_SIBLING_INIT, for SMT domains + * SD_CPU_INIT, for SMP domains + * SD_NODE_INIT, for NUMA domains + * + * Any architecture that cares to do any tuning to these values should do so + * by defining their own arch-specific initializer in include/asm/topology.h. + * A definition there will automagically override these default initializers + * and allow arch-specific performance tuning of sched_domains. + */ +#ifdef CONFIG_SCHED_SMT +/* MCD - Do we really need this? It is always on if CONFIG_SCHED_SMT is, + * so can't we drop this in favor of CONFIG_SCHED_SMT? + */ +#define ARCH_HAS_SCHED_WAKE_IDLE +/* Common values for SMT siblings */ +#ifndef SD_SIBLING_INIT +#define SD_SIBLING_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 1, \ + .max_interval = 2, \ + .busy_factor = 8, \ + .imbalance_pct = 110, \ + .cache_hot_time = 0, \ + .cache_nice_tries = 0, \ + .per_cpu_gain = 25, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_NEWIDLE \ + | SD_BALANCE_EXEC \ + | SD_WAKE_AFFINE \ + | SD_WAKE_IDLE \ + | SD_SHARE_CPUPOWER, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} +#endif +#endif /* CONFIG_SCHED_SMT */ + +/* Common values for CPUs */ +#ifndef SD_CPU_INIT +#define SD_CPU_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 1, \ + .max_interval = 4, \ + .busy_factor = 64, \ + .imbalance_pct = 125, \ + .cache_hot_time = (5*1000/2), \ + .cache_nice_tries = 1, \ + .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_NEWIDLE \ + | SD_BALANCE_EXEC \ + | SD_WAKE_AFFINE \ + | SD_WAKE_BALANCE, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} +#endif + +#ifdef CONFIG_NUMA +#ifndef SD_NODE_INIT +#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! +#endif +#endif /* CONFIG_NUMA */ + #endif /* _LINUX_TOPOLOGY_H */ diff --git a/include/linux/videodev.h b/include/linux/videodev.h index a15ab1ade452..54767a5c7a07 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -433,6 +433,7 @@ struct video_code #define VID_HARDWARE_W9968CF 36 #define VID_HARDWARE_SAA7114H 37 #define VID_HARDWARE_SN9C102 38 +#define VID_HARDWARE_ARV 39 #endif /* __LINUX_VIDEODEV_H */ /* |
