Public Member Functions | Public Attributes

i_FsEvMgr_i Class Reference
[File System Event Manager]

#include <i_fsevmgr_impl.h>

Inheritance diagram for i_FsEvMgr_i:
Inheritance graph
[legend]
Collaboration diagram for i_FsEvMgr_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 i_FsEvMgr_i ()
virtual ~i_FsEvMgr_i ()
void StartDebug (CORBA::Char a_level, const char *a_output, const char *a_flags, CORBA::ULong a_ivdfsFlags)
void StopDebug ()
void SendReply (i_Status_t a_status, const char *a_fileUUID, i_HSM_ptr a_ihsm)
void SetFSList (const i_StringList_t &a_list)
void Mount (const char *a_fileUUID, const char *a_mountPoint)
void Umount (const char *a_fileUUID, const char *a_mountPoint)
void LimitAccess (const char *a_fileUUID)
i_FSInfoList_tGetFSInfoList ()
 i_FsEvMgr_i ()
virtual ~i_FsEvMgr_i ()
void StartDebug (CORBA::Char a_level, const char *a_output, const char *a_flags, CORBA::ULong a_ivdfsFlags)
void StopDebug ()
void SendReply (i_Status_t a_status, const char *a_fileUUID, i_HSM_ptr a_ihsm)
void SetFSList (const i_StringList_t &a_list)
void Mount (const char *a_fileUUID, const char *a_mountPoint)
void Umount (const char *a_fileUUID, const char *a_mountPoint)
void LimitAccess (const char *a_fileUUID)
i_FSInfoList_tGetFSInfoList ()

Public Attributes

 log_CLASSID_m

Detailed Description

Definition at line 48 of file hpux/i_fsevmgr_impl.h.


Constructor & Destructor Documentation

i_FsEvMgr_i::i_FsEvMgr_i (  ) 

Definition at line 53 of file hpux/i_fsevmgr_impl.cpp.

                        {
  // add extra constructor code here
}

i_FsEvMgr_i::~i_FsEvMgr_i (  )  [virtual]

Definition at line 56 of file hpux/i_fsevmgr_impl.cpp.

                         {
// add extra destructor code here
}

i_FsEvMgr_i::i_FsEvMgr_i (  ) 
virtual i_FsEvMgr_i::~i_FsEvMgr_i (  )  [virtual]

Member Function Documentation

i_FSInfoList_t * i_FsEvMgr_i::GetFSInfoList (  ) 

Definition at line 169 of file hpux/i_fsevmgr_impl.cpp.

References log_FUNC_m.

                                           {
    log_FUNC_m(GetFSInfoList);

    i_FSInfoList_t_var fsInfoList = new i_FSInfoList_t();

    fsInfoList->length(0);

    return fsInfoList._retn();
}

i_FSInfoList_t* i_FsEvMgr_i::GetFSInfoList (  ) 
void i_FsEvMgr_i::LimitAccess ( const char *  a_fileUUID  ) 

Definition at line 163 of file hpux/i_fsevmgr_impl.cpp.

References log_FUNC_m.

void i_FsEvMgr_i::LimitAccess ( const char *  a_fileUUID  ) 
void i_FsEvMgr_i::Mount ( const char *  a_fileUUID,
const char *  a_mountPoint 
)
void i_FsEvMgr_i::Mount ( const char *  a_fileUUID,
const char *  a_mountPoint 
)

Definition at line 151 of file hpux/i_fsevmgr_impl.cpp.

References log_FUNC_m.

void i_FsEvMgr_i::SendReply ( i_Status_t  a_status,
const char *  a_fileUUID,
i_HSM_ptr  a_ihsm 
)

Definition at line 95 of file hpux/i_fsevmgr_impl.cpp.

