Lines Matching refs:mnt_flags
270 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
346 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) in __mnt_want_write()
473 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
509 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
518 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
534 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
535 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
551 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
552 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
591 if (bastard->mnt_flags & MNT_SYNC_UMOUNT) { in __legitimize_mnt()
596 if (unlikely(bastard->mnt_flags & MNT_DOOMED)) { in __legitimize_mnt()
679 return mnt->mnt.mnt_flags & MNT_CURSOR; in mnt_is_cursor()
977 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1070 mnt->mnt.mnt_flags = old->mnt.mnt_flags; in clone_mnt()
1071 mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL); in clone_mnt()
1192 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1197 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1212 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1282 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1481 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1510 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1536 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1652 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
1699 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
1738 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
1852 if (s->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
1946 if (child->mnt.mnt_flags & MNT_LOCKED) in has_locked_children()
2014 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2032 p->mnt.mnt_flags = flags; in lock_mnt_tree()
2211 child->mnt.mnt_flags &= ~MNT_LOCKED; in attach_recursive_mnt()
2361 mnt->mnt.mnt_flags &= ~MNT_LOCKED; in __do_loopback()
2511 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
2513 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
2516 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
2520 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
2524 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
2528 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
2532 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
2538 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
2540 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
2548 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
2552 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
2554 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
2555 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
2586 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
2598 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
2607 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
2609 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
2624 int mnt_flags, void *data) in do_remount() argument
2637 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
2653 set_mount_attributes(mnt, mnt_flags); in do_remount()
2804 if (old->mnt.mnt_flags & MNT_LOCKED) in do_move_mount()
2873 struct path *path, int mnt_flags) in do_add_mount() argument
2877 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
2881 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
2896 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
2907 unsigned int mnt_flags) in do_new_mount_fc() argument
2915 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
2936 error = do_add_mount(real_mount(mnt), mp, mountpoint, mnt_flags); in do_new_mount_fc()
2948 int mnt_flags, const char *name, void *data) in do_new_mount() argument
2990 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3044 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3140 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
3246 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
3270 mnt_flags |= MNT_RELATIME; in path_mount()
3274 mnt_flags |= MNT_NOSUID; in path_mount()
3276 mnt_flags |= MNT_NODEV; in path_mount()
3278 mnt_flags |= MNT_NOEXEC; in path_mount()
3280 mnt_flags |= MNT_NOATIME; in path_mount()
3282 mnt_flags |= MNT_NODIRATIME; in path_mount()
3284 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
3286 mnt_flags |= MNT_READONLY; in path_mount()
3288 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
3294 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
3295 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
3308 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
3310 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
3318 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
3562 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
3565 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
3567 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
3569 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
3571 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
3573 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
3575 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
3577 return mnt_flags; in attr_flags_to_mnt_flags()
3593 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
3605 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
3611 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
3614 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
3640 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
3658 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
3859 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
3885 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
3886 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
3887 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
3917 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
3992 !(m->mnt.mnt_flags & MNT_READONLY)) { in mount_setattr_prepare()
4027 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4036 (m->mnt.mnt_flags & MNT_WRITE_HOLD)) in mount_setattr_commit()
4299 mnt->mnt_flags |= MNT_LOCKED; in init_mount_tree()
4428 int mnt_flags; in mnt_already_visible() local
4443 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
4447 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
4452 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
4455 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
4456 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
4466 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
4473 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
4517 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()