Commit fc0ecff698165ae8e178efa086e0dd1f385206b1
Committed by
Linus Torvalds
1 parent
54bc485522
Exists in
master
and in
4 other branches
[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>
Showing 12 changed files with 18 additions and 16 deletions Side-by-side Diff
drivers/md/bitmap.c
drivers/mtd/devices/block2mtd.c
drivers/usb/gadget/file_storage.c
... | ... | @@ -1953,7 +1953,7 @@ |
1953 | 1953 | struct inode *inode = filp->f_path.dentry->d_inode; |
1954 | 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 | 1957 | VLDBG(curlun, "invalidate_inode_pages -> %ld\n", rc); |
1958 | 1958 | } |
1959 | 1959 |
fs/9p/vfs_file.c
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | |
111 | 111 | if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { |
112 | 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 | 116 | return res; |
... | ... | @@ -234,7 +234,7 @@ |
234 | 234 | total += result; |
235 | 235 | } while (count); |
236 | 236 | |
237 | - invalidate_inode_pages2(inode->i_mapping); | |
237 | + invalidate_inode_pages2(inode->i_mapping); | |
238 | 238 | return total; |
239 | 239 | } |
240 | 240 |
fs/buffer.c
fs/drop_caches.c
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
21 | 21 | if (inode->i_state & (I_FREEING|I_WILL_FREE)) |
22 | 22 | continue; |
23 | - invalidate_inode_pages(inode->i_mapping); | |
23 | + invalidate_mapping_pages(inode->i_mapping, 0, -1); | |
24 | 24 | } |
25 | 25 | spin_unlock(&inode_lock); |
26 | 26 | } |
fs/fuse/file.c
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | if (outarg->open_flags & FOPEN_DIRECT_IO) |
70 | 70 | file->f_op = &fuse_direct_io_file_operations; |
71 | 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 | 73 | ff->fh = outarg->fh; |
74 | 74 | file->private_data = ff; |
75 | 75 | } |
fs/fuse/inode.c
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | { |
113 | 113 | struct fuse_conn *fc = get_fuse_conn(inode); |
114 | 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 | 117 | inode->i_ino = attr->ino; |
118 | 118 | inode->i_mode = (inode->i_mode & S_IFMT) + (attr->mode & 07777); |
fs/inode.c
... | ... | @@ -414,7 +414,8 @@ |
414 | 414 | __iget(inode); |
415 | 415 | spin_unlock(&inode_lock); |
416 | 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 | 419 | iput(inode); |
419 | 420 | spin_lock(&inode_lock); |
420 | 421 |
fs/jffs/inode-v23.c
... | ... | @@ -296,7 +296,7 @@ |
296 | 296 | inode->i_blocks = (inode->i_size + 511) >> 9; |
297 | 297 | |
298 | 298 | if (len) { |
299 | - invalidate_inode_pages(inode->i_mapping); | |
299 | + invalidate_mapping_pages(inode->i_mapping, 0, -1); | |
300 | 300 | } |
301 | 301 | inode->i_ctime = CURRENT_TIME_SEC; |
302 | 302 | inode->i_mtime = inode->i_ctime; |
... | ... | @@ -1518,7 +1518,7 @@ |
1518 | 1518 | } |
1519 | 1519 | inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; |
1520 | 1520 | mark_inode_dirty(inode); |
1521 | - invalidate_inode_pages(inode->i_mapping); | |
1521 | + invalidate_mapping_pages(inode->i_mapping, 0, -1); | |
1522 | 1522 | |
1523 | 1523 | out_isem: |
1524 | 1524 | return err; |
include/linux/fs.h
... | ... | @@ -1574,7 +1574,7 @@ |
1574 | 1574 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1575 | 1575 | pgoff_t start, pgoff_t end); |
1576 | 1576 | |
1577 | -static inline unsigned long | |
1577 | +static inline unsigned long __deprecated | |
1578 | 1578 | invalidate_inode_pages(struct address_space *mapping) |
1579 | 1579 | { |
1580 | 1580 | return invalidate_mapping_pages(mapping, 0, ~0UL); |
... | ... | @@ -1584,7 +1584,7 @@ |
1584 | 1584 | { |
1585 | 1585 | if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || |
1586 | 1586 | S_ISLNK(inode->i_mode)) |
1587 | - invalidate_inode_pages(inode->i_mapping); | |
1587 | + invalidate_mapping_pages(inode->i_mapping, 0, -1); | |
1588 | 1588 | } |
1589 | 1589 | extern int invalidate_inode_pages2(struct address_space *mapping); |
1590 | 1590 | extern int invalidate_inode_pages2_range(struct address_space *mapping, |
mm/truncate.c
... | ... | @@ -85,7 +85,7 @@ |
85 | 85 | * |
86 | 86 | * We need to bale out if page->mapping is no longer equal to the original |
87 | 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 | 89 | * c) when tmpfs swizzles a page between a tmpfs inode and swapper_space. |
90 | 90 | */ |
91 | 91 | static void |
... | ... | @@ -106,7 +106,7 @@ |
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 | 110 | * any time, and is not supposed to throw away dirty pages. But pages can |
111 | 111 | * be marked dirty at any time too, so use remove_mapping which safely |
112 | 112 | * discards clean, unused pages. |