mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Linux 3.2 compat: set_nlink()
Directly changing inode->i_nlink is deprecated in Linux 3.2 by commit SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170 Use the new set_nlink() kernel function instead. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes: #462
This commit is contained in:
committed by
Brian Behlendorf
parent
e6101ea87f
commit
28eb9213d8
@@ -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 \
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user