diff --git a/acinclude.m4 b/acinclude.m4 index 27d0c84219..f8c8456dae 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -917,6 +917,12 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) [#include ], [void], [struct inode *inode, void *link_data]) + AC_CHECK_LINUX_OPERATION([inode_operations], [rename], [takes_flags], + [#include ], + [int], + [struct inode *oinode, struct dentry *odentry, + struct inode *ninode, struct dentry *ndentry, + unsigned int flags]) dnl Check for header files AC_CHECK_LINUX_HEADER([config.h]) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index e282ec3a3d..a6fdf4ec85 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1808,7 +1808,11 @@ afs_linux_rmdir(struct inode *dip, struct dentry *dp) static int afs_linux_rename(struct inode *oldip, struct dentry *olddp, - struct inode *newip, struct dentry *newdp) + struct inode *newip, struct dentry *newdp +#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS + , unsigned int flags +#endif + ) { int code; cred_t *credp = crref(); @@ -1816,6 +1820,11 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, const char *newname = newdp->d_name.name; struct dentry *rehash = NULL; +#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS + if (flags) + return -EINVAL; /* no support for new flags yet */ +#endif + /* Prevent any new references during rename operation. */ if (!d_unhashed(newdp)) {