diff options
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/refcount.h')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/refcount.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/refcount.h b/sys/compat/linuxkpi/common/include/linux/refcount.h index 7c055fb32029..61947485945d 100644 --- a/sys/compat/linuxkpi/common/include/linux/refcount.h +++ b/sys/compat/linuxkpi/common/include/linux/refcount.h @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_REFCOUNT_H @@ -79,4 +77,15 @@ refcount_dec_and_lock_irqsave(refcount_t *ref, spinlock_t *lock, return (false); } +/* + * struct kref uses atomic_t and not refcount_t so + * we differ from Linux here. + */ +static inline bool +refcount_dec_and_test(atomic_t *r) +{ + + return (atomic_dec_and_test(r)); +} + #endif /* __LINUXKPI_LINUX_REFCOUNT_H__ */ |