xfs
[Top] [All Lists]

Re: [PATCH] xfsdump: don't assume getdents exists

To: Kyle McMartin <kyle@xxxxxxxxxx>, sandeen@xxxxxxxxxx
Subject: Re: [PATCH] xfsdump: don't assume getdents exists
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 10 Dec 2013 08:46:08 -0600
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131106213635.GC24712@xxxxxxxxxxxxxxxxxxxxxxx>
References: <20131106213635.GC24712@xxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
On 11/6/13, 3:36 PM, Kyle McMartin wrote:
> 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@xxxxxxxxxx>

Hey Kyle - were you going to do a V2 of this one?

Just checking, thanks - 
-Eric

> --- 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@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
> 

<Prev in Thread] Current Thread [Next in Thread>