From: Marco van Wieringen Date: Sun, 5 Jul 2009 13:10:32 +0000 (+0200) Subject: Moved list of supported xattr to start of per OS implementation like in acl.c X-Git-Tag: Release-7.0.0~2650^2~49 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9547ebd148b50b8354d83e302eaeff6c7682d4b5;p=bacula%2Fbacula Moved list of supported xattr to start of per OS implementation like in acl.c --- diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index 1bde9f8a18..23a2926db1 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -126,6 +126,19 @@ static bsub_exit_code send_xattr_stream(JCR *jcr, int stream) #include #endif +/* + * All these os-es have 1 xattr stream. + */ +#if defined(HAVE_DARWIN_OS) +static int os_default_xattr_streams[1] = { STREAM_XATTR_DARWIN }; +#elif defined(HAVE_FREEBSD_OS) +static int os_default_xattr_streams[1] = { STREAM_XATTR_FREEBSD }; +#elif defined(HAVE_LINUX_OS) +static int os_default_xattr_streams[1] = { STREAM_XATTR_LINUX }; +#elif defined(HAVE_NETBSD_OS) +static int os_default_xattr_streams[1] = { STREAM_XATTR_NETBSD }; +#endif + /* * OSX doesn't have llistxattr, lgetxattr and lsetxattr but has * listxattr, getxattr and setxattr with an extra options argument @@ -522,19 +535,6 @@ static bsub_exit_code generic_xattr_parse_streams(JCR *jcr, int stream) static bsub_exit_code (*os_build_xattr_streams)(JCR *jcr, FF_PKT *ff_pkt, int default_stream) = generic_xattr_build_streams; static bsub_exit_code (*os_parse_xattr_streams)(JCR *jcr, int stream) = generic_xattr_parse_streams; -/* - * All these os-es have 1 xattr stream. - */ -#if defined(HAVE_DARWIN_OS) -static int os_default_xattr_streams[1] = { STREAM_XATTR_DARWIN }; -#elif defined(HAVE_FREEBSD_OS) -static int os_default_xattr_streams[1] = { STREAM_XATTR_FREEBSD }; -#elif defined(HAVE_LINUX_OS) -static int os_default_xattr_streams[1] = { STREAM_XATTR_LINUX }; -#elif defined(HAVE_NETBSD_OS) -static int os_default_xattr_streams[1] = { STREAM_XATTR_NETBSD }; -#endif - #elif defined(HAVE_SUN_OS) /* * Solaris extended attributes were introduced in Solaris 9 @@ -631,6 +631,15 @@ static int os_default_xattr_streams[1] = { STREAM_XATTR_NETBSD }; #include #endif +/* + * Number of xattr streams this OS supports and an array with integers with the actual stream numbers. + */ +#if defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED) +static int os_default_xattr_streams[2] = { STREAM_XATTR_SOLARIS, STREAM_XATTR_SOLARIS_SYS}; +#else +static int os_default_xattr_streams[1] = { STREAM_XATTR_SOLARIS }; +#endif /* defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED) */ + /* * This is the count of xattrs saved on a certain file, it gets reset * on each new file processed and is used to see if we need to send @@ -1849,15 +1858,6 @@ static bsub_exit_code solaris_parse_xattr_streams(JCR *jcr, int stream) static bsub_exit_code (*os_build_xattr_streams)(JCR *jcr, FF_PKT *ff_pkt, int default_stream) = solaris_build_xattr_streams; static bsub_exit_code (*os_parse_xattr_streams)(JCR *jcr, int stream) = solaris_parse_xattr_streams; -/* - * Number of xattr streams this OS supports and an array with integers with the actual stream numbers. - */ -#if defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED) -static int os_default_xattr_streams[2] = { STREAM_XATTR_SOLARIS, STREAM_XATTR_SOLARIS_SYS}; -#else -static int os_default_xattr_streams[1] = { STREAM_XATTR_SOLARIS }; -#endif /* defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED) */ - #endif /* defined(HAVE_SUN_OS) */ bsub_exit_code build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)