/** * Get the layout for the file with FID \a fidstr in filesystem \a lustre_dir. * * \param[in] lustre_dir path within Lustre filesystem containing \a fid * \param[in] fid Lustre identifier of file to get layout for * * \retval valid llapi_layout pointer on success * \retval NULL if an error occurs */ struct llapi_layout *llapi_layout_get_by_fid(const char *lustre_dir, const lustre_fid *fid, uint32_t flags) { int fd; int tmp; int saved_msg_level = llapi_msg_get_level(); struct llapi_layout *layout = NULL; /* Prevent llapi internal routines from writing to console * while executing this function, then restore previous message * level. */ llapi_msg_set_level(LLAPI_MSG_OFF); fd = llapi_open_by_fid(lustre_dir, fid, O_RDONLY); llapi_msg_set_level(saved_msg_level); if (fd < 0) return NULL; layout = llapi_layout_get_by_fd(fd, flags); tmp = errno; close(fd); errno = tmp; return layout; }
/** initialize access to lustre */ int Lustre_Init( void ) { #ifdef HAVE_LLAPI_MSG_LEVEL llapi_msg_set_level( LLAPI_MSG_OFF ); /* llapi_msg_set_level( LLAPI_MSG_MAX ); */ #endif return 0; }
/** initialize access to lustre */ int Lustre_Init( void ) { #if HAVE_LLAPI_MSG_LEVEL # if HAVE_LLAPI_LOG_CALLBACKS rbh_adjust_log_level_external(); llapi_error_callback_set(display_llapi_msg); llapi_info_callback_set(display_llapi_msg); # else llapi_msg_set_level(LLAPI_MSG_OFF); # endif #endif return 0; }
void rbh_adjust_log_level_external(void) { #if _LUSTRE && HAVE_LLAPI_LOG_CALLBACKS llapi_msg_set_level(rbh_msg_level_convert(log_config.debug_level)); #endif }