diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-04 08:33:28 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-04 08:33:28 -0700 |
| commit | 78f1f626d9412e572e9e18a06c9989deaede8a9a (patch) | |
| tree | b49c6c55cb9094159c22f5377612e7d4dc8cdf3c /include | |
| parent | 6fe152cf897b388bb53a4e17e356464fcb00833b (diff) | |
| parent | f1dfe022bbea7aa89e5215a984337d6559b6bcd2 (diff) | |
Merge home.transmeta.com:/home/torvalds/v2.5/akpm
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/buffer_head.h | 49 | ||||
| -rw-r--r-- | include/linux/ext2_fs_sb.h | 14 | ||||
| -rw-r--r-- | include/linux/ext3_fs_sb.h | 14 | ||||
| -rw-r--r-- | include/linux/gfp.h | 10 | ||||
| -rw-r--r-- | include/linux/jbd.h | 20 | ||||
| -rw-r--r-- | include/linux/list.h | 36 | ||||
| -rw-r--r-- | include/linux/mm.h | 10 | ||||
| -rw-r--r-- | include/linux/sched.h | 10 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 6 | ||||
| -rw-r--r-- | include/linux/writeback.h | 23 |
10 files changed, 105 insertions, 87 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 4fc6bab55825..a94644322d86 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -164,7 +164,7 @@ struct buffer_head *__find_get_block(struct block_device *, sector_t, int); struct buffer_head * __getblk(struct block_device *, sector_t, int); void __brelse(struct buffer_head *); void __bforget(struct buffer_head *); -struct buffer_head * __bread(struct block_device *, int, int); +struct buffer_head *__bread(struct block_device *, sector_t block, int size); void wakeup_bdflush(void); struct buffer_head *alloc_buffer_head(void); void free_buffer_head(struct buffer_head * bh); @@ -201,9 +201,9 @@ int generic_osync_inode(struct inode *, int); * inline definitions */ -static inline void get_bh(struct buffer_head * bh) +static inline void get_bh(struct buffer_head *bh) { - atomic_inc(&(bh)->b_count); + atomic_inc(&bh->b_count); } static inline void put_bh(struct buffer_head *bh) @@ -212,68 +212,49 @@ static inline void put_bh(struct buffer_head *bh) atomic_dec(&bh->b_count); } -/* - * If an error happens during the make_request, this function - * has to be recalled. It marks the buffer as clean and not - * uptodate, and it notifys the upper layer about the end - * of the I/O. - */ -static inline void buffer_IO_error(struct buffer_head * bh) -{ - clear_buffer_dirty(bh); - - /* - * b_end_io has to clear the BH_Uptodate bitflag in the read error - * case, however buffer contents are not necessarily bad if a - * write fails - */ - bh->b_end_io(bh, buffer_uptodate(bh)); -} - - -static inline void brelse(struct buffer_head *buf) +static inline void brelse(struct buffer_head *bh) { - if (buf) - __brelse(buf); + if (bh) + __brelse(bh); } -static inline void bforget(struct buffer_head *buf) +static inline void bforget(struct buffer_head *bh) { - if (buf) - __bforget(buf); + if (bh) + __bforget(bh); } -static inline struct buffer_head * sb_bread(struct super_block *sb, int block) +static inline struct buffer_head *sb_bread(struct super_block *sb, sector_t block) { return __bread(sb->s_bdev, block, sb->s_blocksize); } -static inline struct buffer_head * sb_getblk(struct super_block *sb, int block) +static inline struct buffer_head *sb_getblk(struct super_block *sb, sector_t block) { return __getblk(sb->s_bdev, block, sb->s_blocksize); } static inline struct buffer_head * -sb_find_get_block(struct super_block *sb, int block) +sb_find_get_block(struct super_block *sb, sector_t block) { return __find_get_block(sb->s_bdev, block, sb->s_blocksize); } static inline void -map_bh(struct buffer_head *bh, struct super_block *sb, int block) +map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) { set_buffer_mapped(bh); bh->b_bdev = sb->s_bdev; bh->b_blocknr = block; } -static inline void wait_on_buffer(struct buffer_head * bh) +static inline void wait_on_buffer(struct buffer_head *bh) { if (buffer_locked(bh)) __wait_on_buffer(bh); } -static inline void lock_buffer(struct buffer_head * bh) +static inline void lock_buffer(struct buffer_head *bh) { while (test_set_buffer_locked(bh)) __wait_on_buffer(bh); diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 47f53158e755..070f5b630581 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h @@ -17,14 +17,6 @@ #define _LINUX_EXT2_FS_SB /* - * The following is not needed anymore since the descriptors buffer - * heads are now dynamically allocated - */ -/* #define EXT2_MAX_GROUP_DESC 8 */ - -#define EXT2_MAX_GROUP_LOADED 8 - -/* * second extended-fs super-block data in memory */ struct ext2_sb_info { @@ -41,12 +33,6 @@ struct ext2_sb_info { struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; - unsigned short s_loaded_inode_bitmaps; - unsigned short s_loaded_block_bitmaps; - unsigned long s_inode_bitmap_number[EXT2_MAX_GROUP_LOADED]; - struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; - unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED]; - struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED]; unsigned long s_mount_opt; uid_t s_resuid; gid_t s_resgid; diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index 6bda514a7a54..573aa3588735 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h @@ -22,14 +22,6 @@ #endif /* - * The following is not needed anymore since the descriptors buffer - * heads are now dynamically allocated - */ -/* #define EXT3_MAX_GROUP_DESC 8 */ - -#define EXT3_MAX_GROUP_LOADED 8 - -/* * third extended-fs super-block data in memory */ struct ext3_sb_info { @@ -46,12 +38,6 @@ struct ext3_sb_info { struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; - unsigned short s_loaded_inode_bitmaps; - unsigned short s_loaded_block_bitmaps; - unsigned long s_inode_bitmap_number[EXT3_MAX_GROUP_LOADED]; - struct buffer_head * s_inode_bitmap[EXT3_MAX_GROUP_LOADED]; - unsigned long s_block_bitmap_number[EXT3_MAX_GROUP_LOADED]; - struct buffer_head * s_block_bitmap[EXT3_MAX_GROUP_LOADED]; unsigned long s_mount_opt; uid_t s_resuid; gid_t s_resgid; diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 63fac87d50ef..317d45415250 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -18,14 +18,14 @@ #define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */ #define __GFP_FS 0x100 /* Can call down to low-level FS? */ -#define GFP_NOHIGHIO (__GFP_HIGH | __GFP_WAIT | __GFP_IO) -#define GFP_NOIO (__GFP_HIGH | __GFP_WAIT) -#define GFP_NOFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO) +#define GFP_NOHIGHIO ( __GFP_WAIT | __GFP_IO) +#define GFP_NOIO ( __GFP_WAIT) +#define GFP_NOFS ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO) #define GFP_ATOMIC (__GFP_HIGH) #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_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS) -#define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS) +#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/jbd.h b/include/linux/jbd.h index 683c1247fd70..fafb868eec11 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -250,6 +250,13 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) return bh->b_private; } +#define HAVE_JOURNAL_CALLBACK_STATUS +struct journal_callback { + struct list_head jcb_list; + void (*jcb_func)(struct journal_callback *jcb, int error); + /* user data goes here */ +}; + struct jbd_revoke_table_s; /* The handle_t type represents a single atomic update being performed @@ -280,6 +287,12 @@ struct handle_s operations */ int h_err; + /* List of application registered callbacks for this handle. + * The function(s) will be called after the transaction that + * this handle is part of has been committed to disk. + */ + struct list_head h_jcb; + /* Flags */ unsigned int h_sync: 1; /* sync-on-close */ unsigned int h_jdata: 1; /* force data journaling */ @@ -399,6 +412,10 @@ struct transaction_s /* How many handles used this transaction? */ int t_handle_count; + + /* List of registered callback functions for this transaction. + * Called when the transaction is committed. */ + struct list_head t_jcb; }; @@ -647,6 +664,9 @@ extern int journal_invalidatepage(journal_t *, extern int journal_try_to_free_buffers(journal_t *, struct page *, int); extern int journal_stop(handle_t *); extern int journal_flush (journal_t *); +extern void journal_callback_set(handle_t *handle, + void (*fn)(struct journal_callback *,int), + struct journal_callback *jcb); extern void journal_lock_updates (journal_t *); extern void journal_unlock_updates (journal_t *); diff --git a/include/linux/list.h b/include/linux/list.h index ac65cc310ab6..3e70aa03ac11 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -136,6 +136,19 @@ static inline int list_empty(list_t *head) return head->next == head; } +static inline void __list_splice(list_t *list, list_t *head) +{ + list_t *first = list->next; + list_t *last = list->prev; + list_t *at = head->next; + + first->prev = head; + head->next = first; + + last->next = at; + at->prev = last; +} + /** * list_splice - join two lists * @list: the new list to add. @@ -145,15 +158,22 @@ static inline void list_splice(list_t *list, list_t *head) { list_t *first = list->next; - if (first != list) { - list_t *last = list->prev; - list_t *at = head->next; - - first->prev = head; - head->next = first; + if (first != list) + __list_splice(list, head); +} - last->next = at; - at->prev = last; +/** + * list_splice_init - join two lists and reinitialise the emptied list. + * @list: the new list to add. + * @head: the place to add it in the first list. + * + * The list at @list is reinitialised + */ +static inline void list_splice_init(list_t *list, list_t *head) +{ + if (!list_empty(list)) { + __list_splice(list, head); + INIT_LIST_HEAD(list); } } diff --git a/include/linux/mm.h b/include/linux/mm.h index c93dfffc4760..163e19fd7b33 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -305,6 +305,16 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num) #define NOPAGE_SIGBUS (NULL) #define NOPAGE_OOM ((struct page *) (-1)) +/* + * Different kinds of faults, as returned by handle_mm_fault(). + * Used to decide whether a process gets delivered SIGBUS or + * just gets major/minor fault counters bumped up. + */ +#define VM_FAULT_OOM (-1) +#define VM_FAULT_SIGBUS 0 +#define VM_FAULT_MINOR 1 +#define VM_FAULT_MAJOR 2 + /* The array of struct pages */ extern struct page *mem_map; diff --git a/include/linux/sched.h b/include/linux/sched.h index 6a83711022f8..41382c9f8653 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -385,12 +385,12 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */ #define PF_FREE_PAGES 0x00002000 /* per process page freeing */ #define PF_FLUSHER 0x00004000 /* responsible for disk writeback */ -#define PF_RADIX_TREE 0x00008000 /* debug: performing radix tree alloc */ +#define PF_NOWARN 0x00008000 /* debug: don't warn if alloc fails */ #define PF_FREEZE 0x00010000 /* this task should be frozen for suspend */ #define PF_IOTHREAD 0x00020000 /* this thread is needed for doing I/O to swap */ #define PF_FROZEN 0x00040000 /* frozen for system suspend */ - +#define PF_INVALIDATE 0x00080000 /* debug: unmounting an fs. killme. */ /* * Ptrace flags */ @@ -417,8 +417,7 @@ extern int task_prio(task_t *p); extern int task_nice(task_t *p); extern int idle_cpu(int cpu); -asmlinkage long sys_sched_yield(void); -#define yield() sys_sched_yield() +void yield(void); /* * The default (Linux) execution domain. @@ -836,10 +835,11 @@ static inline int need_resched(void) return unlikely(test_thread_flag(TIF_NEED_RESCHED)); } +extern void __cond_resched(void); static inline void cond_resched(void) { if (need_resched()) - schedule(); + __cond_resched(); } /* Reevaluate whether the task has signals pending delivery. diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 488bc05dbcc1..da8115ec58f6 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -30,7 +30,10 @@ struct file; -#define CTL_MAXNAME 10 +#define CTL_MAXNAME 10 /* how many path components do we allow in a + call to sysctl? In other words, what is + the largest acceptable value for the nlen + member of a struct __sysctl_args to have? */ struct __sysctl_args { int *name; @@ -145,6 +148,7 @@ enum VM_DIRTY_SYNC=13, /* dirty_sync_ratio */ VM_DIRTY_WB_CS=14, /* dirty_writeback_centisecs */ VM_DIRTY_EXPIRE_CS=15, /* dirty_expire_centisecs */ + VM_NR_PDFLUSH_THREADS=16, /* nr_pdflush_threads */ }; diff --git a/include/linux/writeback.h b/include/linux/writeback.h index a06b0f116ebd..af3ec94cb2ad 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -24,18 +24,22 @@ static inline int current_is_pdflush(void) /* * fs/fs-writeback.c */ -#define WB_SYNC_NONE 0 /* Don't wait on anything */ -#define WB_SYNC_LAST 1 /* Wait on the last-written mapping */ -#define WB_SYNC_ALL 2 /* Wait on every mapping */ -#define WB_SYNC_HOLD 3 /* Hold the inode on sb_dirty for sys_sync() */ +enum writeback_sync_modes { + WB_SYNC_NONE = 0, /* Don't wait on anything */ + WB_SYNC_LAST = 1, /* Wait on the last-written mapping */ + WB_SYNC_ALL = 2, /* Wait on every mapping */ + WB_SYNC_HOLD = 3, /* Hold the inode on sb_dirty for sys_sync() */ +}; -void writeback_unlocked_inodes(int *nr_to_write, int sync_mode, - unsigned long *older_than_this); +void writeback_unlocked_inodes(int *nr_to_write, + enum writeback_sync_modes sync_mode, + unsigned long *older_than_this); void wake_up_inode(struct inode *inode); void __wait_on_inode(struct inode * inode); void sync_inodes_sb(struct super_block *, int wait); void sync_inodes(int wait); +/* writeback.h requires fs.h; it, too, is not included from here. */ static inline void wait_on_inode(struct inode *inode) { if (inode->i_state & I_LOCK) @@ -45,15 +49,22 @@ static inline void wait_on_inode(struct inode *inode) /* * mm/page-writeback.c */ +/* These 5 are exported to sysctl. */ extern int dirty_background_ratio; extern int dirty_async_ratio; extern int dirty_sync_ratio; extern int dirty_writeback_centisecs; extern int dirty_expire_centisecs; + void balance_dirty_pages(struct address_space *mapping); void balance_dirty_pages_ratelimited(struct address_space *mapping); int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); int do_writepages(struct address_space *mapping, int *nr_to_write); +/* pdflush.c */ +extern int nr_pdflush_threads; /* Global so it can be exported to sysctl + read-only. */ + + #endif /* WRITEBACK_H */ |
