Skip to content

Commit 2671bfc

Browse files
Bryan SchumakerTrond Myklebust
authored andcommitted
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>
1 parent df01174 commit 2671bfc

File tree

6 files changed

+30
-34
lines changed

6 files changed

+30
-34
lines changed

fs/nfs/internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ extern void nfs_sb_deactive(struct super_block *sb);
286286
extern char *nfs_path(char **p, struct dentry *dentry,
287287
char *buffer, ssize_t buflen);
288288
extern struct vfsmount *nfs_d_automount(struct path *path);
289-
#ifdef CONFIG_NFS_V4
290-
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
291-
#endif
292289

293290
/* getroot.c */
294291
extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *,

fs/nfs/namespace.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,35 +119,6 @@ char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen)
119119
}
120120

121121
#ifdef CONFIG_NFS_V4
122-
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
123-
{
124-
struct gss_api_mech *mech;
125-
struct xdr_netobj oid;
126-
int i;
127-
rpc_authflavor_t pseudoflavor = RPC_AUTH_UNIX;
128-
129-
for (i = 0; i < flavors->num_flavors; i++) {
130-
struct nfs4_secinfo_flavor *flavor;
131-
flavor = &flavors->flavors[i];
132-
133-
if (flavor->flavor == RPC_AUTH_NULL || flavor->flavor == RPC_AUTH_UNIX) {
134-
pseudoflavor = flavor->flavor;
135-
break;
136-
} else if (flavor->flavor == RPC_AUTH_GSS) {
137-
oid.len = flavor->gss.sec_oid4.len;
138-
oid.data = flavor->gss.sec_oid4.data;
139-
mech = gss_mech_get_by_OID(&oid);
140-
if (!mech)
141-
continue;
142-
pseudoflavor = gss_svc_to_pseudoflavor(mech, flavor->gss.service);
143-
gss_mech_put(mech);
144-
break;
145-
}
146-
}
147-
148-
return pseudoflavor;
149-
}
150-
151122
static struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir,
152123
struct qstr *name,
153124
struct nfs_fh *fh,

fs/nfs/nfs4_fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ extern const struct dentry_operations nfs4_dentry_operations;
206206
extern const struct inode_operations nfs4_dir_inode_operations;
207207

208208
/* nfs4namespace.c */
209+
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
209210
struct rpc_clnt *nfs4_create_sec_client(struct rpc_clnt *, struct inode *, struct qstr *);
210211

211212
/* nfs4proc.c */

fs/nfs/nfs4namespace.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,35 @@ static size_t nfs_parse_server_name(char *string, size_t len,
132132
return ret;
133133
}
134134

135+
rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
136+
{
137+
struct gss_api_mech *mech;
138+
struct xdr_netobj oid;
139+
int i;
140+
rpc_authflavor_t pseudoflavor = RPC_AUTH_UNIX;
141+
142+
for (i = 0; i < flavors->num_flavors; i++) {
143+
struct nfs4_secinfo_flavor *flavor;
144+
flavor = &flavors->flavors[i];
145+
146+
if (flavor->flavor == RPC_AUTH_NULL || flavor->flavor == RPC_AUTH_UNIX) {
147+
pseudoflavor = flavor->flavor;
148+
break;
149+
} else if (flavor->flavor == RPC_AUTH_GSS) {
150+
oid.len = flavor->gss.sec_oid4.len;
151+
oid.data = flavor->gss.sec_oid4.data;
152+
mech = gss_mech_get_by_OID(&oid);
153+
if (!mech)
154+
continue;
155+
pseudoflavor = gss_svc_to_pseudoflavor(mech, flavor->gss.service);
156+
gss_mech_put(mech);
157+
break;
158+
}
159+
}
160+
161+
return pseudoflavor;
162+
}
163+
135164
static rpc_authflavor_t nfs4_negotiate_security(struct inode *inode, struct qstr *name)
136165
{
137166
struct page *page;

fs/nfs/nfs4proc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6610,7 +6610,6 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
66106610
.close_context = nfs4_close_context,
66116611
.open_context = nfs4_atomic_open,
66126612
.init_client = nfs4_init_client,
6613-
.secinfo = nfs4_proc_secinfo,
66146613
};
66156614

66166615
static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {

include/linux/nfs_xdr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,6 @@ struct nfs_rpc_ops {
13971397
struct iattr *iattr);
13981398
int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
13991399
const char *, rpc_authflavor_t, int);
1400-
int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
14011400
};
14021401

14031402
/*

0 commit comments

Comments
 (0)