aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-19 15:31:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-20 16:31:21 -0400
commitf5b0a8743601a4477419171f5046bd07d1c080a0 (patch)
tree92e17ec293c3d0e35a0deda5d3bbf43710fb96ff /include/net
parentf8126f1d5136be1ca1a3536d43ad7a710b5620f8 (diff)
net: Document dst->obsolete better.
Add a big comment explaining how the field works, and use defines instead of magic constants for the values assigned to it. Suggested by Joe Perches. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 51610468c63d..0df661a0c295 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -65,7 +65,19 @@ struct dst_entry {
65 unsigned short pending_confirm; 65 unsigned short pending_confirm;
66 66
67 short error; 67 short error;
68
69 /* A non-zero value of dst->obsolete forces by-hand validation
70 * of the route entry. Positive values are set by the generic
71 * dst layer to indicate that the entry has been forcefully
72 * destroyed.
73 *
74 * Negative values are used by the implementation layer code to
75 * force invocation of the dst_ops->check() method.
76 */
68 short obsolete; 77 short obsolete;
78#define DST_OBSOLETE_NONE 0
79#define DST_OBSOLETE_DEAD 2
80#define DST_OBSOLETE_FORCE_CHK -1
69 unsigned short header_len; /* more space at head required */ 81 unsigned short header_len; /* more space at head required */
70 unsigned short trailer_len; /* space to reserve at tail */ 82 unsigned short trailer_len; /* space to reserve at tail */
71#ifdef CONFIG_IP_ROUTE_CLASSID 83#ifdef CONFIG_IP_ROUTE_CLASSID
@@ -359,7 +371,7 @@ extern struct dst_entry *dst_destroy(struct dst_entry *dst);
359 371
360static inline void dst_free(struct dst_entry *dst) 372static inline void dst_free(struct dst_entry *dst)
361{ 373{
362 if (dst->obsolete > 1) 374 if (dst->obsolete > 0)
363 return; 375 return;
364 if (!atomic_read(&dst->__refcnt)) { 376 if (!atomic_read(&dst->__refcnt)) {
365 dst = dst_destroy(dst); 377 dst = dst_destroy(dst);