All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsdump: don't assume getdents exists
@ 2013-11-06 21:36 Kyle McMartin
  2013-11-06 22:48 ` Dave Chinner
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kyle McMartin @ 2013-11-06 21:36 UTC (permalink / raw)
  To: sandeen; +Cc: xfs

New Linux ports are using a standard syscall list that does not include
deprecated syscalls where 64-bit clean alternatives exist. As a result,
on arm64, __NR_getdents is undefined, resulting in xfsdump failing to
build.

To avoid that, in the case where __NR_getdents is unset in unistd.h,
avoid building the fallback path entirely, since
__ASSUME_GETDENTS64_SYSCALL will be true, the SYS_getdents64 case will
be the primary (and only) path used.

Signed-off-by: Kyle McMartin <kyle@redhat.com>

--- a/common/getdents.c
+++ b/common/getdents.c
@@ -70,6 +70,9 @@ extern int __have_no_getdents64;
 # ifndef SYS_getdents64
 #  define SYS_getdents64 __NR_getdents64
 # endif
+# ifndef __NR_getdents
+#  define __ONLY_GETDENTS64_SYSCALL     1
+# endif
 #endif
 
 
@@ -207,6 +210,13 @@ getdents_wrap (int fd, char *buf, size_t nbytes)
 # endif
     }
 #endif
+/* Newer Linux ports are not adding deprecated syscalls, so to avoid compile
+ * failures since SYS_getdents will be undefined, we check for that and only
+ * build the fall-back case if SYS_getdents is defined. We know that
+ * __ASSUME_GETDENTS64_SYSCALL is set, since __NR_getdents64 must exist on
+ * those platforms.
+ */
+#ifndef __ONLY_GETDENTS64_SYSCALL
   {
     size_t red_nbytes;
     struct kernel_dirent *skdp, *kdp;
@@ -265,4 +275,5 @@ getdents_wrap (int fd, char *buf, size_t nbytes)
     }
 
   return (char *) dp - buf;
+#endif
 }

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-03-22  8:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-06 21:36 [PATCH] xfsdump: don't assume getdents exists Kyle McMartin
2013-11-06 22:48 ` Dave Chinner
2013-11-06 22:56   ` Kyle McMartin
2013-11-06 23:17     ` Dave Chinner
2013-11-06 23:19       ` Kyle McMartin
2013-11-07  6:58 ` Christoph Hellwig
2013-11-07  7:06   ` Christoph Hellwig
2013-12-10 14:46 ` Eric Sandeen
2013-12-10 19:50   ` Kyle McMartin
2014-03-22  5:12   ` Kyle McMartin
2014-03-22  8:53     ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.