Lines Matching refs:mnt_flags
272 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
349 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { in __mnt_want_write()
509 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
557 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
566 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
582 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
596 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
597 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
632 if (bastard->mnt_flags & MNT_SYNC_UMOUNT) { in __legitimize_mnt()
637 if (unlikely(bastard->mnt_flags & MNT_DOOMED)) { in __legitimize_mnt()
720 return mnt->mnt.mnt_flags & MNT_CURSOR; in mnt_is_cursor()
1018 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1111 mnt->mnt.mnt_flags = old->mnt.mnt_flags; in clone_mnt()
1112 mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL); in clone_mnt()
1232 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1237 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1252 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1333 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1532 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1561 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1587 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1703 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
1750 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
1789 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
1903 if (s->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
1997 if (child->mnt.mnt_flags & MNT_LOCKED) in has_locked_children()
2065 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2083 p->mnt.mnt_flags = flags; in lock_mnt_tree()
2263 child->mnt.mnt_flags &= ~MNT_LOCKED; in attach_recursive_mnt()
2413 mnt->mnt.mnt_flags &= ~MNT_LOCKED; in __do_loopback()
2563 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
2565 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
2568 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
2572 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
2576 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
2580 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
2584 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
2590 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
2592 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
2600 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
2604 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
2606 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
2607 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
2640 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
2652 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
2661 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
2663 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
2678 int mnt_flags, void *data) in do_remount() argument
2691 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
2707 set_mount_attributes(mnt, mnt_flags); in do_remount()
2858 if (old->mnt.mnt_flags & MNT_LOCKED) in do_move_mount()
2927 const struct path *path, int mnt_flags) in do_add_mount() argument
2931 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
2935 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
2950 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
2961 unsigned int mnt_flags) in do_new_mount_fc() argument
2969 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
2990 error = do_add_mount(real_mount(mnt), mp, mountpoint, mnt_flags); in do_new_mount_fc()
3002 int mnt_flags, const char *name, void *data) in do_new_mount() argument
3044 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3098 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3194 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
3300 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
3324 mnt_flags |= MNT_RELATIME; in path_mount()
3328 mnt_flags |= MNT_NOSUID; in path_mount()
3330 mnt_flags |= MNT_NODEV; in path_mount()
3332 mnt_flags |= MNT_NOEXEC; in path_mount()
3334 mnt_flags |= MNT_NOATIME; in path_mount()
3336 mnt_flags |= MNT_NODIRATIME; in path_mount()
3338 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
3340 mnt_flags |= MNT_READONLY; in path_mount()
3342 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
3348 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
3349 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
3362 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
3364 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
3372 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
3617 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
3620 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
3622 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
3624 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
3626 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
3628 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
3630 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
3632 return mnt_flags; in attr_flags_to_mnt_flags()
3648 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
3660 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
3666 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
3669 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
3695 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
3713 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
3914 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
3940 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
3941 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
3942 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
3972 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
4033 (mnt->mnt.mnt_flags & MNT_READONLY)) && in mnt_allow_writers()
4072 if (p->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_prepare()
4111 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4114 if (m->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_commit()
4406 mnt->mnt_flags |= MNT_LOCKED; in init_mount_tree()
4534 int mnt_flags; in mnt_already_visible() local
4549 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
4553 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
4558 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
4561 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
4562 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
4572 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
4579 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
4623 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()