X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flinux%2Flustre_patchless_compat.h;h=d79d1c8c34cfde945ea335b8b1f6337526ece0b4;hp=c91b3dbcca61bea9d955881b24e32388801b77fa;hb=d10c9e05ab593f361fdfd27842766a1924e63e58;hpb=65701b4a30efdb695776bcf690a2b3cabc928da1 diff --git a/lustre/include/linux/lustre_patchless_compat.h b/lustre/include/linux/lustre_patchless_compat.h index c91b3db..d79d1c8 100644 --- a/lustre/include/linux/lustre_patchless_compat.h +++ b/lustre/include/linux/lustre_patchless_compat.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +37,6 @@ #ifndef LUSTRE_PATCHLESS_COMPAT_H #define LUSTRE_PATCHLESS_COMPAT_H -#include #include #ifndef HAVE_TRUNCATE_COMPLETE_PAGE @@ -108,21 +105,12 @@ truncate_complete_page(struct address_space *mapping, struct page *page) } #endif /* !HAVE_TRUNCATE_COMPLETE_PAGE */ -#if !defined(HAVE_D_REHASH_COND) && !defined(HAVE___D_REHASH) -/* megahack */ -static inline void d_rehash_cond(struct dentry * entry, int lock) -{ - if (!lock) - spin_unlock(&dcache_lock); - - d_rehash(entry); - - if (!lock) - spin_lock(&dcache_lock); -} - -#define __d_rehash(dentry, lock) d_rehash_cond(dentry, lock) -#endif /* !HAVE_D_REHASH_COND && !HAVE___D_REHASH*/ +#ifdef HAVE_DCACHE_LOCK +# define dget_dlock(d) dget_locked(d) +# define d_refcount(d) atomic_read(&(d)->d_count) +#else +# define d_refcount(d) ((d)->d_count) +#endif /* HAVE_DCACHE_LOCK */ #ifdef ATTR_OPEN # define ATTR_FROM_OPEN ATTR_OPEN