patch-2.3.6 linux/net/decnet/dn_neigh.c
Next file: linux/net/ethernet/eth.c
Previous file: linux/net/core/rtnetlink.c
Back to the patch index
Back to the overall index
- Lines: 42
- Date:
Wed Jun 9 14:45:36 1999
- Orig file:
v2.3.5/linux/net/decnet/dn_neigh.c
- Orig date:
Mon May 31 22:28:07 1999
diff -u --recursive --new-file v2.3.5/linux/net/decnet/dn_neigh.c linux/net/decnet/dn_neigh.c
@@ -561,12 +561,13 @@
len += sprintf(buffer + len, "Addr Flags State Use Blksize Dev\n");
- neigh_table_lock(&dn_neigh_table);
for(i=0;i <= NEIGH_HASHMASK; i++) {
+ read_lock_bh(&dn_neigh_table.lock);
n = dn_neigh_table.hash_buckets[i];
for(; n != NULL; n = n->next) {
struct dn_neigh *dn = (struct dn_neigh *)n;
+ read_lock(&n->lock);
len += sprintf(buffer+len, "%-7s %s%s%s %02x %02d %07ld %-8s\n",
dn_addr2asc(dn_ntohs(dn_eth2dn(dn->addr)), buf),
(dn->flags&DN_NDFLAG_R1) ? "1" : "-",
@@ -576,6 +577,7 @@
atomic_read(&dn->n.refcnt),
dn->blksize,
(dn->n.dev) ? dn->n.dev->name : "?");
+ read_unlock(&n->lock);
pos = begin + len;
@@ -584,11 +586,15 @@
begin = pos;
}
- if (pos > offset + length)
- break;
+ if (pos > offset + length) {
+ read_unlock_bh(&dn_neigh_table.lock);
+ goto done;
+ }
}
+ read_unlock_bh(&dn_neigh_table.lock);
}
- neigh_table_unlock(&dn_neigh_table);
+
+done:
*start = buffer + (offset - begin);
len -= offset - begin;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)