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

Commit b13d3c6e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: Add hardlink support to .u extension
  9P2010.L handshake: .L protocol negotiation
  9P2010.L handshake: Remove "dotu" variable
  9P2010.L handshake: Add mount option
  9P2010.L handshake: Add VFS flags
  net/9p: Handle mount errors correctly.
  net/9p: Remove MAX_9P_CHAN limit
  net/9p: Add multi channel support.
parents e213e26a 5717144a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
			if (access == V9FS_ACCESS_SINGLE)
				return ERR_PTR(-EPERM);

			if (v9fs_extended(v9ses))
			if (v9fs_proto_dotu(v9ses))
				uname = NULL;
			else
				uname = v9ses->uname;
+4 −4
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
	list_add(&v9ses->slist, &v9fs_sessionlist);
	spin_unlock(&v9fs_sessionlist_lock);

	v9ses->flags = V9FS_EXTENDED | V9FS_ACCESS_USER;
	v9ses->flags = V9FS_PROTO_2000U | V9FS_ACCESS_USER;
	strcpy(v9ses->uname, V9FS_DEFUSER);
	strcpy(v9ses->aname, V9FS_DEFANAME);
	v9ses->uid = ~0;
@@ -262,13 +262,13 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
		goto error;
	}

	if (!v9ses->clnt->dotu)
		v9ses->flags &= ~V9FS_EXTENDED;
	if (!p9_is_proto_dotu(v9ses->clnt))
		v9ses->flags &= ~V9FS_PROTO_2000U;

	v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ;

	/* for legacy mode, fall back to V9FS_ACCESS_ANY */
	if (!v9fs_extended(v9ses) &&
	if (!v9fs_proto_dotu(v9ses) &&
		((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_USER)) {

		v9ses->flags &= ~V9FS_ACCESS_MASK;
+15 −8
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@

/**
 * enum p9_session_flags - option flags for each 9P session
 * @V9FS_EXTENDED: whether or not to use 9P2000.u extensions
 * @V9FS_PROTO_2000U: whether or not to use 9P2000.u extensions
 * @V9FS_PROTO_2010L: whether or not to use 9P2010.l extensions
 * @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy
 * @V9FS_ACCESS_USER: a new attach will be issued for every user (default)
 * @V9FS_ACCESS_ANY: use a single attach for all users
@@ -32,11 +33,12 @@
 * Session flags reflect options selected by users at mount time
 */
enum p9_session_flags {
	V9FS_EXTENDED		= 0x01,
	V9FS_ACCESS_SINGLE	= 0x02,
	V9FS_ACCESS_USER	= 0x04,
	V9FS_ACCESS_ANY		= 0x06,
	V9FS_ACCESS_MASK	= 0x06,
	V9FS_PROTO_2000U	= 0x01,
	V9FS_PROTO_2010L	= 0x02,
	V9FS_ACCESS_SINGLE	= 0x04,
	V9FS_ACCESS_USER	= 0x08,
	V9FS_ACCESS_ANY		= 0x0C,
	V9FS_ACCESS_MASK	= 0x0C,
};

/* possible values of ->cache */
@@ -121,7 +123,12 @@ static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode)
	return (inode->i_sb->s_fs_info);
}

static inline int v9fs_extended(struct v9fs_session_info *v9ses)
static inline int v9fs_proto_dotu(struct v9fs_session_info *v9ses)
{
	return v9ses->flags & V9FS_EXTENDED;
	return v9ses->flags & V9FS_PROTO_2000U;
}

static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses)
{
	return v9ses->flags & V9FS_PROTO_2010L;
}
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
		while (rdir->head < rdir->tail) {
			err = p9stat_read(rdir->buf + rdir->head,
						buflen - rdir->head, &st,
						fid->clnt->dotu);
						fid->clnt->proto_version);
			if (err) {
				P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
				err = -EIO;
+2 −2
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)

	P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file);
	v9ses = v9fs_inode2v9ses(inode);
	omode = v9fs_uflags2omode(file->f_flags, v9fs_extended(v9ses));
	omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses));
	fid = file->private_data;
	if (!fid) {
		fid = v9fs_fid_clone(file->f_path.dentry);
@@ -77,7 +77,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
			i_size_write(inode, 0);
			inode->i_blocks = 0;
		}
		if ((file->f_flags & O_APPEND) && (!v9fs_extended(v9ses)))
		if ((file->f_flags & O_APPEND) && (!v9fs_proto_dotu(v9ses)))
			generic_file_llseek(file, 0, SEEK_END);
	}

Loading