With all users migrated to ->invalidate_folio, remove the old operation.
Unified · Split
| @@ -251,7 +251,6 @@ prototypes:: · 250 unmodified lines | |||
| 251 | struct page *page, void *fsdata); | 251 | struct page *page, void *fsdata); |
| 252 | sector_t (*bmap)(struct address_space *, sector_t); | 252 | sector_t (*bmap)(struct address_space *, sector_t); |
| 253 | void (*invalidate_folio) (struct folio *, size_t start, size_t len); | 253 | void (*invalidate_folio) (struct folio *, size_t start, size_t len); |
| 254 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | ||
| 255 | int (*releasepage) (struct page *, int); | 254 | int (*releasepage) (struct page *, int); |
| 256 | void (*freepage)(struct page *); | 255 | void (*freepage)(struct page *); |
| 257 | int (*direct_IO)(struct kiocb *, struct iov_iter *iter); | 256 | int (*direct_IO)(struct kiocb *, struct iov_iter *iter); |
| @@ -280,7 +279,6 @@ write_begin: locks the page exclusive · 22 unmodified lines | |||
| 280 | write_end: yes, unlocks exclusive | 279 | write_end: yes, unlocks exclusive |
| 281 | bmap: | 280 | bmap: |
| 282 | invalidate_folio: yes exclusive | 281 | invalidate_folio: yes exclusive |
| 283 | invalidatepage: yes exclusive | ||
| 284 | releasepage: yes | 282 | releasepage: yes |
| 285 | freepage: yes | 283 | freepage: yes |
| 286 | direct_IO: | 284 | direct_IO: |
| @@ -736,7 +736,6 @@ cache in your filesystem. The following members are defined: · 735 unmodified lines | |||
| 736 | struct page *page, void *fsdata); | 736 | struct page *page, void *fsdata); |
| 737 | sector_t (*bmap)(struct address_space *, sector_t); | 737 | sector_t (*bmap)(struct address_space *, sector_t); |
| 738 | void (*invalidate_folio) (struct folio *, size_t start, size_t len); | 738 | void (*invalidate_folio) (struct folio *, size_t start, size_t len); |
| 739 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | ||
| 740 | int (*releasepage) (struct page *, int); | 739 | int (*releasepage) (struct page *, int); |
| 741 | void (*freepage)(struct page *); | 740 | void (*freepage)(struct page *); |
| 742 | ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter); | 741 | ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter); |
| @@ -388,7 +388,6 @@ struct address_space_operations { · 387 unmodified lines | |||
| 388 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 388 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
| 389 | sector_t (*bmap)(struct address_space *, sector_t); | 389 | sector_t (*bmap)(struct address_space *, sector_t); |
| 390 | void (*invalidate_folio) (struct folio *, size_t offset, size_t len); | 390 | void (*invalidate_folio) (struct folio *, size_t offset, size_t len); |
| 391 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | ||
| 392 | int (*releasepage) (struct page *, gfp_t); | 391 | int (*releasepage) (struct page *, gfp_t); |
| 393 | void (*freepage)(struct page *); | 392 | void (*freepage)(struct page *); |
| 394 | ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter); | 393 | ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter); |
| @@ -19,8 +19,7 @@ · 18 unmodified lines | |||
| 19 | #include <linux/highmem.h> | 19 | #include <linux/highmem.h> |
| 20 | #include <linux/pagevec.h> | 20 | #include <linux/pagevec.h> |
| 21 | #include <linux/task_io_accounting_ops.h> | 21 | #include <linux/task_io_accounting_ops.h> |
| 22 | #include <linux/buffer_head.h> /* grr. try_to_release_page, | 22 | #include <linux/buffer_head.h> /* grr. try_to_release_page */ |
| 23 | do_invalidatepage */ | ||
| 24 | #include <linux/shmem_fs.h> | 23 | #include <linux/shmem_fs.h> |
| 25 | #include <linux/rmap.h> | 24 | #include <linux/rmap.h> |
| 26 | #include "internal.h" | 25 | #include "internal.h" |
| @@ -155,16 +154,9 @@ static int invalidate_exceptional_entry2(struct address_space *mapping, · 128 unmodified lines | |||
| 155 | void folio_invalidate(struct folio *folio, size_t offset, size_t length) | 154 | void folio_invalidate(struct folio *folio, size_t offset, size_t length) |
| 156 | { | 155 | { |
| 157 | const struct address_space_operations *aops = folio->mapping->a_ops; | 156 | const struct address_space_operations *aops = folio->mapping->a_ops; |
| 158 | void (*invalidatepage)(struct page *, unsigned int, unsigned int); | ||
| 159 | 157 | ||
| 160 | if (aops->invalidate_folio) { | 158 | if (aops->invalidate_folio) |
| 161 | aops->invalidate_folio(folio, offset, length); | 159 | aops->invalidate_folio(folio, offset, length); |
| 162 | return; | ||
| 163 | } | ||
| 164 | |||
| 165 | invalidatepage = aops->invalidatepage; | ||
| 166 | if (invalidatepage) | ||
| 167 | (*invalidatepage)(&folio->page, offset, length); | ||
| 168 | } | 160 | } |
| 169 | EXPORT_SYMBOL_GPL(folio_invalidate); | 161 | EXPORT_SYMBOL_GPL(folio_invalidate); |
| 170 | 162 | ||
| @@ -334,7 +326,7 @@ int invalidate_inode_page(struct page *page) · 163 unmodified lines | |||
| 334 | * mapping is large, it is probably the case that the final pages are the most | 326 | * mapping is large, it is probably the case that the final pages are the most |
| 335 | * recently touched, and freeing happens in ascending file offset order. | 327 | * recently touched, and freeing happens in ascending file offset order. |
| 336 | * | 328 | * |
| 337 | * Note that since ->invalidatepage() accepts range to invalidate | 329 | * Note that since ->invalidate_folio() accepts range to invalidate |
| 338 | * truncate_inode_pages_range is able to handle cases where lend + 1 is not | 330 | * truncate_inode_pages_range is able to handle cases where lend + 1 is not |
| 339 | * page aligned properly. | 331 | * page aligned properly. |
| 340 | */ | 332 | */ |