- if ((flags & MS_ASYNC) && file && nr_pages_dirtied) {
- get_file(file);
- up_read(¤t->mm->mmap_sem);
- balance_dirty_pages_ratelimited_nr(file->f_mapping,
- nr_pages_dirtied);
- fput(file);
- down_read(¤t->mm->mmap_sem);
- vma = find_vma(current->mm, start);
- } else if ((flags & MS_SYNC) && file &&
- (vma->vm_flags & VM_SHARED)) {
- get_file(file);
- up_read(¤t->mm->mmap_sem);
- error = do_fsync(file, 0);
- fput(file);
- down_read(¤t->mm->mmap_sem);
- if (error)
- goto out_unlock;
- vma = find_vma(current->mm, start);
- } else {
- vma = vma->vm_next;
- }
- } while (vma && !done);
-out_unlock:
- current->flags &= ~PF_SYNCWRITE;
- up_read(¤t->mm->mmap_sem);