Unverified Commit 87155e3f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 1c6d4695 54905e51
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -129,9 +129,6 @@ struct dst_entry *dst_destroy(struct dst_entry * dst)
		child = xdst->child;
	}
#endif
	if (!(dst->flags & DST_NOCOUNT))
		dst_entries_add(dst->ops, -1);

	if (dst->ops->destroy)
		dst->ops->destroy(dst);
	if (dst->dev)
@@ -182,6 +179,12 @@ void dst_dev_put(struct dst_entry *dst)
}
EXPORT_SYMBOL(dst_dev_put);

static void dst_count_dec(struct dst_entry *dst)
{
	if (!(dst->flags & DST_NOCOUNT))
		dst_entries_add(dst->ops, -1);
}

void dst_release(struct dst_entry *dst)
{
	if (dst) {
@@ -191,10 +194,12 @@ void dst_release(struct dst_entry *dst)
		if (unlikely(newrefcnt < 0))
			net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
					     __func__, dst, newrefcnt);
		if (!newrefcnt)
		if (!newrefcnt) {
			dst_count_dec(dst);
			call_rcu(&dst->rcu_head, dst_destroy_rcu);
		}
	}
}
EXPORT_SYMBOL(dst_release);

void dst_release_immediate(struct dst_entry *dst)
@@ -206,10 +211,12 @@ void dst_release_immediate(struct dst_entry *dst)
		if (unlikely(newrefcnt < 0))
			net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
					     __func__, dst, newrefcnt);
		if (!newrefcnt)
		if (!newrefcnt) {
			dst_count_dec(dst);
			dst_destroy(dst);
		}
	}
}
EXPORT_SYMBOL(dst_release_immediate);

u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old)