/* This tells the low-level filesystem that a write is about to be performed to it, and makes sure that writes are allowed before returning success. When the write operation is finished, mnt_drop_write() must be called. This is effectively a refcount.  */
int mnt_want_write(struct vfsmount *mnt)
/* This tells the low-level filesystem that a write is about to be performed to it, and makes sure that writes are allowed before returning success. When the write operation is finished, mnt_drop_write() must be called. This is effectively a refcount.  */
int mnt_want_write(struct vfsmount *mnt)
{
	int ret = 0;
	preempt_disable();
	inc_mnt_writers(mnt);
	smp_mb();
	while (mnt->mnt_flags & MNT_WRITE_HOLD)
		cpu_relax();
	smp_rmb();
	if (__mnt_is_readonly(mnt)) {
		dec_mnt_writers(mnt);
		ret = -EROFS;
		goto out;
	}
out:
	preempt_enable();
	return ret;
}