Lines Matching refs:mnt_flags
272 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
356 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { in __mnt_want_write()
518 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
566 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
575 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
591 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
603 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
604 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
639 if (bastard->mnt_flags & MNT_SYNC_UMOUNT) { in __legitimize_mnt()
644 if (unlikely(bastard->mnt_flags & MNT_DOOMED)) { in __legitimize_mnt()
743 return mnt->mnt.mnt_flags & MNT_CURSOR; in mnt_is_cursor()
1095 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1188 mnt->mnt.mnt_flags = old->mnt.mnt_flags; in clone_mnt()
1189 mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL); in clone_mnt()
1309 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1314 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1329 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1410 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1609 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1638 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1664 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1780 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
1827 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
1879 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
1993 if (s->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
2087 if (child->mnt.mnt_flags & MNT_LOCKED) in has_locked_children()
2155 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2173 p->mnt.mnt_flags = flags; in lock_mnt_tree()
2376 child->mnt.mnt_flags &= ~MNT_LOCKED; in attach_recursive_mnt()
2594 mnt->mnt.mnt_flags &= ~MNT_LOCKED; in __do_loopback()
2744 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
2746 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
2749 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
2753 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
2757 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
2761 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
2765 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
2771 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
2773 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
2781 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
2785 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
2787 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
2788 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
2818 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
2830 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
2839 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
2841 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
2856 int mnt_flags, void *data) in do_remount() argument
2869 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
2885 set_mount_attributes(mnt, mnt_flags); in do_remount()
3142 if (old->mnt.mnt_flags & MNT_LOCKED) in do_move_mount()
3221 const struct path *path, int mnt_flags) in do_add_mount() argument
3225 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
3229 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
3243 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
3254 unsigned int mnt_flags) in do_new_mount_fc() argument
3262 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
3283 error = do_add_mount(real_mount(mnt), mp, mountpoint, mnt_flags); in do_new_mount_fc()
3295 int mnt_flags, const char *name, void *data) in do_new_mount() argument
3337 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3388 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3484 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
3590 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
3614 mnt_flags |= MNT_RELATIME; in path_mount()
3618 mnt_flags |= MNT_NOSUID; in path_mount()
3620 mnt_flags |= MNT_NODEV; in path_mount()
3622 mnt_flags |= MNT_NOEXEC; in path_mount()
3624 mnt_flags |= MNT_NOATIME; in path_mount()
3626 mnt_flags |= MNT_NODIRATIME; in path_mount()
3628 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
3630 mnt_flags |= MNT_READONLY; in path_mount()
3632 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
3638 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
3639 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
3652 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
3654 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
3662 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
3907 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
3910 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
3912 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
3914 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
3916 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
3918 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
3920 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
3922 return mnt_flags; in attr_flags_to_mnt_flags()
3938 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
3950 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
3956 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
3959 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
3985 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
4003 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
4209 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
4235 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
4236 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
4237 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
4267 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
4328 (mnt->mnt.mnt_flags & MNT_READONLY)) && in mnt_allow_writers()
4367 if (p->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_prepare()
4406 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4409 if (m->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_commit()
4701 mnt->mnt_flags |= MNT_LOCKED; in init_mount_tree()
4829 int mnt_flags; in mnt_already_visible() local
4844 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
4848 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
4853 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
4856 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
4857 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
4867 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
4874 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
4918 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()