Lines Matching refs:mnt_flags
383 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
467 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { in mnt_get_write_access()
631 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
679 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
688 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
704 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
716 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
717 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
752 if (bastard->mnt_flags & MNT_SYNC_UMOUNT) { in __legitimize_mnt()
757 if (unlikely(bastard->mnt_flags & MNT_DOOMED)) { in __legitimize_mnt()
1127 WARN_ON(mnt->mnt.mnt_flags & MNT_ONRB); in mnt_add_to_ns()
1138 mnt->mnt.mnt_flags |= MNT_ONRB; in mnt_add_to_ns()
1214 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1307 mnt->mnt.mnt_flags = old->mnt.mnt_flags; in clone_mnt()
1308 mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL|MNT_ONRB); in clone_mnt()
1428 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1433 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1448 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1529 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1736 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1765 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1766 if (p->mnt.mnt_flags & MNT_ONRB) in umount_tree()
1794 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1910 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
1915 if (mnt->mnt.mnt_flags & MNT_ONRB || in do_umount()
1923 if (mnt->mnt.mnt_flags & MNT_ONRB || in do_umount()
1959 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
1998 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
2140 if (src_mnt->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
2236 if (child->mnt.mnt_flags & MNT_LOCKED) in has_locked_children()
2304 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2322 p->mnt.mnt_flags = flags; in lock_mnt_tree()
2529 child->mnt.mnt_flags &= ~MNT_LOCKED; in attach_recursive_mnt()
2747 mnt->mnt.mnt_flags &= ~MNT_LOCKED; in __do_loopback()
2896 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
2898 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
2901 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
2905 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
2909 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
2913 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
2917 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
2923 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
2925 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
2933 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
2937 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
2939 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
2940 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
2978 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
2990 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
2999 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
3001 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
3016 int mnt_flags, void *data) in do_remount() argument
3029 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
3050 set_mount_attributes(mnt, mnt_flags); in do_remount()
3308 if (old->mnt.mnt_flags & MNT_LOCKED) in do_move_mount()
3387 const struct path *path, int mnt_flags) in do_add_mount() argument
3391 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
3395 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
3409 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
3420 unsigned int mnt_flags) in do_new_mount_fc() argument
3428 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
3449 error = do_add_mount(real_mount(mnt), mp, mountpoint, mnt_flags); in do_new_mount_fc()
3461 int mnt_flags, const char *name, void *data) in do_new_mount() argument
3509 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3560 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3656 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
3762 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
3786 mnt_flags |= MNT_RELATIME; in path_mount()
3790 mnt_flags |= MNT_NOSUID; in path_mount()
3792 mnt_flags |= MNT_NODEV; in path_mount()
3794 mnt_flags |= MNT_NOEXEC; in path_mount()
3796 mnt_flags |= MNT_NOATIME; in path_mount()
3798 mnt_flags |= MNT_NODIRATIME; in path_mount()
3800 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
3802 mnt_flags |= MNT_READONLY; in path_mount()
3804 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
3810 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
3811 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
3824 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
3826 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
3834 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
4080 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
4083 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
4085 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
4087 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
4089 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
4091 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
4093 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
4095 return mnt_flags; in attr_flags_to_mnt_flags()
4111 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
4123 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
4129 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
4132 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
4158 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
4176 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
4381 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
4407 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
4408 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
4409 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
4439 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
4504 (mnt->mnt.mnt_flags & MNT_READONLY)) && in mnt_allow_writers()
4543 if (p->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_prepare()
4582 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4585 if (m->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_commit()
4889 unsigned int mnt_flags = READ_ONCE(mnt->mnt_flags); in mnt_to_attr_flags() local
4892 if (mnt_flags & MNT_READONLY) in mnt_to_attr_flags()
4894 if (mnt_flags & MNT_NOSUID) in mnt_to_attr_flags()
4896 if (mnt_flags & MNT_NODEV) in mnt_to_attr_flags()
4898 if (mnt_flags & MNT_NOEXEC) in mnt_to_attr_flags()
4900 if (mnt_flags & MNT_NODIRATIME) in mnt_to_attr_flags()
4902 if (mnt_flags & MNT_NOSYMFOLLOW) in mnt_to_attr_flags()
4905 if (mnt_flags & MNT_NOATIME) in mnt_to_attr_flags()
4907 else if (mnt_flags & MNT_RELATIME) in mnt_to_attr_flags()
5508 mnt->mnt_flags |= MNT_LOCKED; in init_mount_tree()
5637 int mnt_flags; in mnt_already_visible() local
5649 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
5653 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
5658 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
5661 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
5662 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
5672 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
5679 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
5722 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()