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

Commit 7add697a authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Eric Van Hensbergen
Browse files

fs/9p: Attach writeback_fid on first open with WR flag



We don't need writeback fid if we are only doing O_RDONLY open

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent ea59bb75
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ int v9fs_file_open(struct inode *inode, struct file *file)

	file->private_data = fid;
	mutex_lock(&v9inode->v_mutex);
	if (v9ses->cache && !v9inode->writeback_fid) {
	if (v9ses->cache && !v9inode->writeback_fid &&
	    ((file->f_flags & O_ACCMODE) != O_RDONLY)) {
		/*
		 * clone a fid and add it to writeback_fid
		 * we do it during open time instead of
+2 −1
Original line number Diff line number Diff line
@@ -652,7 +652,8 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
	if (nd && nd->flags & LOOKUP_OPEN) {
		v9inode = V9FS_I(dentry->d_inode);
		mutex_lock(&v9inode->v_mutex);
		if (v9ses->cache && !v9inode->writeback_fid) {
		if (v9ses->cache && !v9inode->writeback_fid &&
		    ((flags & O_ACCMODE) != O_RDONLY)) {
			/*
			 * clone a fid and add it to writeback_fid
			 * we do it during open time instead of
+2 −1
Original line number Diff line number Diff line
@@ -246,7 +246,8 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,

	v9inode = V9FS_I(inode);
	mutex_lock(&v9inode->v_mutex);
	if (v9ses->cache && !v9inode->writeback_fid) {
	if (v9ses->cache && !v9inode->writeback_fid &&
	    ((flags & O_ACCMODE) != O_RDONLY)) {
		/*
		 * clone a fid and add it to writeback_fid
		 * we do it during open time instead of