compat.h 444 B

123456789101112131415161718192021222324
  1. #ifndef _COMPAT_H_
  2. #define _COMPAT_H_
  3. #define btrfs_drop_nlink(inode) drop_nlink(inode)
  4. #define btrfs_inc_nlink(inode) inc_nlink(inode)
  5. #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)
  6. static inline struct dentry *d_obtain_alias(struct inode *inode)
  7. {
  8. struct dentry *d;
  9. if (!inode)
  10. return NULL;
  11. if (IS_ERR(inode))
  12. return ERR_CAST(inode);
  13. d = d_alloc_anon(inode);
  14. if (!d)
  15. iput(inode);
  16. return d;
  17. }
  18. #endif
  19. #endif /* _COMPAT_H_ */