diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/Makefile.in | 1 | ||||
-rw-r--r-- | include/linux/vfs_compat.h | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index 5e04eb4ef..e50b89b9b 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ + $(top_srcdir)/config/kernel-set-nlink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index 825a7fd3b..371bbc1d1 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -94,4 +94,19 @@ bdi_setup_and_register(struct backing_dev_info *bdi,char *name,unsigned int cap) } #endif /* HAVE_BDI && !HAVE_BDI_SETUP_AND_REGISTER */ +/* + * 3.2-rc1 API change, + * Add set_nlink() if it is not exported by the Linux kernel. + * + * i_nlink is read-only in Linux 3.2, but it can be set directly in + * earlier kernels. + */ +#ifndef HAVE_SET_NLINK +static inline void +set_nlink(struct inode *inode, unsigned int nlink) +{ + inode->i_nlink = nlink; +} +#endif /* HAVE_SET_NLINK */ + #endif /* _ZFS_VFS_H */ |