mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
NFS: Remove secinfo knowledge out of the generic client
And also remove the unneeded rpc_op. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
df0117481c
commit
2671bfc3be
6 changed files with 30 additions and 34 deletions
|
@ -286,9 +286,6 @@ extern void nfs_sb_deactive(struct super_block *sb);
|
||||||
extern char *nfs_path(char **p, struct dentry *dentry,
|
extern char *nfs_path(char **p, struct dentry *dentry,
|
||||||
char *buffer, ssize_t buflen);
|
char *buffer, ssize_t buflen);
|
||||||
extern struct vfsmount *nfs_d_automount(struct path *path);
|
extern struct vfsmount *nfs_d_automount(struct path *path);
|
||||||
#ifdef CONFIG_NFS_V4
|
|
||||||
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* getroot.c */
|
/* getroot.c */
|
||||||
extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *,
|
extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *,
|
||||||
|
|
|
@ -119,35 +119,6 @@ Elong:
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NFS_V4
|
#ifdef CONFIG_NFS_V4
|
||||||
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
|
|
||||||
{
|
|
||||||
struct gss_api_mech *mech;
|
|
||||||
struct xdr_netobj oid;
|
|
||||||
int i;
|
|
||||||
rpc_authflavor_t pseudoflavor = RPC_AUTH_UNIX;
|
|
||||||
|
|
||||||
for (i = 0; i < flavors->num_flavors; i++) {
|
|
||||||
struct nfs4_secinfo_flavor *flavor;
|
|
||||||
flavor = &flavors->flavors[i];
|
|
||||||
|
|
||||||
if (flavor->flavor == RPC_AUTH_NULL || flavor->flavor == RPC_AUTH_UNIX) {
|
|
||||||
pseudoflavor = flavor->flavor;
|
|
||||||
break;
|
|
||||||
} else if (flavor->flavor == RPC_AUTH_GSS) {
|
|
||||||
oid.len = flavor->gss.sec_oid4.len;
|
|
||||||
oid.data = flavor->gss.sec_oid4.data;
|
|
||||||
mech = gss_mech_get_by_OID(&oid);
|
|
||||||
if (!mech)
|
|
||||||
continue;
|
|
||||||
pseudoflavor = gss_svc_to_pseudoflavor(mech, flavor->gss.service);
|
|
||||||
gss_mech_put(mech);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pseudoflavor;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir,
|
static struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir,
|
||||||
struct qstr *name,
|
struct qstr *name,
|
||||||
struct nfs_fh *fh,
|
struct nfs_fh *fh,
|
||||||
|
|
|
@ -206,6 +206,7 @@ extern const struct dentry_operations nfs4_dentry_operations;
|
||||||
extern const struct inode_operations nfs4_dir_inode_operations;
|
extern const struct inode_operations nfs4_dir_inode_operations;
|
||||||
|
|
||||||
/* nfs4namespace.c */
|
/* nfs4namespace.c */
|
||||||
|
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
|
||||||
struct rpc_clnt *nfs4_create_sec_client(struct rpc_clnt *, struct inode *, struct qstr *);
|
struct rpc_clnt *nfs4_create_sec_client(struct rpc_clnt *, struct inode *, struct qstr *);
|
||||||
|
|
||||||
/* nfs4proc.c */
|
/* nfs4proc.c */
|
||||||
|
|
|
@ -132,6 +132,35 @@ static size_t nfs_parse_server_name(char *string, size_t len,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
|
||||||
|
{
|
||||||
|
struct gss_api_mech *mech;
|
||||||
|
struct xdr_netobj oid;
|
||||||
|
int i;
|
||||||
|
rpc_authflavor_t pseudoflavor = RPC_AUTH_UNIX;
|
||||||
|
|
||||||
|
for (i = 0; i < flavors->num_flavors; i++) {
|
||||||
|
struct nfs4_secinfo_flavor *flavor;
|
||||||
|
flavor = &flavors->flavors[i];
|
||||||
|
|
||||||
|
if (flavor->flavor == RPC_AUTH_NULL || flavor->flavor == RPC_AUTH_UNIX) {
|
||||||
|
pseudoflavor = flavor->flavor;
|
||||||
|
break;
|
||||||
|
} else if (flavor->flavor == RPC_AUTH_GSS) {
|
||||||
|
oid.len = flavor->gss.sec_oid4.len;
|
||||||
|
oid.data = flavor->gss.sec_oid4.data;
|
||||||
|
mech = gss_mech_get_by_OID(&oid);
|
||||||
|
if (!mech)
|
||||||
|
continue;
|
||||||
|
pseudoflavor = gss_svc_to_pseudoflavor(mech, flavor->gss.service);
|
||||||
|
gss_mech_put(mech);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pseudoflavor;
|
||||||
|
}
|
||||||
|
|
||||||
static rpc_authflavor_t nfs4_negotiate_security(struct inode *inode, struct qstr *name)
|
static rpc_authflavor_t nfs4_negotiate_security(struct inode *inode, struct qstr *name)
|
||||||
{
|
{
|
||||||
struct page *page;
|
struct page *page;
|
||||||
|
|
|
@ -6610,7 +6610,6 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
|
||||||
.close_context = nfs4_close_context,
|
.close_context = nfs4_close_context,
|
||||||
.open_context = nfs4_atomic_open,
|
.open_context = nfs4_atomic_open,
|
||||||
.init_client = nfs4_init_client,
|
.init_client = nfs4_init_client,
|
||||||
.secinfo = nfs4_proc_secinfo,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
|
static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
|
||||||
|
|
|
@ -1397,7 +1397,6 @@ struct nfs_rpc_ops {
|
||||||
struct iattr *iattr);
|
struct iattr *iattr);
|
||||||
int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
|
int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
|
||||||
const char *, rpc_authflavor_t, int);
|
const char *, rpc_authflavor_t, int);
|
||||||
int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue