]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/xattr.h
Revert "Warn of Storage Daemon version incompatibility if label fails. Bug #2193"
[bacula/bacula] / bacula / src / filed / xattr.h
index 891c6fb2757b5fd68ef3f31d8e1cfff4dbce7941..62742a82e2137ce89c22029614187f67c8debea3 100644 (file)
@@ -1,33 +1,33 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2004-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2015 Kern Sibbald
+   Copyright (C) 2004-2014 Free Software Foundation Europe e.V.
 
-   The main author of Bacula is Kern Sibbald, with contributions from
-   many others, a complete list can be found in the file AUTHORS.
-   This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation and included
-   in the file LICENSE.
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
 
-   Bacula® is a registered trademark of Kern Sibbald.
-   The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
-   Switzerland, email:ftf@fsfeurope.org.
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
 
-#ifndef _BACULA_XATTR_
-#define _BACULA_XATTR_
+#ifndef BACULA_XATTR_H_
+#define BACULA_XATTR_H_
+
+#if defined(HAVE_LINUX_OS)
+#define BXATTR_ENOTSUP EOPNOTSUPP
+#elif defined(HAVE_DARWIN_OS)
+#define BXATTR_ENOTSUP ENOTSUP
+#elif defined(HAVE_HURD_OS)
+#define BXATTR_ENOTSUP ENOTSUP
+#endif
 
 /*
  * Magic used in the magic field of the xattr struct.
@@ -51,29 +51,27 @@ struct xattr_t {
  */
 struct xattr_link_cache_entry_t {
    uint32_t inum;
-   char target[PATH_MAX];
+   char *target;
 };
 
+#define BXATTR_FLAG_SAVE_NATIVE    0x01
+#define BXATTR_FLAG_RESTORE_NATIVE 0x02
+
 /*
- * Private data structure for threadsafe save of xattrs.
- * For now its mostly for storing the solaris specific private data.
+ * Internal tracking data.
  */
-struct xattr_private_data_t {
-   /*
-    * 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
-    * the hidden xattr dir data. We only send that data when we encounter
-    * an other xattr on the file.
-    */
-   int nr_xattr_saved;
-   char toplevel_hidden_dir_xattr_data[MAXSTRING];
-   int toplevel_hidden_dir_xattr_data_len;
-   alist *xattr_link_cache;
+struct xattr_ctx_t {
+   uint32_t flags;              /* See BXATTR_FLAG_* */
+   uint32_t current_dev;
+   uint32_t nr_errors;
+   uint32_t nr_saved;
+   POOLMEM *content;
+   uint32_t content_length;
+   alist *link_cache;
 };
 
-/*
- * Maximum size of the XATTR stream this prevents us from blowing up the filed.
- */
-#define MAX_XATTR_STREAM  (1 * 1024 * 1024) /* 1 Mb */
+#define MAX_XATTR_LENGTH  (1 * 1024 * 1024) /* 1 Mb */
 
-#endif
+#define XATTR_BUFSIZ    1024
+
+#endif /* BACULA_XATTR_H_ */