Skip to content

Commit

Permalink
SUNRPC: add netns refcount tracker to struct rpc_xprt
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 28, 2022
1 parent 9b1831e commit b9a0d6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/linux/sunrpc/xprt.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ struct rpc_xprt {
} stat;

struct net *xprt_net;
netns_tracker ns_tracker;
const char *servername;
const char *address_strings[RPC_DISPLAY_MAX];
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
Expand Down
4 changes: 2 additions & 2 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ EXPORT_SYMBOL_GPL(xprt_alloc);

void xprt_free(struct rpc_xprt *xprt)
{
put_net(xprt->xprt_net);
put_net_track(xprt->xprt_net, &xprt->ns_tracker);
xprt_free_all_slots(xprt);
xprt_free_id(xprt);
rpc_sysfs_xprt_destroy(xprt);
Expand Down Expand Up @@ -2027,7 +2027,7 @@ static void xprt_init(struct rpc_xprt *xprt, struct net *net)

xprt_init_xid(xprt);

xprt->xprt_net = get_net(net);
xprt->xprt_net = get_net_track(net, &xprt->ns_tracker, GFP_KERNEL);
}

/**
Expand Down

0 comments on commit b9a0d6d

Please sign in to comment.