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

Commit 85004cc3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (118 commits)
  NFSv4: Iterate through all nfs_clients when the server recalls a delegation
  NFSv4: Deal more correctly with duplicate delegations
  NFS: Fix a potential race between umount and nfs_access_cache_shrinker()
  NFS: Add an asynchronous delegreturn operation for use in nfs_clear_inode
  nfs: convert NFS_*(inode) helpers to static inline
  nfs: obliterate NFS_FLAGS macro
  NFS: Address memory leaks in the NFS client mount option parser
  nfs4: allow nfsv4 acls on non-regular-files
  NFS: Optimise away the sigmask code in aio/dio reads and writes
  SUNRPC: Don't bother changing the sigmask for asynchronous RPC calls
  SUNRPC: rpcb_getport_sync() passes incorrect address size to rpc_create()
  SUNRPC: Clean up block comment preceding rpcb_getport_sync()
  SUNRPC: Use appropriate argument types in rpcb client
  SUNRPC: rpcb_getport_sync() should use built-in hostname generator
  SUNRPC: Clean up functions that free address_strings array
  NFS: NFS version number is unsigned
  NLM: Fix a bogus 'return' in nlmclnt_rpc_release
  NLM: Introduce an arguments structure for nlmclnt_init()
  NLM/NFS: Use cached nlm_host when calling nlmclnt_proc()
  NFS: Invoke nlmclnt_init during NFS mount processing
  ...
parents 149a051f 3fbd67ad
Loading
Loading
Loading
Loading
+42 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,48 @@ struct nlm_wait {


static LIST_HEAD(nlm_blocked);
static LIST_HEAD(nlm_blocked);


/**
 * nlmclnt_init - Set up per-NFS mount point lockd data structures
 * @nlm_init: pointer to arguments structure
 *
 * Returns pointer to an appropriate nlm_host struct,
 * or an ERR_PTR value.
 */
struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
{
	struct nlm_host *host;
	u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4;
	int status;

	status = lockd_up(nlm_init->protocol);
	if (status < 0)
		return ERR_PTR(status);

	host = nlmclnt_lookup_host((struct sockaddr_in *)nlm_init->address,
				   nlm_init->protocol, nlm_version,
				   nlm_init->hostname,
				   strlen(nlm_init->hostname));
	if (host == NULL) {
		lockd_down();
		return ERR_PTR(-ENOLCK);
	}

	return host;
}
EXPORT_SYMBOL_GPL(nlmclnt_init);

/**
 * nlmclnt_done - Release resources allocated by nlmclnt_init()
 * @host: nlm_host structure reserved by nlmclnt_init()
 *
 */
void nlmclnt_done(struct nlm_host *host)
{
	nlm_release_host(host);
	lockd_down();
}
EXPORT_SYMBOL_GPL(nlmclnt_done);

/*
/*
 * Queue up a lock for blocking so that the GRANTED request can see it
 * Queue up a lock for blocking so that the GRANTED request can see it
 */
 */
+11 −24
Original line number Original line Diff line number Diff line
@@ -145,34 +145,21 @@ static void nlmclnt_release_lockargs(struct nlm_rqst *req)
	BUG_ON(req->a_args.lock.fl.fl_ops != NULL);
	BUG_ON(req->a_args.lock.fl.fl_ops != NULL);
}
}


/*
/**
 * This is the main entry point for the NLM client.
 * nlmclnt_proc - Perform a single client-side lock request
 * @host: address of a valid nlm_host context representing the NLM server
 * @cmd: fcntl-style file lock operation to perform
 * @fl: address of arguments for the lock operation
 *
 */
 */
