Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d82aff authored by Tejun Heo's avatar Tejun Heo
Browse files

kernfs: make kernfs_open_file->mmapped a bitfield



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: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarAcked-by: Zefan Li <lizefan@huawei.com>
parent 7ce7d89f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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:
+1 −1
Original line number Diff line number Diff line
@@ -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;
};