]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] misc cleanups and fixes
authorAndrew Morton <akpm@zip.com.au>
Thu, 4 Jul 2002 15:30:30 +0000 (08:30 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 4 Jul 2002 15:30:30 +0000 (08:30 -0700)
- 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)

Documentation/filesystems/porting
drivers/pci/pool.c
fs/block_dev.c
fs/fs-writeback.c
include/linux/writeback.h
mm/page_io.c
mm/swap_state.c

index 85281b6f4ff0266f307af94c70c0b65492c40806..b88f356a5919007299427d045b16a26f7886ffce 100644 (file)
@@ -3,11 +3,13 @@ Changes since 2.5.0:
 --- 
 [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().
 
 Use them.
 
+(sb_find_get_block() replaces 2.4's get_hash_table())
+
 --- 
 [recommended]
 
index dec050f4b0d5cf94b0e61acb6502b9d0c91aeeda..9465b0fc81f1440dcdaeebb75f22ca3e6f71d477 100644 (file)
@@ -303,15 +303,15 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma)
 
 #ifdef CONFIG_DEBUG_SLAB
        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->name, vaddr, (unsigned long) dma);
+                       pool->name, vaddr, (unsigned long long) dma);
                return;
        }
        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->name, dma);
+                       pool->name, (unsigned long long)dma);
                return;
        }
        memset (vaddr, POOL_POISON_BYTE, pool->size);
index 34f88ef66b0f232378622eec88962e53957885c3..be2c8ef578de6f2136519acad600d6ba6d7e4e4f 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <asm/uaccess.h>
 
-#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
-
 static unsigned long max_block(struct block_device *bdev)
 {
        unsigned int retval = ~0U;
index 1d695b939f2fc327c43f448f72ac5eab32650651..db84b9f8eec4ae5d3e1bb1e728a9a71db7de7c7a 100644 (file)
@@ -287,8 +287,9 @@ out:
  *
  * This is a "memory cleansing" operation, not a "data integrity" operation.
  */
-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)
 {
        struct super_block *sb;
 
index a06b0f116ebdf6714799090a1f6c0beb6619be38..1b2034aa56178b7669a2a9207410048cab3bde18 100644 (file)
@@ -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() */
-
-void writeback_unlocked_inodes(int *nr_to_write, int sync_mode,
-                               unsigned long *older_than_this);
+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,
+                              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)
index b89925ee30ea3cd0e0ed969eaa10de7f9060cc10..4a1ce82a58860ddd35ad7f95deb54d3069d7e348 100644 (file)
@@ -130,7 +130,7 @@ out:
  * 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().
  *
- * 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.
  */
 static int swap_vm_writeback(struct page *page, int *nr_to_write)
index 4513649a1208c0fedb5b088b57f43f1548c39749..c831b5193865a2b298e9792384c069fe0a6f09b7 100644 (file)
 /*
  * swapper_inode doesn't do anything much.  It is really only here to
  * 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 = {
        i_mapping:      &swapper_space,
-       i_size:         PAGE_SIZE * 0xffffffffLL,
-       i_blkbits:      PAGE_SHIFT,
 };
 
 extern struct address_space_operations swap_aops;