From 8a6d48c0542876eb3acfc0970c0ab7872db08d5f Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sun, 6 Dec 2009 05:26:23 +0100 Subject: check in the original version of dde linux26. --- libdde_linux26/contrib/include/linux/kref.h | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libdde_linux26/contrib/include/linux/kref.h (limited to 'libdde_linux26/contrib/include/linux/kref.h') diff --git a/libdde_linux26/contrib/include/linux/kref.h b/libdde_linux26/contrib/include/linux/kref.h new file mode 100644 index 00000000..0cef6bad --- /dev/null +++ b/libdde_linux26/contrib/include/linux/kref.h @@ -0,0 +1,30 @@ +/* + * kref.c - library routines for handling generic reference counted objects + * + * Copyright (C) 2004 Greg Kroah-Hartman + * Copyright (C) 2004 IBM Corp. + * + * based on kobject.h which was: + * Copyright (C) 2002-2003 Patrick Mochel + * Copyright (C) 2002-2003 Open Source Development Labs + * + * This file is released under the GPLv2. + * + */ + +#ifndef _KREF_H_ +#define _KREF_H_ + +#include +#include + +struct kref { + atomic_t refcount; +}; + +void kref_set(struct kref *kref, int num); +void kref_init(struct kref *kref); +void kref_get(struct kref *kref); +int kref_put(struct kref *kref, void (*release) (struct kref *kref)); + +#endif /* _KREF_H_ */ -- cgit v1.2.3