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

Commit 28890d35 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (44 commits)
  NFSv4: Don't use the delegation->inode in nfs_mark_return_delegation()
  nfs: don't use d_move in nfs_async_rename_done
  RDMA: Increasing RPCRDMA_MAX_DATA_SEGS
  SUNRPC: Replace xprt->resend and xprt->sending with a priority queue
  SUNRPC: Allow caller of rpc_sleep_on() to select priority levels
  SUNRPC: Support dynamic slot allocation for TCP connections
  SUNRPC: Clean up the slot table allocation
  SUNRPC: Initalise the struct xprt upon allocation
  SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot
  pnfs: simplify pnfs files module autoloading
  nfs: document nfsv4 sillyrename issues
  NFS: Convert nfs4_set_ds_client to EXPORT_SYMBOL_GPL
  SUNRPC: Convert the backchannel exports to EXPORT_SYMBOL_GPL
  SUNRPC: sunrpc should not explicitly depend on NFS config options
  NFS: Clean up - simplify the switch to read/write-through-MDS
  NFS: Move the pnfs write code into pnfs.c
  NFS: Move the pnfs read code into pnfs.c
  NFS: Allow the nfs_pageio_descriptor to signal that a re-coalesce is needed
  NFS: Use the nfs_pageio_descriptor->pg_bsize in the read/write request
  NFS: Cache rpc_ops in struct nfs_pageio_descriptor
  ...
parents 91d41fdf ed1e6211
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -302,7 +302,8 @@ nlmclnt_call(struct rpc_cred *cred, struct nlm_rqst *req, u32 proc)
				/* We appear to be out of the grace period */
				/* We appear to be out of the grace period */
				wake_up_all(&host->h_gracewait);
				wake_up_all(&host->h_gracewait);
			}
			}
			dprintk("lockd: server returns status %d\n", resp->status);
			dprintk("lockd: server returns status %d\n",
				ntohl(resp->status));
			return 0;	/* Okay, call complete */
			return 0;	/* Okay, call complete */
		}
		}


@@ -690,7 +691,8 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
		goto out;
		goto out;


	if (resp->status != nlm_lck_denied_nolocks)
	if (resp->status != nlm_lck_denied_nolocks)
		printk("lockd: unexpected unlock status: %d\n", resp->status);
		printk("lockd: unexpected unlock status: %d\n",
			ntohl(resp->status));
	/* What to do now? I'm out of my depth... */
	/* What to do now? I'm out of my depth... */
	status = -ENOLCK;
	status = -ENOLCK;
out:
out:
@@ -843,6 +845,7 @@ nlm_stat_to_errno(__be32 status)
		return -ENOLCK;
		return -ENOLCK;
#endif
#endif
	}
	}
	printk(KERN_NOTICE "lockd: unexpected server status %d\n", status);
	printk(KERN_NOTICE "lockd: unexpected server status %d\n",
		 ntohl(status));
	return -ENOLCK;
	return -ENOLCK;
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ config NFS_V4
config NFS_V4_1
config NFS_V4_1
	bool "NFS client support for NFSv4.1 (EXPERIMENTAL)"
	bool "NFS client support for NFSv4.1 (EXPERIMENTAL)"
	depends on NFS_FS && NFS_V4 && EXPERIMENTAL
	depends on NFS_FS && NFS_V4 && EXPERIMENTAL
	select SUNRPC_BACKCHANNEL
	select PNFS_FILE_LAYOUT
	select PNFS_FILE_LAYOUT
	help
	help
	  This option enables support for minor version 1 of the NFSv4 protocol
	  This option enables support for minor version 1 of the NFSv4 protocol
