Lines Matching refs:mnt_flags
425 return (mnt->mnt_flags & MNT_READONLY) || sb_rdonly(mnt->mnt_sb); in __mnt_is_readonly()
509 while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { in mnt_get_write_access()
673 mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; in mnt_hold_writers()
721 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in mnt_unhold_writers()
730 mnt->mnt.mnt_flags |= MNT_READONLY; in mnt_make_readonly()
746 if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { in sb_prepare_remount_readonly()
758 if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) in sb_prepare_remount_readonly()
759 mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; in sb_prepare_remount_readonly()
795 if (unlikely(bastard->mnt_flags & (MNT_SYNC_UMOUNT | MNT_DOOMED))) { in __legitimize_mnt()
1230 mnt->mnt.mnt_flags = MNT_INTERNAL; in vfs_create_mount()
1306 mnt->mnt.mnt_flags = READ_ONCE(old->mnt.mnt_flags) & in clone_mnt()
1430 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { in mntput_no_expire()
1435 mnt->mnt.mnt_flags |= MNT_DOOMED; in mntput_no_expire()
1452 if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { in mntput_no_expire()
1533 p->mnt.mnt_flags |= MNT_INTERNAL; in mnt_clone_internal()
1801 if (!(mnt->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) in disconnect_mount()
1830 p->mnt.mnt_flags |= MNT_UMOUNT; in umount_tree()
1858 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; in umount_tree()
1989 if (mnt->mnt.mnt_flags & MNT_LOCKED) in do_umount()
2037 if (mnt->mnt.mnt_flags & MNT_UMOUNT) { in __detach_mounts()
2077 if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ in can_umount()
2236 if (src_mnt->mnt.mnt_flags & MNT_LOCKED) { in copy_tree()
2261 if (src_mnt->mnt.mnt_flags & MNT_LOCKED) in copy_tree()
2262 dst_mnt->mnt.mnt_flags |= MNT_LOCKED; in copy_tree()
2383 if (child->mnt.mnt_flags & MNT_LOCKED) in __has_locked_children()
2479 int flags = p->mnt.mnt_flags; in lock_mnt_tree()
2497 p->mnt.mnt_flags = flags; in lock_mnt_tree()
3173 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags() argument
3175 unsigned int fl = mnt->mnt.mnt_flags; in can_change_locked_flags()
3178 !(mnt_flags & MNT_READONLY)) in can_change_locked_flags()
3182 !(mnt_flags & MNT_NODEV)) in can_change_locked_flags()
3186 !(mnt_flags & MNT_NOSUID)) in can_change_locked_flags()
3190 !(mnt_flags & MNT_NOEXEC)) in can_change_locked_flags()
3194 ((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK))) in can_change_locked_flags()
3200 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state() argument
3202 bool readonly_request = (mnt_flags & MNT_READONLY); in change_mount_ro_state()
3210 mnt->mnt.mnt_flags &= ~MNT_READONLY; in change_mount_ro_state()
3214 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes() argument
3216 mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK; in set_mount_attributes()
3217 mnt->mnt.mnt_flags = mnt_flags; in set_mount_attributes()
3255 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags) in do_reconfigure_mnt() argument
3267 if (!can_change_locked_flags(mnt, mnt_flags)) in do_reconfigure_mnt()
3276 ret = change_mount_ro_state(mnt, mnt_flags); in do_reconfigure_mnt()
3278 set_mount_attributes(mnt, mnt_flags); in do_reconfigure_mnt()
3293 int mnt_flags, void *data) in do_remount() argument
3306 if (!can_change_locked_flags(mnt, mnt_flags)) in do_remount()
3327 set_mount_attributes(mnt, mnt_flags); in do_remount()
3689 const struct path *path, int mnt_flags) in do_add_mount() argument
3693 mnt_flags &= ~MNT_INTERNAL_FLAGS; in do_add_mount()
3697 if (!(mnt_flags & MNT_SHRINKABLE)) in do_add_mount()
3711 newmnt->mnt.mnt_flags = mnt_flags; in do_add_mount()
3722 unsigned int mnt_flags) in do_new_mount_fc() argument
3730 if (!error && mount_too_revealing(sb, &mnt_flags)) in do_new_mount_fc()
3749 mountpoint, mnt_flags); in do_new_mount_fc()
3762 int mnt_flags, const char *name, void *data) in do_new_mount() argument
3810 err = do_new_mount_fc(fc, path, mnt_flags); in do_new_mount()
3856 path->mnt->mnt_flags | MNT_SHRINKABLE); in finish_automount()
3945 if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) in select_submounts()
4051 unsigned int mnt_flags = 0, sb_flags; in path_mount() local
4075 mnt_flags |= MNT_RELATIME; in path_mount()
4079 mnt_flags |= MNT_NOSUID; in path_mount()
4081 mnt_flags |= MNT_NODEV; in path_mount()
4083 mnt_flags |= MNT_NOEXEC; in path_mount()
4085 mnt_flags |= MNT_NOATIME; in path_mount()
4087 mnt_flags |= MNT_NODIRATIME; in path_mount()
4089 mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); in path_mount()
4091 mnt_flags |= MNT_READONLY; in path_mount()
4093 mnt_flags |= MNT_NOSYMFOLLOW; in path_mount()
4099 mnt_flags &= ~MNT_ATIME_MASK; in path_mount()
4100 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK; in path_mount()
4113 return do_reconfigure_mnt(path, mnt_flags); in path_mount()
4115 return do_remount(path, flags, sb_flags, mnt_flags, data_page); in path_mount()
4123 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name, in path_mount()
4370 unsigned int mnt_flags = 0; in attr_flags_to_mnt_flags() local
4373 mnt_flags |= MNT_READONLY; in attr_flags_to_mnt_flags()
4375 mnt_flags |= MNT_NOSUID; in attr_flags_to_mnt_flags()
4377 mnt_flags |= MNT_NODEV; in attr_flags_to_mnt_flags()
4379 mnt_flags |= MNT_NOEXEC; in attr_flags_to_mnt_flags()
4381 mnt_flags |= MNT_NODIRATIME; in attr_flags_to_mnt_flags()
4383 mnt_flags |= MNT_NOSYMFOLLOW; in attr_flags_to_mnt_flags()
4385 return mnt_flags; in attr_flags_to_mnt_flags()
4400 unsigned int mnt_flags = 0; in SYSCALL_DEFINE3() local
4412 mnt_flags = attr_flags_to_mnt_flags(attr_flags); in SYSCALL_DEFINE3()
4418 mnt_flags |= MNT_NOATIME; in SYSCALL_DEFINE3()
4421 mnt_flags |= MNT_RELATIME; in SYSCALL_DEFINE3()
4446 if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) { in SYSCALL_DEFINE3()
4464 newmount.mnt->mnt_flags = mnt_flags; in SYSCALL_DEFINE3()
4703 if (new_mnt->mnt.mnt_flags & MNT_LOCKED) in SYSCALL_DEFINE2()
4728 if (root_mnt->mnt.mnt_flags & MNT_LOCKED) { in SYSCALL_DEFINE2()
4729 new_mnt->mnt.mnt_flags |= MNT_LOCKED; in SYSCALL_DEFINE2()
4730 root_mnt->mnt.mnt_flags &= ~MNT_LOCKED; in SYSCALL_DEFINE2()
4759 unsigned int flags = mnt->mnt.mnt_flags; in recalc_flags()
4823 (mnt->mnt.mnt_flags & MNT_READONLY)) && in mnt_allow_writers()
4862 if (p->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_prepare()
4899 WRITE_ONCE(m->mnt.mnt_flags, flags); in mount_setattr_commit()
4902 if (m->mnt.mnt_flags & MNT_WRITE_HOLD) in mount_setattr_commit()
5246 unsigned int mnt_flags = READ_ONCE(mnt->mnt_flags); in mnt_to_attr_flags() local
5249 if (mnt_flags & MNT_READONLY) in mnt_to_attr_flags()
5251 if (mnt_flags & MNT_NOSUID) in mnt_to_attr_flags()
5253 if (mnt_flags & MNT_NODEV) in mnt_to_attr_flags()
5255 if (mnt_flags & MNT_NOEXEC) in mnt_to_attr_flags()
5257 if (mnt_flags & MNT_NODIRATIME) in mnt_to_attr_flags()
5259 if (mnt_flags & MNT_NOSYMFOLLOW) in mnt_to_attr_flags()
5262 if (mnt_flags & MNT_NOATIME) in mnt_to_attr_flags()
5264 else if (mnt_flags & MNT_RELATIME) in mnt_to_attr_flags()
6251 int mnt_flags; in mnt_already_visible() local
6263 mnt_flags = mnt->mnt.mnt_flags; in mnt_already_visible()
6267 mnt_flags |= MNT_LOCK_READONLY; in mnt_already_visible()
6272 if ((mnt_flags & MNT_LOCK_READONLY) && in mnt_already_visible()
6275 if ((mnt_flags & MNT_LOCK_ATIME) && in mnt_already_visible()
6276 ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) in mnt_already_visible()
6286 if (!(child->mnt.mnt_flags & MNT_LOCKED)) in mnt_already_visible()
6293 *new_mnt_flags |= mnt_flags & (MNT_LOCK_READONLY | \ in mnt_already_visible()
6336 return !(mnt->mnt_flags & MNT_NOSUID) && check_mnt(real_mount(mnt)) && in mnt_may_suid()