diff options
author | Thomas Graf <tgraf@suug.ch> | 2007-03-22 23:30:55 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:27:33 -0700 |
commit | c702e8047fe74648f7852a9c1de781b0d5a98402 (patch) | |
tree | 24bd031d79f3d1159bc08704a51c84de01d712b0 /net/netlink | |
parent | ead592ba246dfcc643b3f0f0c8c03f7bc898a59f (diff) | |
download | kernel_samsung_tuna-c702e8047fe74648f7852a9c1de781b0d5a98402.zip kernel_samsung_tuna-c702e8047fe74648f7852a9c1de781b0d5a98402.tar.gz kernel_samsung_tuna-c702e8047fe74648f7852a9c1de781b0d5a98402.tar.bz2 |
[NETLINK]: Directly return -EINTR from netlink_dump_start()
Now that all users of netlink_dump_start() use netlink_run_queue()
to process the receive queue, it is possible to return -EINTR from
netlink_dump_start() directly, therefore simplying the callers.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 7 | ||||
-rw-r--r-- | net/netlink/genetlink.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 1823b7c..2cbf168 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1426,7 +1426,12 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, netlink_dump(sk); sock_put(sk); - return 0; + + /* We successfully started a dump, by returning -EINTR we + * signal the queue mangement to interrupt processing of + * any netlink messages so userspace gets a chance to read + * the results. */ + return -EINTR; } void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 1b897bc..fac2e7a 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -323,11 +323,8 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) if (ops->dumpit == NULL) return -EOPNOTSUPP; - err = netlink_dump_start(genl_sock, skb, nlh, - ops->dumpit, ops->done); - if (err == 0) - err = -EINTR; - return err; + return netlink_dump_start(genl_sock, skb, nlh, + ops->dumpit, ops->done); } if (ops->doit == NULL) |