+36 −21
Original line number Original line Diff line number Diff line
@@ -111,6 +111,7 @@ int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation, const nf
static u32 initiate_file_draining(struct nfs_client *clp,
static u32 initiate_file_draining(struct nfs_client *clp,
				  struct cb_layoutrecallargs *args)
				  struct cb_layoutrecallargs *args)
{
{
	struct nfs_server *server;
	struct pnfs_layout_hdr *lo;
	struct pnfs_layout_hdr *lo;
	struct inode *ino;
	struct inode *ino;
	bool found = false;
	bool found = false;
@@ -118,7 +119,9 @@ static u32 initiate_file_draining(struct nfs_client *clp,
	LIST_HEAD(free_me_list);
	LIST_HEAD(free_me_list);


	spin_lock(&clp->cl_lock);
	spin_lock(&clp->cl_lock);
	list_for_each_entry(lo, &clp->cl_layouts, plh_layouts) {
	rcu_read_lock();
	list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
		list_for_each_entry(lo, &server->layouts, plh_layouts) {
			if (nfs_compare_fh(&args->cbl_fh,
			if (nfs_compare_fh(&args->cbl_fh,
					   &NFS_I(lo->plh_inode)->fh))
					   &NFS_I(lo->plh_inode)->fh))
				continue;
				continue;
@@ -132,7 +135,12 @@ static u32 initiate_file_draining(struct nfs_client *clp,
			get_layout_hdr(lo);
			get_layout_hdr(lo);
			break;
			break;
		}
		}
		if (found)
			break;
	}
	rcu_read_unlock();
	spin_unlock(&clp->cl_lock);
	spin_unlock(&clp->cl_lock);

	if (!found)
	if (!found)
		return NFS4ERR_NOMATCHING_LAYOUT;
		return NFS4ERR_NOMATCHING_LAYOUT;


@@ -154,6 +162,7 @@ static u32 initiate_file_draining(struct nfs_client *clp,
static u32 initiate_bulk_draining(struct nfs_client *clp,
static u32 initiate_bulk_draining(struct nfs_client *clp,
				  struct cb_layoutrecallargs *args)
				  struct cb_layoutrecallargs *args)
{
{
	struct nfs_server *server;
	struct pnfs_layout_hdr *lo;
	struct pnfs_layout_hdr *lo;
	struct inode *ino;
	struct inode *ino;
	u32 rv = NFS4ERR_NOMATCHING_LAYOUT;
	u32 rv = NFS4ERR_NOMATCHING_LAYOUT;
@@ -167,18 +176,24 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
	};
	};


	spin_lock(&clp->cl_lock);
	spin_lock(&clp->cl_lock);
	list_for_each_entry(lo, &clp->cl_layouts, plh_layouts) {
	rcu_read_lock();
	list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
		if ((args->cbl_recall_type == RETURN_FSID) &&
		if ((args->cbl_recall_type == RETURN_FSID) &&
		    memcmp(&NFS_SERVER(lo->plh_inode)->fsid,
		    memcmp(&server->fsid, &args->cbl_fsid,
			   &args->cbl_fsid, sizeof(struct nfs_fsid)))
			   sizeof(struct nfs_fsid)))
			continue;
			continue;

		list_for_each_entry(lo, &server->layouts, plh_layouts) {
			if (!igrab(lo->plh_inode))
			if (!igrab(lo->plh_inode))
				continue;
				continue;
			get_layout_hdr(lo);
			get_layout_hdr(lo);
			BUG_ON(!list_empty(&lo->plh_bulk_recall));
			BUG_ON(!list_empty(&lo->plh_bulk_recall));
			list_add(&lo->plh_bulk_recall, &recall_list);
			list_add(&lo->plh_bulk_recall, &recall_list);
		}
		}
	}
	rcu_read_unlock();
	spin_unlock(&clp->cl_lock);
	spin_unlock(&clp->cl_lock);

	list_for_each_entry_safe(lo, tmp,
	list_for_each_entry_safe(lo, tmp,
				 &recall_list, plh_bulk_recall) {
				 &recall_list, plh_bulk_recall) {
		ino = lo->plh_inode;
		ino = lo->plh_inode;
+3 −4
Original line number Original line Diff line number Diff line
@@ -188,9 +188,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
	cred = rpc_lookup_machine_cred();
	cred = rpc_lookup_machine_cred();
	if (!IS_ERR(cred))
	if (!IS_ERR(cred))
		clp->cl_machine_cred = cred;
		clp->cl_machine_cred = cred;
#if defined(CONFIG_NFS_V4_1)
	INIT_LIST_HEAD(&clp->cl_layouts);
#endif
	nfs_fscache_get_client_cookie(clp);
	nfs_fscache_get_client_cookie(clp);


	return clp;
	return clp;
@@ -293,6 +290,7 @@ static void nfs_free_client(struct nfs_client *clp)
	nfs4_deviceid_purge_client(clp);
	nfs4_deviceid_purge_client(clp);


	kfree(clp->cl_hostname);
	kfree(clp->cl_hostname);
	kfree(clp->server_scope);
	kfree(clp);
	kfree(clp);


	dprintk("<-- nfs_free_client()\n");
	dprintk("<-- nfs_free_client()\n");
@@ -1062,6 +1060,7 @@ static struct nfs_server *nfs_alloc_server(void)
	INIT_LIST_HEAD(&server->client_link);
	INIT_LIST_HEAD(&server->client_link);
	INIT_LIST_HEAD(&server->master_link);
	INIT_LIST_HEAD(&server->master_link);
	INIT_LIST_HEAD(&server->delegations);
	INIT_LIST_HEAD(&server->delegations);
	INIT_LIST_HEAD(&server->layouts);


	atomic_set(&server->active, 0);
	atomic_set(&server->active, 0);


@@ -1464,7 +1463,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
	dprintk("<-- %s %p\n", __func__, clp);
	dprintk("<-- %s %p\n", __func__, clp);
	return clp;
	return clp;
}
}
EXPORT_SYMBOL(nfs4_set_ds_client);
EXPORT_SYMBOL_GPL(nfs4_set_ds_client);


/*
/*
 * Session has been established, and the client marked ready.
 * Session has been established, and the client marked ready.
+8 −8
Original line number Original line Diff line number Diff line
@@ -398,12 +398,11 @@ int nfs_inode_return_delegation(struct inode *inode)
	return err;
	return err;
}
}


static void nfs_mark_return_delegation(struct nfs_delegation *delegation)
static void nfs_mark_return_delegation(struct nfs_server *server,
		struct nfs_delegation *delegation)
{
{
	struct nfs_client *clp = NFS_SERVER(delegation->inode)->nfs_client;

	set_bit(NFS_DELEGATION_RETURN, &delegation->flags);
	set_bit(NFS_DELEGATION_RETURN, &delegation->flags);
	set_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state);
	set_bit(NFS4CLNT_DELEGRETURN, &server->nfs_client->cl_state);
}
}


/**
/**
@@ -441,7 +440,7 @@ static void nfs_mark_return_all_delegation_types(struct nfs_server *server,
		if ((delegation->type == (FMODE_READ|FMODE_WRITE)) && !(flags & FMODE_WRITE))
		if ((delegation->type == (FMODE_READ|FMODE_WRITE)) && !(flags & FMODE_WRITE))
			continue;
			continue;
		if (delegation->type & flags)
		if (delegation->type & flags)
			nfs_mark_return_delegation(delegation);
			nfs_mark_return_delegation(server, delegation);
	}
	}
}
}


@@ -508,7 +507,7 @@ static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server)
	list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
	list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
		if (test_and_clear_bit(NFS_DELEGATION_REFERENCED, &delegation->flags))
		if (test_and_clear_bit(NFS_DELEGATION_REFERENCED, &delegation->flags))
			continue;
			continue;
		nfs_mark_return_delegation(delegation);
		nfs_mark_return_delegation(server, delegation);
	}
	}
}
}


@@ -539,7 +538,8 @@ void nfs_expire_unreferenced_delegations(struct nfs_client *clp)
int nfs_async_inode_return_delegation(struct inode *inode,
int nfs_async_inode_return_delegation(struct inode *inode,
				      const nfs4_stateid *stateid)
				      const nfs4_stateid *stateid)
{
{
	struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
	struct nfs_server *server = NFS_SERVER(inode);
	struct nfs_client *clp = server->nfs_client;
	struct nfs_delegation *delegation;
	struct nfs_delegation *delegation;


	rcu_read_lock();
	rcu_read_lock();
@@ -549,7 +549,7 @@ int nfs_async_inode_return_delegation(struct inode *inode,
		rcu_read_unlock();
		rcu_read_unlock();
		return -ENOENT;
		return -ENOENT;
	}
	}
	nfs_mark_return_delegation(delegation);
	nfs_mark_return_delegation(server, delegation);
	rcu_read_unlock();
	rcu_read_unlock();


	nfs_delegation_run_state_manager(clp);
	nfs_delegation_run_state_manager(clp);
Loading