[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>
This commit is contained in:
Andrew Morton 2007-02-10 01:45:39 -08:00 коммит произвёл Linus Torvalds
Родитель 54bc485522
Коммит fc0ecff698
12 изменённых файлов: 18 добавлений и 16 удалений

Просмотреть файл

@ -666,7 +666,7 @@ static void bitmap_file_put(struct bitmap *bitmap)
if (file) {
struct inode *inode = file->f_path.dentry->d_inode;
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
fput(file);
}
}

Просмотреть файл

@ -278,7 +278,8 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)
kfree(dev->mtd.name);
if (dev->blkdev) {
invalidate_inode_pages(dev->blkdev->bd_inode->i_mapping);
invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
0, -1);
close_bdev_excl(dev->blkdev);
}

Просмотреть файл

@ -1953,7 +1953,7 @@ static void invalidate_sub(struct lun *curlun)
struct inode *inode = filp->f_path.dentry->d_inode;
unsigned long rc;
rc = invalidate_inode_pages(inode->i_mapping);
rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
VLDBG(curlun, "invalidate_inode_pages -> %ld\n", rc);
}

Просмотреть файл

@ -110,7 +110,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)
if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
filemap_write_and_wait(inode->i_mapping);
invalidate_inode_pages(&inode->i_data);
invalidate_mapping_pages(&inode->i_data, 0, -1);
}
return res;
@ -234,7 +234,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
total += result;
} while (count);
invalidate_inode_pages2(inode->i_mapping);
invalidate_inode_pages2(inode->i_mapping);
return total;
}

Просмотреть файл

@ -345,7 +345,7 @@ void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
* We really want to use invalidate_inode_pages2() for
* that, but not until that's cleaned up.
*/
invalidate_inode_pages(mapping);
invalidate_mapping_pages(mapping, 0, -1);
}
/*

Просмотреть файл

@ -20,7 +20,7 @@ static void drop_pagecache_sb(struct super_block *sb)
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_WILL_FREE))
continue;
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
}
spin_unlock(&inode_lock);
}

Просмотреть файл

@ -69,7 +69,7 @@ void fuse_finish_open(struct inode *inode, struct file *file,
if (outarg->open_flags & FOPEN_DIRECT_IO)
file->f_op = &fuse_direct_io_file_operations;
if (!(outarg->open_flags & FOPEN_KEEP_CACHE))
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
ff->fh = outarg->fh;
file->private_data = ff;
}

Просмотреть файл

@ -112,7 +112,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
{
struct fuse_conn *fc = get_fuse_conn(inode);
if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size)
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
inode->i_ino = attr->ino;
inode->i_mode = (inode->i_mode & S_IFMT) + (attr->mode & 07777);

Просмотреть файл

@ -414,7 +414,8 @@ static void prune_icache(int nr_to_scan)
__iget(inode);
spin_unlock(&inode_lock);
if (remove_inode_buffers(inode))
reap += invalidate_inode_pages(&inode->i_data);
reap += invalidate_mapping_pages(&inode->i_data,
0, -1);
iput(inode);
spin_lock(&inode_lock);

Просмотреть файл

@ -296,7 +296,7 @@ jffs_setattr(struct dentry *dentry, struct iattr *iattr)
inode->i_blocks = (inode->i_size + 511) >> 9;
if (len) {
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
}
inode->i_ctime = CURRENT_TIME_SEC;
inode->i_mtime = inode->i_ctime;
@ -1518,7 +1518,7 @@ jffs_file_write(struct file *filp, const char *buf, size_t count,
}
inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
mark_inode_dirty(inode);
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
out_isem:
return err;

Просмотреть файл

@ -1574,7 +1574,7 @@ extern int invalidate_inodes(struct super_block *);
unsigned long invalidate_mapping_pages(struct address_space *mapping,
pgoff_t start, pgoff_t end);
static inline unsigned long
static inline unsigned long __deprecated
invalidate_inode_pages(struct address_space *mapping)
{
return invalidate_mapping_pages(mapping, 0, ~0UL);
@ -1584,7 +1584,7 @@ static inline void invalidate_remote_inode(struct inode *inode)
{
if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode))
invalidate_inode_pages(inode->i_mapping);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
}
extern int invalidate_inode_pages2(struct address_space *mapping);
extern int invalidate_inode_pages2_range(struct address_space *mapping,

Просмотреть файл

@ -85,7 +85,7 @@ EXPORT_SYMBOL(cancel_dirty_page);
*
* We need to bale out if page->mapping is no longer equal to the original
* mapping. This happens a) when the VM reclaimed the page while we waited on
* its lock, b) when a concurrent invalidate_inode_pages got there first and
* its lock, b) when a concurrent invalidate_mapping_pages got there first and
* c) when tmpfs swizzles a page between a tmpfs inode and swapper_space.
*/
static void
@ -106,7 +106,7 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
}
/*
* This is for invalidate_inode_pages(). That function can be called at
* This is for invalidate_mapping_pages(). That function can be called at
* any time, and is not supposed to throw away dirty pages. But pages can
* be marked dirty at any time too, so use remove_mapping which safely
* discards clean, unused pages.