aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-02-10 04:45:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:31 -0500
commitfc0ecff698165ae8e178efa086e0dd1f385206b1 (patch)
treefc6274f0862bdd6749172201170b2f6a7ce4c4ff
parent54bc485522afdac33de5504da2ea8cdcc690674e (diff)
[PATCH] remove invalidate_inode_pages()
Convert all calls to invalidate_inode_pages() into open-coded calls to invalidate_mapping_pages(). Leave the invalidate_inode_pages() wrapper in place for now, marked as deprecated. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/md/bitmap.c2
-rw-r--r--drivers/mtd/devices/block2mtd.c3
-rw-r--r--drivers/usb/gadget/file_storage.c2
-rw-r--r--fs/9p/vfs_file.c4
-rw-r--r--fs/buffer.c2
-rw-r--r--fs/drop_caches.c2
-rw-r--r--fs/fuse/file.c2
-rw-r--r--fs/fuse/inode.c2
-rw-r--r--fs/inode.c3
-rw-r--r--fs/jffs/inode-v23.c4
-rw-r--r--include/linux/fs.h4
-rw-r--r--mm/truncate.c4
12 files changed, 18 insertions, 16 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 059704fbb753..5554adaa58f9 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -666,7 +666,7 @@ static void bitmap_file_put(struct bitmap *bitmap)
666 666
667 if (file) { 667 if (file) {
668 struct inode *inode = file->f_path.dentry->d_inode; 668 struct inode *inode = file->f_path.dentry->d_inode;
669 invalidate_inode_pages(inode->i_mapping); 669 invalidate_mapping_pages(inode->i_mapping, 0, -1);
670 fput(file); 670 fput(file);
671 } 671 }
672} 672}
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 6d917a4daa9d..f9f2ce7806b0 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -278,7 +278,8 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)
278 kfree(dev->mtd.name); 278 kfree(dev->mtd.name);
279 279
280 if (dev->blkdev) { 280 if (dev->blkdev) {
281 invalidate_inode_pages(dev->blkdev->bd_inode->i_mapping); 281 invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
282 0, -1);
282 close_bdev_excl(dev->blkdev); 283 close_bdev_excl(dev->blkdev);
283 } 284 }
284 285
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index f04a29a46646..c6b6479fa4dd 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -1953,7 +1953,7 @@ static void invalidate_sub(struct lun *curlun)
1953 struct inode *inode = filp->f_path.dentry->d_inode; 1953 struct inode *inode = filp->f_path.dentry->d_inode;
1954 unsigned long rc; 1954 unsigned long rc;
1955 1955
1956 rc = invalidate_inode_pages(inode->i_mapping); 1956 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
1957 VLDBG(curlun, "invalidate_inode_pages -> %ld\n", rc); 1957 VLDBG(curlun, "invalidate_inode_pages -> %ld\n", rc);
1958} 1958}
1959 1959
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 9f17b0cacdd0..6c78343cf690 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -110,7 +110,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)
110 110
111 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { 111 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
112 filemap_write_and_wait(inode->i_mapping); 112 filemap_write_and_wait(inode->i_mapping);
113 invalidate_inode_pages(&inode->i_data); 113 invalidate_mapping_pages(&inode->i_data, 0, -1);
114 } 114 }
115 115
116 return res; 116 return res;
@@ -234,7 +234,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
234 total += result; 234 total += result;
235 } while (count); 235 } while (count);
236 236
237 invalidate_inode_pages2(inode->i_mapping); 237 invalidate_inode_pages2(inode->i_mapping);
238 return total; 238 return total;
239} 239}
240 240
diff --git a/fs/buffer.c b/fs/buffer.c
index 1ad674fd348c..763c5b59492d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -345,7 +345,7 @@ void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
345 * We really want to use invalidate_inode_pages2() for 345 * We really want to use invalidate_inode_pages2() for
346 * that, but not until that's cleaned up. 346 * that, but not until that's cleaned up.
347 */ 347 */
348 invalidate_inode_pages(mapping); 348 invalidate_mapping_pages(mapping, 0, -1);
349} 349}
350 350
351/* 351/*
diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index 4e4762389bdc..03ea7696fe39 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -20,7 +20,7 @@ static void drop_pagecache_sb(struct super_block *sb)
20 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 20 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
21 if (inode->i_state & (I_FREEING|I_WILL_FREE)) 21 if (inode->i_state & (I_FREEING|I_WILL_FREE))
22 continue; 22 continue;
23 invalidate_inode_pages(inode->i_mapping); 23 invalidate_mapping_pages(inode->i_mapping, 0, -1);
24 } 24 }
25 spin_unlock(&inode_lock); 25 spin_unlock(&inode_lock);
26} 26}
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f63efe1337ec..2fd06927e851 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -69,7 +69,7 @@ void fuse_finish_open(struct inode *inode, struct file *file,
69 if (outarg->open_flags & FOPEN_DIRECT_IO) 69 if (outarg->open_flags & FOPEN_DIRECT_IO)
70 file->f_op = &fuse_direct_io_file_operations; 70 file->f_op = &fuse_direct_io_file_operations;
71 if (!(outarg->open_flags & FOPEN_KEEP_CACHE)) 71 if (!(outarg->open_flags & FOPEN_KEEP_CACHE))
72 invalidate_inode_pages(inode->i_mapping); 72 invalidate_mapping_pages(inode->i_mapping, 0, -1);
73 ff->fh = outarg->fh; 73 ff->fh = outarg->fh;
74 file->private_data = ff; 74 file->private_data = ff;
75} 75}
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 12450d2b320e..220255110d76 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -112,7 +112,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
112{ 112{
113 struct fuse_conn *fc = get_fuse_conn(inode); 113 struct fuse_conn *fc = get_fuse_conn(inode);
114 if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size) 114 if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size)
115 invalidate_inode_pages(inode->i_mapping); 115 invalidate_mapping_pages(inode->i_mapping, 0, -1);
116 116
117 inode->i_ino = attr->ino; 117 inode->i_ino = attr->ino;
118 inode->i_mode = (inode->i_mode & S_IFMT) + (attr->mode & 07777); 118 inode->i_mode = (inode->i_mode & S_IFMT) + (attr->mode & 07777);
diff --git a/fs/inode.c b/fs/inode.c
index 062c5f9b6a69..e6d93070f140 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -414,7 +414,8 @@ static void prune_icache(int nr_to_scan)
414 __iget(inode); 414 __iget(inode);
415 spin_unlock(&inode_lock); 415 spin_unlock(&inode_lock);
416 if (remove_inode_buffers(inode)) 416 if (remove_inode_buffers(inode))
417 reap += invalidate_inode_pages(&inode->i_data); 417 reap += invalidate_mapping_pages(&inode->i_data,
418 0, -1);
418 iput(inode); 419 iput(inode);
419 spin_lock(&inode_lock); 420 spin_lock(&inode_lock);
420 421
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index 43baa1afa021..6ee206688502 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -296,7 +296,7 @@ jffs_setattr(struct dentry *dentry, struct iattr *iattr)
296 inode->i_blocks = (inode->i_size + 511) >> 9; 296 inode->i_blocks = (inode->i_size + 511) >> 9;
297 297
298 if (len) { 298 if (len) {
299 invalidate_inode_pages(inode->i_mapping); 299 invalidate_mapping_pages(inode->i_mapping, 0, -1);
300 } 300 }
301 inode->i_ctime = CURRENT_TIME_SEC; 301 inode->i_ctime = CURRENT_TIME_SEC;
302 inode->i_mtime = inode->i_ctime; 302 inode->i_mtime = inode->i_ctime;
@@ -1518,7 +1518,7 @@ jffs_file_write(struct file *filp, const char *buf, size_t count,
1518 } 1518 }
1519 inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 1519 inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
1520 mark_inode_dirty(inode); 1520 mark_inode_dirty(inode);
1521 invalidate_inode_pages(inode->i_mapping); 1521 invalidate_mapping_pages(inode->i_mapping, 0, -1);
1522 1522
1523 out_isem: 1523 out_isem:
1524 return err; 1524 return err;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a1180d05ed96..20fd1619ccfb 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1574,7 +1574,7 @@ extern int invalidate_inodes(struct super_block *);
1574unsigned long invalidate_mapping_pages(struct address_space *mapping, 1574unsigned long invalidate_mapping_pages(struct address_space *mapping,
1575 pgoff_t start, pgoff_t end); 1575 pgoff_t start, pgoff_t end);
1576 1576
1577static inline unsigned long 1577static inline unsigned long __deprecated
1578invalidate_inode_pages(struct address_space *mapping) 1578invalidate_inode_pages(struct address_space *mapping)
1579{ 1579{
1580 return invalidate_mapping_pages(mapping, 0, ~0UL); 1580 return invalidate_mapping_pages(mapping, 0, ~0UL);
@@ -1584,7 +1584,7 @@ static inline void invalidate_remote_inode(struct inode *inode)
1584{ 1584{
1585 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 1585 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1586 S_ISLNK(inode->i_mode)) 1586 S_ISLNK(inode->i_mode))
1587 invalidate_inode_pages(inode->i_mapping); 1587 invalidate_mapping_pages(inode->i_mapping, 0, -1);
1588} 1588}
1589extern int invalidate_inode_pages2(struct address_space *mapping); 1589extern int invalidate_inode_pages2(struct address_space *mapping);
1590extern int invalidate_inode_pages2_range(struct address_space *mapping, 1590extern int invalidate_inode_pages2_range(struct address_space *mapping,
diff --git a/mm/truncate.c b/mm/truncate.c
index 85105db34609..ebf3fcb4115b 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(cancel_dirty_page);
85 * 85 *
86 * We need to bale out if page->mapping is no longer equal to the original 86 * We need to bale out if page->mapping is no longer equal to the original
87 * mapping. This happens a) when the VM reclaimed the page while we waited on 87 * mapping. This happens a) when the VM reclaimed the page while we waited on
88 * its lock, b) when a concurrent invalidate_inode_pages got there first and 88 * its lock, b) when a concurrent invalidate_mapping_pages got there first and
89 * c) when tmpfs swizzles a page between a tmpfs inode and swapper_space. 89 * c) when tmpfs swizzles a page between a tmpfs inode and swapper_space.
90 */ 90 */
91static void 91static void
@@ -106,7 +106,7 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
106} 106}
107 107
108/* 108/*
109 * This is for invalidate_inode_pages(). That function can be called at 109 * This is for invalidate_mapping_pages(). That function can be called at
110 * any time, and is not supposed to throw away dirty pages. But pages can 110 * any time, and is not supposed to throw away dirty pages. But pages can
111 * be marked dirty at any time too, so use remove_mapping which safely 111 * be marked dirty at any time too, so use remove_mapping which safely
112 * discards clean, unused pages. 112 * discards clean, unused pages.