Commit 06be3a5e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] misc cleanups and fixes

- Comment and documentation fixlets

- Remove some unneeded fields from swapper_inode (these are a
  leftover from when I had swap using the filesystem IO functions).

- fix a printk bug in pci/pool.c: when dma_addr_t is 64 bit it
  generates a compile warning, and will print out garbage.  Cast it to
  unsigned long long.

- Convert some writeback #defines into enums (Steven Augart)
parent 5226cca6
...@@ -3,11 +3,13 @@ Changes since 2.5.0: ...@@ -3,11 +3,13 @@ Changes since 2.5.0:
--- ---
[recommended] [recommended]
New helpers: sb_bread(), sb_getblk(), sb_get_hash_table(), set_bh(), New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(),
sb_set_blocksize() and sb_min_blocksize(). sb_set_blocksize() and sb_min_blocksize().
Use them. Use them.
(sb_find_get_block() replaces 2.4's get_hash_table())
--- ---
[recommended] [recommended]
......
...@@ -303,15 +303,15 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) ...@@ -303,15 +303,15 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma)
#ifdef CONFIG_DEBUG_SLAB #ifdef CONFIG_DEBUG_SLAB
if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%lx\n", printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%Lx\n",
pool->dev ? pool->dev->slot_name : NULL, pool->dev ? pool->dev->slot_name : NULL,
pool->name, vaddr, (unsigned long) dma); pool->name, vaddr, (unsigned long long) dma);
return; return;
} }
if (page->bitmap [map] & (1UL << block)) { if (page->bitmap [map] & (1UL << block)) {
printk (KERN_ERR "pci_pool_free %s/%s, dma %x already free\n", printk (KERN_ERR "pci_pool_free %s/%s, dma %Lx already free\n",
pool->dev ? pool->dev->slot_name : NULL, pool->dev ? pool->dev->slot_name : NULL,
pool->name, dma); pool->name, (unsigned long long)dma);
return; return;
} }
memset (vaddr, POOL_POISON_BYTE, pool->size); memset (vaddr, POOL_POISON_BYTE, pool->size);
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
static unsigned long max_block(struct block_device *bdev) static unsigned long max_block(struct block_device *bdev)
{ {
unsigned int retval = ~0U; unsigned int retval = ~0U;
......
...@@ -287,7 +287,8 @@ static void sync_sb_inodes(struct super_block *sb, int sync_mode, ...@@ -287,7 +287,8 @@ static void sync_sb_inodes(struct super_block *sb, int sync_mode,
* *
* This is a "memory cleansing" operation, not a "data integrity" operation. * This is a "memory cleansing" operation, not a "data integrity" operation.
*/ */
void writeback_unlocked_inodes(int *nr_to_write, int sync_mode, void writeback_unlocked_inodes(int *nr_to_write,
enum writeback_sync_modes sync_mode,
unsigned long *older_than_this) unsigned long *older_than_this)
{ {
struct super_block *sb; struct super_block *sb;
......
...@@ -24,18 +24,22 @@ static inline int current_is_pdflush(void) ...@@ -24,18 +24,22 @@ static inline int current_is_pdflush(void)
/* /*
* fs/fs-writeback.c * fs/fs-writeback.c
*/ */
#define WB_SYNC_NONE 0 /* Don't wait on anything */ enum writeback_sync_modes {
#define WB_SYNC_LAST 1 /* Wait on the last-written mapping */ WB_SYNC_NONE = 0, /* Don't wait on anything */
#define WB_SYNC_ALL 2 /* Wait on every mapping */ WB_SYNC_LAST = 1, /* Wait on the last-written mapping */
#define WB_SYNC_HOLD 3 /* Hold the inode on sb_dirty for sys_sync() */ 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, };
void writeback_unlocked_inodes(int *nr_to_write,
enum writeback_sync_modes sync_mode,
unsigned long *older_than_this); unsigned long *older_than_this);
void wake_up_inode(struct inode *inode); void wake_up_inode(struct inode *inode);
void __wait_on_inode(struct inode * inode); void __wait_on_inode(struct inode * inode);
void sync_inodes_sb(struct super_block *, int wait); void sync_inodes_sb(struct super_block *, int wait);
void sync_inodes(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) static inline void wait_on_inode(struct inode *inode)
{ {
if (inode->i_state & I_LOCK) if (inode->i_state & I_LOCK)
......
...@@ -130,7 +130,7 @@ int swap_readpage(struct file *file, struct page *page) ...@@ -130,7 +130,7 @@ int swap_readpage(struct file *file, struct page *page)
* swapper_space doesn't have a real inode, so it gets a special vm_writeback() * swapper_space doesn't have a real inode, so it gets a special vm_writeback()
* so we don't need swap special cases in generic_vm_writeback(). * so we don't need swap special cases in generic_vm_writeback().
* *
* Swap pages are PageLocked and PageWriteback while under writeout so that * Swap pages are !PageLocked and PageWriteback while under writeout so that
* memory allocators will throttle against them. * memory allocators will throttle against them.
*/ */
static int swap_vm_writeback(struct page *page, int *nr_to_write) static int swap_vm_writeback(struct page *page, int *nr_to_write)
......
...@@ -21,16 +21,9 @@ ...@@ -21,16 +21,9 @@
/* /*
* swapper_inode doesn't do anything much. It is really only here to * swapper_inode doesn't do anything much. It is really only here to
* avoid some special-casing in other parts of the kernel. * avoid some special-casing in other parts of the kernel.
*
* We set i_size to "infinity" to keep the page I/O functions happy. The swap
* block allocator makes sure that allocations are in-range. A strange
* number is chosen to prevent various arith overflows elsewhere. For example,
* `lblock' in block_read_full_page().
*/ */
static struct inode swapper_inode = { static struct inode swapper_inode = {
i_mapping: &swapper_space, i_mapping: &swapper_space,
i_size: PAGE_SIZE * 0xffffffffLL,
i_blkbits: PAGE_SHIFT,
}; };
extern struct address_space_operations swap_aops; extern struct address_space_operations swap_aops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment