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

Commit 749d2297 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9p: saving negative to unsigned char
  9p: return on mutex_lock_interruptible()
  9p: Creating files with names too long should fail with ENAMETOOLONG.
  9p: Make sure we are able to clunk the cached fid on umount
  9p: drop nlink remove
  fs/9p: Clunk the fid resulting from partial walk of the name
  9p: documentation update
  9p: Fix setting of protocol flags in v9fs_session_info structure.
parents 795d580b 3dc9fef6
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -37,6 +37,15 @@ For Plan 9 From User Space applications (http://swtch.com/plan9)

	mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER

For server running on QEMU host with virtio transport:

	mount -t 9p -o trans=virtio <mount_tag> /mnt/9

where mount_tag is the tag associated by the server to each of the exported
mount points. Each 9P export is seen by the client as a virtio device with an
associated "mount_tag" property. Available mount tags can be
seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files.

OPTIONS
=======

@@ -47,7 +56,7 @@ OPTIONS
			fd   	- used passed file descriptors for connection
                                (see rfdno and wfdno)
			virtio	- connect to the next virtio channel available
				(from lguest or KVM with trans_virtio module)
				(from QEMU with trans_virtio module)
			rdma	- connect to a specified RDMA channel

  uname=name	user name to attempt mount as on the remote server.  The
@@ -85,7 +94,12 @@ OPTIONS

  port=n	port to connect to on the remote server

  noextend	force legacy mode (no 9p2000.u semantics)
  noextend	force legacy mode (no 9p2000.u or 9p2000.L semantics)

  version=name	Select 9P protocol version. Valid options are:
			9p2000          - Legacy mode (same as noextend)
			9p2000.u        - Use 9P2000.u protocol
			9p2000.L        - Use 9P2000.L protocol

  dfltuid	attempt to mount as a particular uid

+10 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
{
	int i, n, l, clone, any, access;
	u32 uid;
	struct p9_fid *fid;
	struct p9_fid *fid, *old_fid = NULL;
	struct dentry *d, *ds;
	struct v9fs_session_info *v9ses;
	char **wnames, *uname;
@@ -184,10 +184,18 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
		l = min(n - i, P9_MAXWELEM);
		fid = p9_client_walk(fid, l, &wnames[i], clone);
		if (IS_ERR(fid)) {
			if (old_fid) {
				/*
				 * If we fail, clunk fid which are mapping
				 * to path component and not the last component
				 * of the path.
				 */
				p9_client_clunk(old_fid);
			}
			kfree(wnames);
			return fid;
		}

		old_fid = fid;
		i += l;
		clone = 0;
	}
+18 −3
Original line number Diff line number Diff line
@@ -242,7 +242,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_PROTO_2000U | V9FS_ACCESS_USER;
	v9ses->flags = V9FS_ACCESS_USER;
	strcpy(v9ses->uname, V9FS_DEFUSER);
	strcpy(v9ses->aname, V9FS_DEFANAME);
	v9ses->uid = ~0;
@@ -263,8 +263,10 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
		goto error;
	}

	if (!p9_is_proto_dotu(v9ses->clnt))
		v9ses->flags &= ~V9FS_PROTO_2000U;
	if (p9_is_proto_dotl(v9ses->clnt))
		v9ses->flags |= V9FS_PROTO_2000L;
	else if (p9_is_proto_dotu(v9ses->clnt))
		v9ses->flags |= V9FS_PROTO_2000U;

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

@@ -341,6 +343,19 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
	p9_client_disconnect(v9ses->clnt);
}

/**
 * v9fs_session_begin_cancel - Begin terminate of a session
 * @v9ses: session to terminate
 *
 * After this call we don't allow any request other than clunk.
 */

void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
{
	P9_DPRINTK(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
	p9_client_begin_disconnect(v9ses->clnt);
}

extern int v9fs_error_init(void);

static struct kobject *v9fs_kobj;
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *,
									char *);
void v9fs_session_close(struct v9fs_session_info *v9ses);
void v9fs_session_cancel(struct v9fs_session_info *v9ses);
void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses);

#define V9FS_MAGIC 0x01021997

+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
	rdir = (struct p9_rdir *) fid->rdir;

	err = mutex_lock_interruptible(&rdir->mutex);
	if (err)
		return err;
	while (err == 0) {
		if (rdir->tail == rdir->head) {
			err = v9fs_file_readn(filp, rdir->buf, NULL,
Loading