int
int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl)
nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
{
{
	struct rpc_clnt		*client = NFS_CLIENT(inode);
	struct sockaddr_in	addr;
	struct nfs_server	*nfssrv = NFS_SERVER(inode);
	struct nlm_host		*host;
	struct nlm_rqst		*call;
	struct nlm_rqst		*call;
	sigset_t		oldset;
	sigset_t		oldset;
	unsigned long		flags;
	unsigned long		flags;
	int			status, vers;
	int			status;

	vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1;
	if (NFS_PROTO(inode)->version > 3) {
		printk(KERN_NOTICE "NFSv4 file locking not implemented!\n");
		return -ENOLCK;
	}

	rpc_peeraddr(client, (struct sockaddr *) &addr, sizeof(addr));
	host = nlmclnt_lookup_host(&addr, client->cl_xprt->prot, vers,
				   nfssrv->nfs_client->cl_hostname,
				   strlen(nfssrv->nfs_client->cl_hostname));
	if (host == NULL)
		return -ENOLCK;


	nlm_get_host(host);
	call = nlm_alloc_call(host);
	call = nlm_alloc_call(host);
	if (call == NULL)
	if (call == NULL)
		return -ENOMEM;
		return -ENOMEM;
@@ -219,7 +206,7 @@ nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
	dprintk("lockd: clnt proc returns %d\n", status);
	dprintk("lockd: clnt proc returns %d\n", status);
	return status;
	return status;
}
}
EXPORT_SYMBOL(nlmclnt_proc);
EXPORT_SYMBOL_GPL(nlmclnt_proc);


/*
/*
 * Allocate an NLM RPC call struct
 * Allocate an NLM RPC call struct
@@ -257,7 +244,7 @@ void nlm_release_call(struct nlm_rqst *call)


static void nlmclnt_rpc_release(void *data)
static void nlmclnt_rpc_release(void *data)
{
{
	return nlm_release_call(data);
	nlm_release_call(data);
}
}


static int nlm_wait_on_grace(wait_queue_head_t *queue)
static int nlm_wait_on_grace(wait_queue_head_t *queue)
+1 −2
Original line number Original line Diff line number Diff line
@@ -612,8 +612,7 @@ const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie)
	 * called with BKL held.
	 * called with BKL held.
	 */
	 */
	static char buf[2*NLM_MAXCOOKIELEN+1];
	static char buf[2*NLM_MAXCOOKIELEN+1];
	int i;
	unsigned int i, len = sizeof(buf);
	int len = sizeof(buf);
	char *p = buf;
	char *p = buf;


	len--;	/* allow for trailing \0 */
	len--;	/* allow for trailing \0 */
+1 −6
Original line number Original line Diff line number Diff line
@@ -73,8 +73,6 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
	complete(&nfs_callback_info.started);
	complete(&nfs_callback_info.started);


	for(;;) {
	for(;;) {
		char buf[RPC_MAX_ADDRBUFLEN];

		if (signalled()) {
		if (signalled()) {
			if (nfs_callback_info.users == 0)
			if (nfs_callback_info.users == 0)
				break;
				break;
@@ -92,8 +90,6 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
					__FUNCTION__, -err);
					__FUNCTION__, -err);
			break;
			break;
		}
		}
		dprintk("%s: request from %s\n", __FUNCTION__,
				svc_print_addr(rqstp, buf, sizeof(buf)));
		svc_process(rqstp);
		svc_process(rqstp);
	}
	}


@@ -168,12 +164,11 @@ void nfs_callback_down(void)


static int nfs_callback_authenticate(struct svc_rqst *rqstp)
static int nfs_callback_authenticate(struct svc_rqst *rqstp)
{
{
	struct sockaddr_in *addr = svc_addr_in(rqstp);
	struct nfs_client *clp;
	struct nfs_client *clp;
	char buf[RPC_MAX_ADDRBUFLEN];
	char buf[RPC_MAX_ADDRBUFLEN];


	/* Don't talk to strangers */
	/* Don't talk to strangers */
	clp = nfs_find_client(addr, 4);
	clp = nfs_find_client(svc_addr(rqstp), 4);
	if (clp == NULL)
	if (clp == NULL)
		return SVC_DROP;
		return SVC_DROP;


+2 −2
Original line number Original line Diff line number Diff line
@@ -38,7 +38,7 @@ struct cb_compound_hdr_res {
};
};


struct cb_getattrargs {
struct cb_getattrargs {
	struct sockaddr_in *addr;
	struct sockaddr *addr;
	struct nfs_fh fh;
	struct nfs_fh fh;
	uint32_t bitmap[2];
	uint32_t bitmap[2];
};
};
@@ -53,7 +53,7 @@ struct cb_getattrres {
};
};


struct cb_recallargs {
struct cb_recallargs {
	struct sockaddr_in *addr;
	struct sockaddr *addr;
	struct nfs_fh fh;
	struct nfs_fh fh;
	nfs4_stateid stateid;
	nfs4_stateid stateid;
	uint32_t truncate;
	uint32_t truncate;
Loading