]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: d_delete now takes a const argument
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 3 Sep 2011 18:10:50 +0000 (14:10 -0400)
committerRuss Allbery <rra@debian.org>
Tue, 29 Nov 2011 01:20:41 +0000 (17:20 -0800)
The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit def00ae8ba774f4d7290c29208484dda756dc0e0)

Change-Id: I128a721587f4963849652cb389472a550d81d267
Reviewed-on: http://gerrit.openafs.org/6097
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 7f55b45ed708204c09b144fd8d1e3b71d08fcb66)

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index db9b0e9fb2575393a76cbcdefb349b133d6bce1c..d9ae5e86901b4941f2cc9c8e8c6e62526681f41c 100644 (file)
@@ -916,6 +916,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_IOP_I_PERMISSION_TAKES_FLAGS
                 LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA
                 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
+                LINUX_DOP_D_DELETE_TAKES_CONST
                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
                 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
                 LINUX_FOP_F_FSYNC_TAKES_DENTRY
index 1c33d2797a6d2f4c9333ee82cdbe2f216a65bea2..78e206158f0d84a5edbd0c1ec156f738d6116f31 100644 (file)
@@ -961,7 +961,11 @@ afs_dentry_iput(struct dentry *dp, struct inode *ip)
 }
 
 static int
+#if defined(DOP_D_DELETE_TAKES_CONST)
+afs_dentry_delete(const struct dentry *dp)
+#else
 afs_dentry_delete(struct dentry *dp)
+#endif
 {
     if (dp->d_inode && (VTOAFS(dp->d_inode)->f.states & CUnlinked))
        return 1;               /* bad inode? */
index 2292f811f76de37a4df012f51a2380ec44ce7263..3d3aa8f4b47fd0b85442d80818c20e285f86a4db 100644 (file)
@@ -604,3 +604,17 @@ AC_DEFUN([LINUX_D_COUNT_IS_INT], [
                        [define if dentry->d_count is an int],
                        [-Werror])
 ])
+
+
+AC_DEFUN([LINUX_DOP_D_DELETE_TAKES_CONST], [
+  AC_CHECK_LINUX_BUILD([whether dentry.d_op->d_delete takes a const argument],
+                       [ac_cv_linux_dop_d_delete_takes_const],
+                       [#include <linux/fs.h>
+                       #include <linux/dcache.h>],
+                       [struct dentry_operations _d_ops;
+                       int _d_del(const struct dentry *de) {return 0;};
+                       _d_ops.d_delete = _d_del;],
+                       [DOP_D_DELETE_TAKES_CONST],
+                       [define if dentry.d_op->d_delete takes a const argument],
+                       [-Werror])
+])