Print this page
NEX-13374 NDMP should be able to backup unmounted ZFS filesystems
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-2990 ndmpd dumping core when used with ndmpcopy


  24  *        products derived from this software without specific prior written
  25  *        permission.
  26  *
  27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  30  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  31  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  37  * POSSIBILITY OF SUCH DAMAGE.
  38  */
  39 /*
  40  * This defines structures used to pass information between threads
  41  * for both local-backup and NDMP.
  42  *
  43  */

  44 
  45 #ifndef _TLM_BUFFERS_H_
  46 #define _TLM_BUFFERS_H_
  47 
  48 #include <sys/types.h>
  49 #include <stdlib.h>
  50 #include <limits.h>
  51 #include <sys/stat.h>
  52 #include <thread.h>
  53 #include "tlm.h"
  54 
  55 #ifndef RECORDSIZE
  56 #define RECORDSIZE      512
  57 #endif /* !RECORDSIZE */
  58 
  59 #define DOTDOT_DIR      ".."
  60 #define IS_DOTDOT(s)    (strcmp(s, DOTDOT_DIR) == 0)
  61 #define SLASH   '/'
  62 
  63 #define NDMP_MAX_SELECTIONS     64


 250     char *,
 251     struct stat64 *);
 252 
 253 typedef int (*node_hist_func_t)(lbr_fhlog_call_backs_t *,
 254     char *,
 255     char *,
 256     struct stat64 *,
 257     u_longlong_t);
 258 
 259 lbr_fhlog_call_backs_t *lbrlog_callbacks_init(void *,
 260     path_hist_func_t,
 261     dir_hist_func_t,
 262     node_hist_func_t);
 263 
 264 typedef struct {
 265         tlm_commands_t *ba_commands;
 266         tlm_cmd_t *ba_cmd;
 267         char *ba_job;
 268         char *ba_dir;
 269         char *ba_sels[NDMP_MAX_SELECTIONS];

 270         pthread_barrier_t ba_barrier;
 271 } tlm_backup_restore_arg_t;
 272 
 273 extern void lbrlog_callbacks_done(lbr_fhlog_call_backs_t *);
 274 
 275 extern boolean_t tlm_cat_path(char *, char *, char *);
 276 
 277 extern char *trim_name(char *);
 278 
 279 extern struct full_dir_info *dup_dir_info(struct full_dir_info *);
 280 extern void write_tar_eof(tlm_cmd_t *);
 281 extern int tlm_get_chkpnt_time(char *, int, time_t *, char *);
 282 extern struct full_dir_info *tlm_new_dir_info(fs_fhandle_t *,
 283     char *,
 284     char *);
 285 extern void tlm_release_list(char **);
 286 extern longlong_t tlm_get_data_offset(tlm_cmd_t *);
 287 extern int tlm_tarhdr_size(void);
 288 
 289 #endif  /* _TLM_BUFFERS_H_ */


  24  *        products derived from this software without specific prior written
  25  *        permission.
  26  *
  27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  30  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  31  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  37  * POSSIBILITY OF SUCH DAMAGE.
  38  */
  39 /*
  40  * This defines structures used to pass information between threads
  41  * for both local-backup and NDMP.
  42  *
  43  */
  44 /* Copyright 2017 Nexenta Systems, Inc. All rights reserved. */
  45 
  46 #ifndef _TLM_BUFFERS_H_
  47 #define _TLM_BUFFERS_H_
  48 
  49 #include <sys/types.h>
  50 #include <stdlib.h>
  51 #include <limits.h>
  52 #include <sys/stat.h>
  53 #include <thread.h>
  54 #include "tlm.h"
  55 
  56 #ifndef RECORDSIZE
  57 #define RECORDSIZE      512
  58 #endif /* !RECORDSIZE */
  59 
  60 #define DOTDOT_DIR      ".."
  61 #define IS_DOTDOT(s)    (strcmp(s, DOTDOT_DIR) == 0)
  62 #define SLASH   '/'
  63 
  64 #define NDMP_MAX_SELECTIONS     64


 251     char *,
 252     struct stat64 *);
 253 
 254 typedef int (*node_hist_func_t)(lbr_fhlog_call_backs_t *,
 255     char *,
 256     char *,
 257     struct stat64 *,
 258     u_longlong_t);
 259 
 260 lbr_fhlog_call_backs_t *lbrlog_callbacks_init(void *,
 261     path_hist_func_t,
 262     dir_hist_func_t,
 263     node_hist_func_t);
 264 
 265 typedef struct {
 266         tlm_commands_t *ba_commands;
 267         tlm_cmd_t *ba_cmd;
 268         char *ba_job;
 269         char *ba_dir;
 270         char *ba_sels[NDMP_MAX_SELECTIONS];
 271         int ba_count;
 272         pthread_barrier_t ba_barrier;
 273 } tlm_backup_restore_arg_t;
 274 
 275 extern void lbrlog_callbacks_done(lbr_fhlog_call_backs_t *);
 276 
 277 extern boolean_t tlm_cat_path(char *, char *, char *);
 278 
 279 extern char *trim_name(char *);
 280 
 281 extern struct full_dir_info *dup_dir_info(struct full_dir_info *);
 282 extern void write_tar_eof(tlm_cmd_t *);
 283 extern int tlm_get_chkpnt_time(char *, time_t *);
 284 extern struct full_dir_info *tlm_new_dir_info(fs_fhandle_t *,
 285     char *,
 286     char *);
 287 extern void tlm_release_list(char **);
 288 extern longlong_t tlm_get_data_offset(tlm_cmd_t *);
 289 extern int tlm_tarhdr_size(void);
 290 
 291 #endif  /* _TLM_BUFFERS_H_ */