diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/buffer_head.h | 1 | ||||
| -rw-r--r-- | include/linux/dcache.h | 11 | ||||
| -rw-r--r-- | include/linux/iobuf.h | 88 | ||||
| -rw-r--r-- | include/linux/mm.h | 23 | ||||
| -rw-r--r-- | include/linux/swap.h | 2 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 3 | ||||
| -rw-r--r-- | include/linux/usb.h | 37 | ||||
| -rw-r--r-- | include/linux/videodev.h | 1 | ||||
| -rw-r--r-- | include/linux/writeback.h | 2 |
9 files changed, 63 insertions, 105 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 71732e1216fc..0760d97cd6f9 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -32,7 +32,6 @@ enum bh_state_bits { #define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512) struct page; -struct kiobuf; struct buffer_head; struct address_space; typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 0abaaaa2c96d..71708edafce9 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -180,17 +180,6 @@ extern void shrink_dcache_parent(struct dentry *); extern void shrink_dcache_anon(struct list_head *); extern int d_invalidate(struct dentry *); -/* dcache memory management */ -extern int shrink_dcache_memory(int, unsigned int); -extern void prune_dcache(int); - -/* icache memory management (defined in linux/fs/inode.c) */ -extern int shrink_icache_memory(int, unsigned int); -extern void prune_icache(int); - -/* quota cache memory management (defined in linux/fs/dquot.c) */ -extern int shrink_dqcache_memory(int, unsigned int); - /* only used at mount-time */ extern struct dentry * d_alloc_root(struct inode *); diff --git a/include/linux/iobuf.h b/include/linux/iobuf.h deleted file mode 100644 index fb147b5c48a7..000000000000 --- a/include/linux/iobuf.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * iobuf.h - * - * Defines the structures used to track abstract kernel-space io buffers. - * - */ - -#ifndef __LINUX_IOBUF_H -#define __LINUX_IOBUF_H - -#include <linux/mm.h> -#include <linux/init.h> -#include <linux/wait.h> -#include <asm/atomic.h> - -/* - * The kiobuf structure describes a physical set of pages reserved - * locked for IO. The reference counts on each page will have been - * incremented, and the flags field will indicate whether or not we have - * pre-locked all of the pages for IO. - * - * kiobufs may be passed in arrays to form a kiovec, but we must - * preserve the property that no page is present more than once over the - * entire iovec. - */ - -#define KIO_MAX_ATOMIC_IO 512 /* in kb */ -#define KIO_STATIC_PAGES (KIO_MAX_ATOMIC_IO / (PAGE_SIZE >> 10) + 1) -#define KIO_MAX_SECTORS (KIO_MAX_ATOMIC_IO * 2) - -/* The main kiobuf struct */ - -struct kiobuf -{ - int nr_pages; /* Pages actually referenced */ - int array_len; /* Space in the allocated lists */ - int offset; /* Offset to start of valid data */ - int length; /* Number of valid bytes of data */ - - /* Keep separate track of the physical addresses and page - * structs involved. If we do IO to a memory-mapped device - * region, there won't necessarily be page structs defined for - * every address. */ - - struct page ** maplist; - - unsigned int locked : 1; /* If set, pages has been locked */ - - /* Always embed enough struct pages for atomic IO */ - struct page * map_array[KIO_STATIC_PAGES]; - sector_t blocks[KIO_MAX_SECTORS]; - - /* Dynamic state for IO completion: */ - atomic_t io_count; /* IOs still in progress */ - int errno; /* Status of completed IO */ - void (*end_io) (struct kiobuf *); /* Completion callback */ - wait_queue_head_t wait_queue; -}; - - -/* mm/memory.c */ - -int map_user_kiobuf(int rw, struct kiobuf *, unsigned long va, size_t len); -void unmap_kiobuf(struct kiobuf *iobuf); -int lock_kiovec(int nr, struct kiobuf *iovec[], int wait); -int unlock_kiovec(int nr, struct kiobuf *iovec[]); -void mark_dirty_kiobuf(struct kiobuf *iobuf, int bytes); - -/* fs/iobuf.c */ - -int end_kio_request(struct kiobuf *, int); -void simple_wakeup_kiobuf(struct kiobuf *); -int alloc_kiovec(int nr, struct kiobuf **); -void free_kiovec(int nr, struct kiobuf **); -int expand_kiobuf(struct kiobuf *, int); -void kiobuf_wait_for_io(struct kiobuf *); -extern int alloc_kiobuf_bhs(struct kiobuf *); -extern void free_kiobuf_bhs(struct kiobuf *); - -/* fs/buffer.c */ - -int brw_kiovec(int rw, int nr, struct kiobuf *iovec[], - struct block_device *bdev, sector_t [], int size); - -/* fs/bio.c */ -void ll_rw_kio(int rw, struct kiobuf *kio, struct block_device *bdev, sector_t block); - -#endif /* __LINUX_IOBUF_H */ diff --git a/include/linux/mm.h b/include/linux/mm.h index a5107b5043f7..a6c66cc418ee 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -392,6 +392,29 @@ extern int free_hugepages(struct vm_area_struct *); /* + * Prototype to add a shrinker callback for ageable caches. + * + * These functions are passed a count `nr_to_scan' and a gfpmask. They should + * scan `nr_to_scan' objects, attempting to free them. + * + * The callback must the number of objects which remain in the cache. + * + * The callback will be passes nr_to_scan == 0 when the VM is querying the + * cache size, so a fastpath for that case is appropriate. + */ +typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); + +/* + * Add an aging callback. The int is the number of 'seeks' it takes + * to recreate one of the objects that these functions age. + */ + +#define DEFAULT_SEEKS 2 +struct shrinker; +extern struct shrinker *set_shrinker(int, shrinker_t); +extern void remove_shrinker(struct shrinker *shrinker); + +/* * If the mapping doesn't provide a set_page_dirty a_op, then * just fall through and assume that it wants buffer_heads. * FIXME: make the method unconditional. diff --git a/include/linux/swap.h b/include/linux/swap.h index 4ec8559245c6..4457c1dec40b 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -163,6 +163,8 @@ extern void swap_setup(void); /* linux/mm/vmscan.c */ extern int try_to_free_pages(struct zone *, unsigned int, unsigned int); +int shrink_all_memory(int nr_pages); +extern int vm_swappiness; /* linux/mm/page_io.c */ int swap_readpage(struct file *file, struct page *page); diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 8139ec747979..58055e1998cd 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -146,13 +146,14 @@ enum VM_UNUSED9=9, /* was: struct: Set page table cache parameters */ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */ VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */ - VM_DIRTY_ASYNC=12, /* dirty_async_ratio */ + VM_DIRTY_RATIO=12, /* dirty_ratio */ VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */ VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */ VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */ VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */ VM_PAGEBUF=17, /* struct: Control pagebuf parameters */ VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */ + VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ }; diff --git a/include/linux/usb.h b/include/linux/usb.h index 5dbc3cb115f7..fe144bda56f0 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -222,12 +222,42 @@ struct usb_interface_descriptor { int extralen; }; +/** + * struct usb_interface - what usb device drivers talk to + * @altsetting: array of interface descriptors, one for each alternate + * setting that may be selected. each one includes a set of + * endpoint configurations. + * @num_altsetting: number of altsettings defined. + * @act_altsetting: index of current altsetting. this number is always + * less than num_altsetting. after the device is configured, each + * interface uses its default setting of zero. + * @dev: driver model's view of this device + * + * USB device drivers attach to interfaces on a physical device. Each + * interface encapsulates a single high level function, such as feeding + * an audio stream to a speaker or reporting a change in a volume control. + * Many USB devices only have one interface. The protocol used to talk to + * an interface's endpoints can be defined in a usb "class" specification, + * or by a product's vendor. The (default) control endpoint is part of + * every interface, but is never listed among the interface's descriptors. + * + * The driver that is bound to the interface can use standard driver model + * calls such as dev_get_drvdata() on the dev member of this structure. + * + * Each interface may have alternate settings. The initial configuration + * of a device sets the first of these, but the device driver can change + * that setting using usb_set_interface(). Alternate settings are often + * used to control the the use of periodic endpoints, such as by having + * different endpoints use different amounts of reserved USB bandwidth. + * All standards-conformant USB devices that use isochronous endpoints + * will use them in non-default settings. + */ struct usb_interface { struct usb_interface_descriptor *altsetting; - int act_altsetting; /* active alternate setting */ - int num_altsetting; /* number of alternate settings */ - int max_altsetting; /* total memory allocated */ + unsigned act_altsetting; /* active alternate setting */ + unsigned num_altsetting; /* number of alternate settings */ + unsigned max_altsetting; /* total memory allocated */ struct usb_driver *driver; /* driver */ struct device dev; /* interface specific device info */ @@ -670,6 +700,7 @@ extern void usb_deregister_dev(int num_minors, int start_minor); extern int usb_device_probe(struct device *dev); extern int usb_device_remove(struct device *dev); +extern int usb_disabled(void); /* -------------------------------------------------------------------------- */ diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 80966ed8e288..a90d968374eb 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -397,6 +397,7 @@ struct video_code #define VID_HARDWARE_PWC 31 /* Philips webcams */ #define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */ #define VID_HARDWARE_CPIA2 33 +#define VID_HARDWARE_VICAM 34 #endif /* __LINUX_VIDEODEV_H */ diff --git a/include/linux/writeback.h b/include/linux/writeback.h index b71468f8f072..687091648a3a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -67,7 +67,7 @@ int wakeup_bdflush(long nr_pages); /* These 5 are exported to sysctl. */ extern int dirty_background_ratio; -extern int dirty_async_ratio; +extern int vm_dirty_ratio; extern int dirty_writeback_centisecs; extern int dirty_expire_centisecs; |
