Lines Matching refs:mnt_flags
271 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
348 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { in __mnt_want_write()
508 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
556 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
565 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
581 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
595 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
596 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
635 if (bastard->mnt_flags & MNT_SYNC_UMOUNT) { in __legitimize_mnt()
640 if (unlikely(bastard->mnt_flags & MNT_DOOMED)) { in __legitimize_mnt()
723 return mnt->mnt.mnt_flags & MNT_CURSOR; in mnt_is_cursor()
1022 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1119 mnt->mnt.mnt_flags = old->mnt.mnt_flags; in clone_mnt()
1120 mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL); in clone_mnt()
1241 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1246 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1261 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1331 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1530 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1559 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1585 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1701 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
1748 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
1787 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
1901 if (s->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
1995 if (child->mnt.mnt_flags & MNT_LOCKED) in has_locked_children()
2063 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2081 p->mnt.mnt_flags = flags; in lock_mnt_tree()
2261 child->mnt.mnt_flags &= ~MNT_LOCKED; in attach_recursive_mnt()
2411 mnt->mnt.mnt_flags &= ~MNT_LOCKED; in __do_loopback()
2561 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
2563 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
2566 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
2570 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
2574 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
2578 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
2582 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
2588 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
2590 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
2598 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
2602 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
2604 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
2605 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
2638 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
2650 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
2659 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
2661 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
2676 int mnt_flags, void *data) in do_remount() argument
2689 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
2705 set_mount_attributes(mnt, mnt_flags); in do_remount()
2856 if (old->mnt.mnt_flags & MNT_LOCKED) in do_move_mount()
2925 const struct path *path, int mnt_flags) in do_add_mount() argument
2929 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
2933 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
2948 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
2959 unsigned int mnt_flags) in do_new_mount_fc() argument
2967 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
2988 error = do_add_mount(real_mount(mnt), mp, mountpoint, mnt_flags); in do_new_mount_fc()
3000 int mnt_flags, const char *name, void *data) in do_new_mount() argument
3042 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3096 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3192 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
3298 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
3322 mnt_flags |= MNT_RELATIME; in path_mount()
3326 mnt_flags |= MNT_NOSUID; in path_mount()
3328 mnt_flags |= MNT_NODEV; in path_mount()
3330 mnt_flags |= MNT_NOEXEC; in path_mount()
3332 mnt_flags |= MNT_NOATIME; in path_mount()
3334 mnt_flags |= MNT_NODIRATIME; in path_mount()
3336 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
3338 mnt_flags |= MNT_READONLY; in path_mount()
3340 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
3346 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
3347 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
3360 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
3362 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
3370 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
3614 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
3617 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
3619 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
3621 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
3623 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
3625 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
3627 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
3629 return mnt_flags; in attr_flags_to_mnt_flags()
3645 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
3657 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
3663 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
3666 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
3692 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
3710 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
3911 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
3937 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
3938 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
3939 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
3969 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
4030 (mnt->mnt.mnt_flags & MNT_READONLY)) && in mnt_allow_writers()
4069 if (p->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_prepare()
4117 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4120 if (m->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_commit()
4400 mnt->mnt_flags |= MNT_LOCKED; in init_mount_tree()
4529 int mnt_flags; in mnt_already_visible() local
4544 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
4548 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
4553 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
4556 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
4557 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
4567 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
4574 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
4618 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()