Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73a09dd9 authored by Al Viro's avatar Al Viro
Browse files

introduce FMODE_CREATED and switch to it



Parallel to FILE_CREATED, goes into ->f_mode instead of *opened.
NFS is a bit of a wart here - it doesn't have file at the point
where FILE_CREATED used to be set, so we need to propagate it
there (for now).  IMA is another one (here and everywhere)...

Note that this needs do_dentry_open() to leave old bits in ->f_mode
alone - we want it to preserve FMODE_CREATED if it had been already
set (no other bit can be there).

Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent aad888f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -925,7 +925,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
	if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE)
		v9fs_cache_inode_set_cookie(d_inode(dentry), file);

	*opened |= FILE_CREATED;
	file->f_mode |= FMODE_CREATED;
out:
	dput(res);
	return err;
+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
	file->private_data = ofid;
	if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE)
		v9fs_cache_inode_set_cookie(inode, file);
	*opened |= FILE_CREATED;
	file->f_mode |= FMODE_CREATED;
out:
	v9fs_put_acl(dacl, pacl);
	dput(res);
+1 −1
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
		dout("atomic_open finish_open on dn %p\n", dn);
		if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) {
			ceph_init_inode_acls(d_inode(dentry), &acls);
			*opened |= FILE_CREATED;
			file->f_mode |= FMODE_CREATED;
		}
		err = finish_open(file, dentry, ceph_open, opened);
	}
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
	}

	if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
		*opened |= FILE_CREATED;
		file->f_mode |= FMODE_CREATED;

	rc = finish_open(file, direntry, generic_file_open, opened);
	if (rc) {
+1 −1
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
		goto no_open;

	/* Only creates */
	*opened |= FILE_CREATED;
	file->f_mode |= FMODE_CREATED;

	if (fc->no_create)
		goto mknod;
Loading