Skip to content

Commit

Permalink
kernfs: make kernfs_open_file->mmapped a bitfield
Browse files Browse the repository at this point in the history
More kernfs_open_file->mutex synchronized flags are planned to be
added.  Convert ->mmapped to a bitfield in preparation.

While at it, make kernfs_fop_mmap() use "true" instead of "1" on
->mmapped.

Signed-off-by: Tejun Heo <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Acked-by: Zefan Li <[email protected]>
  • Loading branch information
htejun committed Dec 27, 2016
1 parent 7ce7d89 commit a1d82af
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/kernfs/file.c
Original file line number Diff line number Diff line change
@@ -516,7 +516,7 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
goto out_put;

rc = 0;
of->mmapped = 1;
of->mmapped = true;
of->vm_ops = vma->vm_ops;
vma->vm_ops = &kernfs_vm_ops;
out_put:
2 changes: 1 addition & 1 deletion include/linux/kernfs.h
Original file line number Diff line number Diff line change
@@ -185,7 +185,7 @@ struct kernfs_open_file {
char *prealloc_buf;

size_t atomic_write_len;
bool mmapped;
bool mmapped:1;
const struct vm_operations_struct *vm_ops;
};

0 comments on commit a1d82af

Please sign in to comment.