References dbg_LOW, PreMountsMgr::Del(), errno, evt_ERROR, PreMountsMgr::Find(), g_fd, hsm_req_t::hdr, ie_ERRORWRITE, ie_FSE_NO_PREMOUNT, ivd_Error, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), reply_str_t::m_hdr, NULL, size, and hsm_req_hdr_t::status.

                                  {
    log_FUNC_m(SendReply);

    string fileUUID(a_fileUUID);
    hsm_req_t req;
    int size = sizeof(hsm_req_hdr_t);

    try {
        reply_str_t *replStr = g_premountMgr.Find(fileUUID);
        if (replStr == NULL) {
            log_ERR_m("No premount waiting for " << fileUUID
                << ". Probably timed-out.");
            log_WriteEvent(evt_ERROR, "Mount FAILED (request timeout).", 
                           "", 0, fileUUID);
            throw ivd_Error(ie_FSE_NO_PREMOUNT, "");
        }

        req.hdr = replStr->m_hdr;
        req.hdr.status = a_status;

        int ret = write(g_fd, &req, size);
        if (ret < 0 || ret < size) {
            ostringstream sstr;
            sstr << "Mount reply FAILED (" << a_status << ").";
            log_WriteEvent(evt_ERROR, sstr.str(), "", 0, fileUUID);
            log_ERR_m("Sending Reply failed for " << fileUUID
                << " errno: " << errno);
            throw ivd_Error(ie_ERRORWRITE, strerror(errno));
        }
        if (a_status != 0) {
            log_DBG_m(dbg_LOW, "HSM FS can't be mounted: " << fileUUID << 
                               " Status : " << a_status);

            ostringstream sstr;
            sstr << "Mount FAILED (" << a_status << ").";
            log_WriteEvent(evt_ERROR, sstr.str(), "", 0, fileUUID);
        }

        g_premountMgr.Del(fileUUID);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

void i_FsEvMgr_i::SendReply ( i_Status_t  a_status,
const char *  a_fileUUID,
i_HSM_ptr  a_ihsm 
)
void i_FsEvMgr_i::SetFSList ( const i_StringList_t a_list  ) 

Definition at line 139 of file hpux/i_fsevmgr_impl.cpp.

References dbg_NORM, log_DBG_m, and log_FUNC_m.

                                                        {
    log_FUNC_m(SetFSList);

    // just log it to debugs
    for (UInt32_t i=0; i < a_list.length(); ++i) {
        log_DBG_m(dbg_NORM, "HSM FileSystem ID[" << i << "]=" << a_list[i]);
    }

    // NOP on linux.
}

void i_FsEvMgr_i::SetFSList ( const i_StringList_t a_list  ) 
void i_FsEvMgr_i::StartDebug ( CORBA::Char  a_level,
const char *  a_output,
const char *  a_flags,
CORBA::ULong  a_ivdfsFlags 
) [virtual]

Reimplemented from i_Component_i.

void i_FsEvMgr_i::StartDebug ( CORBA::Char  a_level,
const char *  a_output,
const char *  a_flags,
CORBA::ULong  a_ivdfsFlags 
) [virtual]

Reimplemented from i_Component_i.

Definition at line 61 of file hpux/i_fsevmgr_impl.cpp.

References dbg_LOW, errno, g_fd, HSM_IOC_SET_DEBUG, log_DBG_m, and log_FUNC_m.

                             {

    log_FUNC_m(StartDebug);
   
    // call i_Component StartDebug 
    i_Component_i::StartDebug(a_level, a_output, a_flags, a_ivdfsFlags); 

    // set debug in IVDFS    
    log_DBG_m(dbg_LOW, "Set debug in HSMFS to 0x" << hex << a_ivdfsFlags);
    if (ioctl(g_fd, HSM_IOC_SET_DEBUG, &a_ivdfsFlags) < 0) {
        log_DBG_m(dbg_LOW, "ioctl(HSM_IOC_SET_DEBUG) failed: " << errno);
    }
}

void i_FsEvMgr_i::StopDebug (  )  [virtual]

Reimplemented from i_Component_i.

void i_FsEvMgr_i::StopDebug (  )  [virtual]

Reimplemented from i_Component_i.

Definition at line 79 of file hpux/i_fsevmgr_impl.cpp.

References dbg_LOW, errno, g_fd, HSM_IOC_SET_DEBUG, log_DBG_m, log_FUNC_m, and zero.

                            {
    log_FUNC_m(StopDebug);

    UInt32_t zero = 0;

    // set debug in IVDFS    
    log_DBG_m(dbg_LOW, "Set debug in HSMFS to 0 (disable)");
    if (ioctl(g_fd, HSM_IOC_SET_DEBUG, &zero) < 0) {
        log_DBG_m(dbg_LOW, "ioctl(HSM_IOC_SET_DEBUG) failed: " << errno);
    }

    // call i_Component StopDebug 
    i_Component_i::StopDebug(); 
}

void i_FsEvMgr_i::Umount ( const char *  a_fileUUID,
const char *  a_mountPoint 
)
void i_FsEvMgr_i::Umount ( const char *  a_fileUUID,
const char *  a_mountPoint 
)

Definition at line 157 of file hpux/i_fsevmgr_impl.cpp.

References log_FUNC_m.


Member Data Documentation

Reimplemented from i_Component_i.

Definition at line 76 of file hpux/i_fsevmgr_impl.h.


The documentation for this class was generated from the following files: