diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-08 13:39:59 +0200 | 
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-08 13:39:59 +0200 | 
| commit | 5e13a0c5ec05d382b488a691dfb8af015b1dea1e (patch) | |
| tree | 7a06dfa1f7661f8908193f2437b32452520221d3 /fs/nfs/namespace.c | |
| parent | b615b57a124a4af7b68196bc2fb8acc236041fa2 (diff) | |
| parent | 4f256e8aa3eda15c11c3cec3ec5336e1fc579cbd (diff) | |
Merge remote-tracking branch 'airlied/drm-core-next' into drm-intel-next-queued
Backmerge of drm-next to resolve a few ugly conflicts and to get a few
fixes from 3.4-rc6 (which drm-next has already merged). Note that this
merge also restricts the stencil cache lra evict policy workaround to
snb (as it should) - I had to frob the code anyway because the
CM0_MASK_SHIFT define died in the masked bit cleanups.
We need the backmerge to get Paulo Zanoni's infoframe regression fix
for gm45 - further bugfixes from him touch the same area and would
needlessly conflict.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'fs/nfs/namespace.c')
| -rw-r--r-- | fs/nfs/namespace.c | 93 | 
1 files changed, 27 insertions, 66 deletions
| diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 1807866bb3ab..d51868e5683c 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -148,66 +148,31 @@ rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)  	return pseudoflavor;  } -static int nfs_negotiate_security(const struct dentry *parent, -				  const struct dentry *dentry, -				  rpc_authflavor_t *flavor) +static struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir, +					      struct qstr *name, +					      struct nfs_fh *fh, +					      struct nfs_fattr *fattr)  { -	struct page *page; -	struct nfs4_secinfo_flavors *flavors; -	int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); -	int ret = -EPERM; - -	secinfo = NFS_PROTO(parent->d_inode)->secinfo; -	if (secinfo != NULL) { -		page = alloc_page(GFP_KERNEL); -		if (!page) { -			ret = -ENOMEM; -			goto out; -		} -		flavors = page_address(page); -		ret = secinfo(parent->d_inode, &dentry->d_name, flavors); -		*flavor = nfs_find_best_sec(flavors); -		put_page(page); -	} - -out: -	return ret; -} - -static int nfs_lookup_with_sec(struct nfs_server *server, struct dentry *parent, -			       struct dentry *dentry, struct path *path, -			       struct nfs_fh *fh, struct nfs_fattr *fattr, -			       rpc_authflavor_t *flavor) -{ -	struct rpc_clnt *clone; -	struct rpc_auth *auth;  	int err; -	err = nfs_negotiate_security(parent, path->dentry, flavor); -	if (err < 0) -		goto out; -	clone  = rpc_clone_client(server->client); -	auth   = rpcauth_create(*flavor, clone); -	if (!auth) { -		err = -EIO; -		goto out_shutdown; -	} -	err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode, -						  &path->dentry->d_name, -						  fh, fattr); -out_shutdown: -	rpc_shutdown_client(clone); -out: -	return err; +	if (NFS_PROTO(dir)->version == 4) +		return nfs4_proc_lookup_mountpoint(dir, name, fh, fattr); + +	err = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, name, fh, fattr); +	if (err) +		return ERR_PTR(err); +	return rpc_clone_client(NFS_SERVER(dir)->client);  }  #else /* CONFIG_NFS_V4 */ -static inline int nfs_lookup_with_sec(struct nfs_server *server, -				      struct dentry *parent, struct dentry *dentry, -				      struct path *path, struct nfs_fh *fh, -				      struct nfs_fattr *fattr, -				      rpc_authflavor_t *flavor) +static inline struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir, +						     struct qstr *name, +						     struct nfs_fh *fh, +						     struct nfs_fattr *fattr)  { -	return -EPERM; +	int err = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, name, fh, fattr); +	if (err) +		return ERR_PTR(err); +	return rpc_clone_client(NFS_SERVER(dir)->client);  }  #endif /* CONFIG_NFS_V4 */ @@ -226,12 +191,10 @@ static inline int nfs_lookup_with_sec(struct nfs_server *server,  struct vfsmount *nfs_d_automount(struct path *path)  {  	struct vfsmount *mnt; -	struct nfs_server *server = NFS_SERVER(path->dentry->d_inode);  	struct dentry *parent;  	struct nfs_fh *fh = NULL;  	struct nfs_fattr *fattr = NULL; -	int err; -	rpc_authflavor_t flavor = RPC_AUTH_UNIX; +	struct rpc_clnt *client;  	dprintk("--> nfs_d_automount()\n"); @@ -249,21 +212,19 @@ struct vfsmount *nfs_d_automount(struct path *path)  	/* Look it up again to get its attributes */  	parent = dget_parent(path->dentry); -	err = server->nfs_client->rpc_ops->lookup(server->client, parent->d_inode, -						  &path->dentry->d_name, -						  fh, fattr); -	if (err == -EPERM && NFS_PROTO(parent->d_inode)->secinfo != NULL) -		err = nfs_lookup_with_sec(server, parent, path->dentry, path, fh, fattr, &flavor); +	client = nfs_lookup_mountpoint(parent->d_inode, &path->dentry->d_name, fh, fattr);  	dput(parent); -	if (err != 0) { -		mnt = ERR_PTR(err); +	if (IS_ERR(client)) { +		mnt = ERR_CAST(client);  		goto out;  	}  	if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) -		mnt = nfs_do_refmount(path->dentry); +		mnt = nfs_do_refmount(client, path->dentry);  	else -		mnt = nfs_do_submount(path->dentry, fh, fattr, flavor); +		mnt = nfs_do_submount(path->dentry, fh, fattr, client->cl_auth->au_flavor); +	rpc_shutdown_client(client); +  	if (IS_ERR(mnt))  		goto out; | 
