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

Commit e3bfca01 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by J. Bruce Fields
Browse files

sunrpc: Make xprt auth cache release work with the xprt



This is done in order to facilitate getting the ip_map_cache from
which to put the ip_map.

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent bf18ab32
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -116,6 +116,7 @@ struct auth_ops {
#define	SVC_PENDING	9
#define	SVC_PENDING	9
#define	SVC_COMPLETE	10
#define	SVC_COMPLETE	10


struct svc_xprt;


extern int	svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
extern int	svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
extern int	svc_authorise(struct svc_rqst *rqstp);
extern int	svc_authorise(struct svc_rqst *rqstp);
@@ -131,7 +132,7 @@ extern struct auth_domain *auth_domain_find(char *name);
extern struct auth_domain *auth_unix_lookup(struct in6_addr *addr);
extern struct auth_domain *auth_unix_lookup(struct in6_addr *addr);
extern int auth_unix_forget_old(struct auth_domain *dom);
extern int auth_unix_forget_old(struct auth_domain *dom);
extern void svcauth_unix_purge(void);
extern void svcauth_unix_purge(void);
extern void svcauth_unix_info_release(void *);
extern void svcauth_unix_info_release(struct svc_xprt *xpt);
extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
extern int svcauth_unix_set_client(struct svc_rqst *rqstp);


static inline unsigned long hash_str(char *name, int bits)
static inline unsigned long hash_str(char *name, int bits)
+2 −3
Original line number Original line Diff line number Diff line
@@ -128,9 +128,8 @@ static void svc_xprt_free(struct kref *kref)
	struct svc_xprt *xprt =
	struct svc_xprt *xprt =
		container_of(kref, struct svc_xprt, xpt_ref);
		container_of(kref, struct svc_xprt, xpt_ref);
	struct module *owner = xprt->xpt_class->xcl_owner;
	struct module *owner = xprt->xpt_class->xcl_owner;
	if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags) &&
	if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags))
	    xprt->xpt_auth_cache != NULL)
		svcauth_unix_info_release(xprt);
		svcauth_unix_info_release(xprt->xpt_auth_cache);
	xprt->xpt_ops->xpo_free(xprt);
	xprt->xpt_ops->xpo_free(xprt);
	module_put(owner);
	module_put(owner);
}
}
+6 −3
Original line number Original line Diff line number Diff line
@@ -472,9 +472,12 @@ ip_map_cached_put(struct svc_rqst *rqstp, struct ip_map *ipm)
}
}


void
void
svcauth_unix_info_release(void *info)
svcauth_unix_info_release(struct svc_xprt *xpt)
{
{
	struct ip_map *ipm = info;
	struct ip_map *ipm;

	ipm = xpt->xpt_auth_cache;
	if (ipm != NULL)
		cache_put(&ipm->h, &ip_map_cache);
		cache_put(&ipm->h, &ip_map_cache);
}
}