diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 18:35:05 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 18:35:05 -0800 |
| commit | d2a0e8decde7ef3354d8cdaa0ddf5517e5759ca2 (patch) | |
| tree | 7769ba8a9aa7c7fe6a510409dfcecbbfede212b9 /include/linux | |
| parent | 9c6f70be049f5a0439996107e58bf65e9a5d9a09 (diff) | |
v2.4.5 -> v2.4.5.1
- Andreas Dilger: make ext2fs react more gracefully to inode disk
errors
- Andrea Arkangeli: fix up alpha compile issues
- Ingo Molnar: io-apic MP table parsing update and softirq latency
update
- Johannes Erdfelt: USB updates
- Richard Henderson: alpha rawhide irq handling fixes
- Marcelo, Andrea, Rik: more VM issues
- Al Viro: fix various ext2 directory handling checks by biting the
bullet and using the page cache.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ext2_fs.h | 32 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 58 | ||||
| -rw-r--r-- | include/linux/irq_cpustat.h | 3 | ||||
| -rw-r--r-- | include/linux/mm.h | 31 | ||||
| -rw-r--r-- | include/linux/mmzone.h | 5 | ||||
| -rw-r--r-- | include/linux/slab.h | 2 |
6 files changed, 54 insertions, 77 deletions
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 63922d2c0d32..68d2731efc8f 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -498,16 +498,17 @@ struct ext2_dir_entry_2 { * Ext2 directory file types. Only the low 3 bits are used. The * other bits are reserved for now. */ -#define EXT2_FT_UNKNOWN 0 -#define EXT2_FT_REG_FILE 1 -#define EXT2_FT_DIR 2 -#define EXT2_FT_CHRDEV 3 -#define EXT2_FT_BLKDEV 4 -#define EXT2_FT_FIFO 5 -#define EXT2_FT_SOCK 6 -#define EXT2_FT_SYMLINK 7 - -#define EXT2_FT_MAX 8 +enum { + EXT2_FT_UNKNOWN, + EXT2_FT_REG_FILE, + EXT2_FT_DIR, + EXT2_FT_CHRDEV, + EXT2_FT_BLKDEV, + EXT2_FT_FIFO, + EXT2_FT_SOCK, + EXT2_FT_SYMLINK, + EXT2_FT_MAX +}; /* * EXT2_DIR_PAD defines the directory entries boundaries @@ -552,9 +553,6 @@ extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, extern unsigned long ext2_count_free (struct buffer_head *, unsigned); /* dir.c */ -extern int ext2_check_dir_entry (const char *, struct inode *, - struct ext2_dir_entry_2 *, struct buffer_head *, - unsigned long); /* file.c */ extern int ext2_read (struct inode *, struct file *, char *, int); @@ -613,6 +611,14 @@ extern void ext2_truncate (struct inode *); /* dir.c */ extern struct file_operations ext2_dir_operations; +extern int ext2_add_link (struct dentry *, struct inode *); +extern ino_t ext2_inode_by_name(struct inode *, struct dentry *); +extern int ext2_make_empty(struct inode *, struct inode *); +extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct dentry *, struct page **); +extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); +extern int ext2_empty_dir (struct inode *); +extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); +extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *); /* file.c */ extern struct inode_operations ext2_file_inode_operations; diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index cba5d1601572..708d5906c16b 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -74,20 +74,15 @@ struct softirq_action asmlinkage void do_softirq(void); extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); +/* Locally cached atomic variables are cheaper than cli/sti */ static inline void __cpu_raise_softirq(int cpu, int nr) { - softirq_active(cpu) |= (1<<nr); + set_bit(nr, &softirq_active(cpu)); } - -/* I do not want to use atomic variables now, so that cli/sti */ static inline void raise_softirq(int nr) { - unsigned long flags; - - local_irq_save(flags); __cpu_raise_softirq(smp_processor_id(), nr); - local_irq_restore(flags); } extern void softirq_init(void); @@ -133,7 +128,7 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ - TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ + TASKLET_STATE_RUN /* Tasklet is running */ }; struct tasklet_head @@ -144,44 +139,12 @@ struct tasklet_head extern struct tasklet_head tasklet_vec[NR_CPUS]; extern struct tasklet_head tasklet_hi_vec[NR_CPUS]; -#ifdef CONFIG_SMP #define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state)) -#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } #define tasklet_unlock(t) clear_bit(TASKLET_STATE_RUN, &(t)->state) -#else -#define tasklet_trylock(t) 1 -#define tasklet_unlock_wait(t) do { } while (0) -#define tasklet_unlock(t) do { } while (0) -#endif - -static inline void tasklet_schedule(struct tasklet_struct *t) -{ - if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { - int cpu = smp_processor_id(); - unsigned long flags; - - local_irq_save(flags); - t->next = tasklet_vec[cpu].list; - tasklet_vec[cpu].list = t; - __cpu_raise_softirq(cpu, TASKLET_SOFTIRQ); - local_irq_restore(flags); - } -} - -static inline void tasklet_hi_schedule(struct tasklet_struct *t) -{ - if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { - int cpu = smp_processor_id(); - unsigned long flags; - - local_irq_save(flags); - t->next = tasklet_hi_vec[cpu].list; - tasklet_hi_vec[cpu].list = t; - __cpu_raise_softirq(cpu, HI_SOFTIRQ); - local_irq_restore(flags); - } -} +#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } +extern void tasklet_schedule(struct tasklet_struct *t); +extern void tasklet_hi_schedule(struct tasklet_struct *t); static inline void tasklet_disable_nosync(struct tasklet_struct *t) { @@ -196,7 +159,14 @@ static inline void tasklet_disable(struct tasklet_struct *t) static inline void tasklet_enable(struct tasklet_struct *t) { - atomic_dec(&t->count); + if (atomic_dec_and_test(&t->count)) + tasklet_schedule(t); +} + +static inline void tasklet_hi_enable(struct tasklet_struct *t) +{ + if (atomic_dec_and_test(&t->count)) + tasklet_hi_schedule(t); } extern void tasklet_kill(struct tasklet_struct *t); diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index b3433a3d62db..8ddf2dac2f47 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -34,4 +34,7 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */ /* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386, ia64 */ +#define softirq_pending(cpu) \ + ((softirq_active(cpu) & softirq_mask(cpu))) + #endif /* __irq_cpustat_h */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 12edcb46cc8f..36e6f16546c8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -167,6 +167,7 @@ typedef struct page { #define PG_skip 10 #define PG_inactive_clean 11 #define PG_highmem 12 +#define PG_checked 13 /* kill me in 2.5.<early>. */ /* bits 21-29 unused */ #define PG_arch_1 30 #define PG_reserved 31 @@ -181,6 +182,8 @@ typedef struct page { #define PageLocked(page) test_bit(PG_locked, &(page)->flags) #define LockPage(page) set_bit(PG_locked, &(page)->flags) #define TryLockPage(page) test_and_set_bit(PG_locked, &(page)->flags) +#define PageChecked(page) test_bit(PG_checked, &(page)->flags) +#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags) extern void __set_page_dirty(struct page *); @@ -337,10 +340,10 @@ extern mem_map_t * mem_map; * can allocate highmem pages, the *get*page*() variants return * virtual kernel addresses to the allocated page(s). */ -extern struct page * FASTCALL(__alloc_pages(zonelist_t *zonelist, unsigned long order)); +extern struct page * FASTCALL(_alloc_pages(unsigned int gfp_mask, unsigned long order)); +extern struct page * FASTCALL(__alloc_pages(unsigned int gfp_mask, unsigned long order, zonelist_t *zonelist)); extern struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order); -#ifndef CONFIG_DISCONTIGMEM static inline struct page * alloc_pages(int gfp_mask, unsigned long order) { /* @@ -348,11 +351,8 @@ static inline struct page * alloc_pages(int gfp_mask, unsigned long order) */ if (order >= MAX_ORDER) return NULL; - return __alloc_pages(contig_page_data.node_zonelists+(gfp_mask), order); + return _alloc_pages(gfp_mask, order); } -#else /* !CONFIG_DISCONTIGMEM */ -extern struct page * alloc_pages(int gfp_mask, unsigned long order); -#endif /* !CONFIG_DISCONTIGMEM */ #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) @@ -471,18 +471,17 @@ extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int); /* * GFP bitmasks.. */ -#define __GFP_WAIT 0x01 -#define __GFP_HIGH 0x02 -#define __GFP_IO 0x04 -#define __GFP_DMA 0x08 -#ifdef CONFIG_HIGHMEM -#define __GFP_HIGHMEM 0x10 -#else -#define __GFP_HIGHMEM 0x0 /* noop */ -#endif +/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low four bits) */ +#define __GFP_DMA 0x01 +#define __GFP_HIGHMEM 0x02 +/* Action modifiers - doesn't change the zoning */ +#define __GFP_WAIT 0x10 +#define __GFP_HIGH 0x20 +#define __GFP_IO 0x40 +#define __GFP_BUFFER 0x80 -#define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT) +#define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT | __GFP_BUFFER) #define GFP_ATOMIC (__GFP_HIGH) #define GFP_USER ( __GFP_WAIT | __GFP_IO) #define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHMEM) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 0f65115f4500..97e91217ad23 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -78,10 +78,9 @@ typedef struct zone_struct { */ typedef struct zonelist_struct { zone_t * zones [MAX_NR_ZONES+1]; // NULL delimited - int gfp_mask; } zonelist_t; -#define NR_GFPINDEX 0x20 +#define GFP_ZONEMASK 0x0f /* * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM @@ -97,7 +96,7 @@ typedef struct zonelist_struct { struct bootmem_data; typedef struct pglist_data { zone_t node_zones[MAX_NR_ZONES]; - zonelist_t node_zonelists[NR_GFPINDEX]; + zonelist_t node_zonelists[GFP_ZONEMASK+1]; struct page *node_mem_map; unsigned long *valid_addr_bitmap; struct bootmem_data *bdata; diff --git a/include/linux/slab.h b/include/linux/slab.h index b01496cdf602..32895d79186b 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -22,7 +22,7 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_NFS GFP_NFS #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO) +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_BUFFER) #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). |
