|
47 | 47 | #include <linux/splice.h>
|
48 | 48 | #include <linux/rcupdate_wait.h>
|
49 | 49 | #include <linux/sched/mm.h>
|
50 |
| -#include <linux/fsnotify.h> |
51 | 50 | #include <asm/pgalloc.h>
|
52 | 51 | #include <asm/tlbflush.h>
|
53 | 52 | #include "internal.h"
|
@@ -3336,48 +3335,6 @@ static vm_fault_t filemap_fault_recheck_pte_none(struct vm_fault *vmf)
|
3336 | 3335 | return ret;
|
3337 | 3336 | }
|
3338 | 3337 |
|
3339 |
| -/** |
3340 |
| - * filemap_fsnotify_fault - maybe emit a pre-content event. |
3341 |
| - * @vmf: struct vm_fault containing details of the fault. |
3342 |
| - * |
3343 |
| - * If we have a pre-content watch on this file we will emit an event for this |
3344 |
| - * range. If we return anything the fault caller should return immediately, we |
3345 |
| - * will return VM_FAULT_RETRY if we had to emit an event, which will trigger the |
3346 |
| - * fault again and then the fault handler will run the second time through. |
3347 |
| - * |
3348 |
| - * Return: a bitwise-OR of %VM_FAULT_ codes, 0 if nothing happened. |
3349 |
| - */ |
3350 |
| -vm_fault_t filemap_fsnotify_fault(struct vm_fault *vmf) |
3351 |
| -{ |
3352 |
| - struct file *fpin = NULL; |
3353 |
| - int mask = (vmf->flags & FAULT_FLAG_WRITE) ? MAY_WRITE : MAY_ACCESS; |
3354 |
| - loff_t pos = vmf->pgoff >> PAGE_SHIFT; |
3355 |
| - size_t count = PAGE_SIZE; |
3356 |
| - int err; |
3357 |
| - |
3358 |
| - /* |
3359 |
| - * We already did this and now we're retrying with everything locked, |
3360 |
| - * don't emit the event and continue. |
3361 |
| - */ |
3362 |
| - if (vmf->flags & FAULT_FLAG_TRIED) |
3363 |
| - return 0; |
3364 |
| - |
3365 |
| - /* No watches, we're done. */ |
3366 |
| - if (likely(!FMODE_FSNOTIFY_HSM(vmf->vma->vm_file->f_mode))) |
3367 |
| - return 0; |
3368 |
| - |
3369 |
| - fpin = maybe_unlock_mmap_for_io(vmf, fpin); |
3370 |
| - if (!fpin) |
3371 |
| - return VM_FAULT_SIGBUS; |
3372 |
| - |
3373 |
| - err = fsnotify_file_area_perm(fpin, mask, &pos, count); |
3374 |
| - fput(fpin); |
3375 |
| - if (err) |
3376 |
| - return VM_FAULT_SIGBUS; |
3377 |
| - return VM_FAULT_RETRY; |
3378 |
| -} |
3379 |
| -EXPORT_SYMBOL_GPL(filemap_fsnotify_fault); |
3380 |
| - |
3381 | 3338 | /**
|
3382 | 3339 | * filemap_fault - read in file data for page fault handling
|
3383 | 3340 | * @vmf: struct vm_fault containing details of the fault
|
@@ -3481,37 +3438,6 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
|
3481 | 3438 | * or because readahead was otherwise unable to retrieve it.
|
3482 | 3439 | */
|
3483 | 3440 | if (unlikely(!folio_test_uptodate(folio))) {
|
3484 |
| - /* |
3485 |
| - * If this is a precontent file we have can now emit an event to |
3486 |
| - * try and populate the folio. |
3487 |
| - */ |
3488 |
| - if (!(vmf->flags & FAULT_FLAG_TRIED) && |
3489 |
| - unlikely(FMODE_FSNOTIFY_HSM(file->f_mode))) { |
3490 |
| - loff_t pos = folio_pos(folio); |
3491 |
| - size_t count = folio_size(folio); |
3492 |
| - |
3493 |
| - /* We're NOWAIT, we have to retry. */ |
3494 |
| - if (vmf->flags & FAULT_FLAG_RETRY_NOWAIT) { |
3495 |
| - folio_unlock(folio); |
3496 |
| - goto out_retry; |
3497 |
| - } |
3498 |
| - |
3499 |
| - if (mapping_locked) |
3500 |
| - filemap_invalidate_unlock_shared(mapping); |
3501 |
| - mapping_locked = false; |
3502 |
| - |
3503 |
| - folio_unlock(folio); |
3504 |
| - fpin = maybe_unlock_mmap_for_io(vmf, fpin); |
3505 |
| - if (!fpin) |
3506 |
| - goto out_retry; |
3507 |
| - |
3508 |
| - error = fsnotify_file_area_perm(fpin, MAY_ACCESS, &pos, |
3509 |
| - count); |
3510 |
| - if (error) |
3511 |
| - ret = VM_FAULT_SIGBUS; |
3512 |
| - goto out_retry; |
3513 |
| - } |
3514 |
| - |
3515 | 3441 | /*
|
3516 | 3442 | * If the invalidate lock is not held, the folio was in cache
|
3517 | 3443 | * and uptodate and now it is not. Strange but possible since we
|
|
0 commit comments