hsm_FileHeader Class Reference
[Classes for managing object list]

#include <hsm_FileHeader.h>

Inheritance diagram for hsm_FileHeader:

Inheritance graph
[legend]
Collaboration diagram for hsm_FileHeader:

Collaboration graph
[legend]

List of all members.


Detailed Description

hsm_FileHeader class describe header of file.

This class include Inode class and \ is part of migration class

Author:
Andrej Jamsek, HERMES SoftLab

Definition at line 60 of file client/hsmlist/hsm_FileHeader.h.


Public Member Functions

 hsm_FileHeader (ivd_FileID_t a_fileID, const string &a_name, const string &a_oldName, hsm_FileHeader *a_hsmFHOwner, hsm_FileHeader *a_hsmOldFHOwner, hsm_InoObj *a_inodeObj)
 Constructor to create File header object from event structure, File header object of file owner, File header object of old file owner, and I-node object.
 hsm_FileHeader (hsm_FileHeader *a_hsmFHOwner, hsm_InoObj *a_inodeObj, hdb_String a_fName)
 Constructor to create File header object.
 hsm_FileHeader (ivd_RecordIDX_t a_activeIdx, hdb_Active_t &a_activeRec, bool a_trigMig=false)
 hsm_FileHeader (hsm_RecallInfoGrp *a_pRI)
 Constructor to create File header object for manual recall.
 hsm_FileHeader ()
 Default constructor.
virtual ~hsm_FileHeader ()
 Destructor.
void SetModifyTimeAtMig (ivd_Time_t a_time)
void InitActive (ivd_RecordIDX_t a_activeIdx, hdb_Active_t &a_activeRec, bool a_trigMig=false)
 InitActiv is used only at startup to construct FH method is called by constructor of FH and directly if FH olready exist in cache NOTE only directory type FH can exist in cache.
void InitFromDB ()
 Read fileID2HSMID record and set some members.
void StoreActiveRec (fio_Transaction &a_trans)
void StoreDirTreeRec (fio_Transaction &a_trans)
void StoreNameOwnRec (fio_Transaction &a_trans)
void StoreOldNameOwnRec (fio_Transaction &a_trans)
void RemoveFromRelCandList (fio_Transaction &a_trans)
void RemoveFromActiveList (fio_Transaction &a_trans)
void RemoveNameFromHSMDB (fio_Transaction &a_trans)
ivd_RecordIDX_t GetOwnersNameOwnIdx ()
ivd_RecordIDX_t GetOwnersOldNameOwnIdx ()
ivd_RecordIDX_t GetNameOwnIdx ()
ivd_RecordIDX_t GetOldNameOwnIdx ()
bool operator== (hsm_FileHeader &a_fh)
 compare if two file headers are organicaly same have equal: name, type, inode
UInt64_t GetInode (void) const
 method to return I-node of File Header object
UInt64_t GetOwnerInode (void) const
UInt64_t GetOldOwnerInode (void) const
ivd_FileID_t GetFileID (void) const
ivd_FileID_t GetOwnFileID (void) const
ivd_FileID_t GetOldOwnFileID (void) const
ivd_FileType_e GetFileType (void) const
UInt32_t GetShortInode () const
ivd_RecordIDX_t GetOwnDirTreeIdx ()
ivd_RecordIDX_t GetDirTreeIdx ()
Int32_t GetRecallJobIdx () const
ivd_RecordIDX_t GetActiveIdx ()
void SetActiveIdx (ivd_RecordIDX_t a_activeIdx)
ivd_FileSize_t GetFileSize (void) const
 Method safely return file size from i-node object (if object IS_NULL return 0).
ivd_FileSize_t GetFileSizeForMig () const
string GetFName (void) const
string GetOldFName (void) const
hsm_InoObjGetInoObj (void) const
hsm_FileHeaderGetFOwner (void) const
hsm_FileHeaderGetOldFOwner (void) const
ivd_FileType_e GetfType () const
UInt32_t GetRef (void) const
 be careful of using GetRef, it's not locked and now is use only in cache and JobComplete that are locked or lock fileID
string GetRecallIntoName (void)
ivd_FS_FileGetRecallFile ()
hsm_RecallInfoGrpGetRecallInfoGrp ()
void SetFileSize (ivd_FileSize_t a_fileSize)
 Method set file data size to i-node object (if object is not NULL set the value otherwise do nothing).
void ResetDataInPacker ()
void SetDataInPacker ()
bool IsDataInPacker ()
ivd_Time32_t GetMigAllowedTime ()
void UnSetInodeChgFlag (hsm_ChgFlag_t a_inodeChgFlag)
void SetInodeChgFlag (hsm_ChgFlag_t a_inodeChgFlag)
void CleanChgFlag ()
hsm_ChgFlag_t GetChgFlag (void) const
void UnSetFHChgFlag (hsm_ChgFlag_t a_fhChgFlag)
void SetFHChgFlag (hsm_ChgFlag_t a_fhChgFlag)
bool IsDeleted ()
bool IsDirty ()
hsm_DataMigStat_e GetDataMigStat ()
void SetDataMigStat (hsm_DataMigStat_e a_stat)
void SetFName (string a_fname)
void SetOldFName (string a_oldFName)
void SetOwnFHObj (hsm_FileHeader *a_FHObj)
void SetOldOwnFHObj (hsm_FileHeader *a_FHObj)
void SendReply (UInt16_t a_reply)
cmn_Path MakePath ()
 return full path with name doesn't matter if name is empty
cmn_Path GetFullPath ()
 return empty path if name not exist
cmn_Path GetOldFullPath ()
 return empty path if old name not exist
void IncMemberRef ()
void DecMemberRef ()
void CleanDirListPos ()
void DecInodeRef ()
void IncrRef ()
 method to increment reference to this object to know how many List records are referenced to it
void DecrRef ()
 method to decrement reference to this object.
void Event (fs_api::Event_e a_eventType, fio_Transaction &trans, cmn_Path *movedFrom=NULL)
void NameOwnChgGoToDirty ()
 Remove from HSM in case of syserror see hsm_FHdirty::TaskTime() or hsm_FileHeader::Event() NOTE!!! method doesn't remove FH from permanent release candidate list.
void InodeChgGoToDirty ()
void DirtyToMigCnd ()
void ToMigCand ()
void MigCanToPreJob (Int32_t a_preJobIdx)
void MigPreJobToPM (i_JobRequest_t &migElem)
void FileToSeqElem (i_JobRequest_t &migElem)
void MigrationIsDone ()
 this method is called soon after all data is sent to packer
bool AddToReleaseCanList (fio_Transaction &a_trans)
bool CompleteMigIsDone (bool a_succeed, fio_Transaction &a_trans)
void SendToPM (UInt32_t filesNoFID, UInt32_t preJobIdx)
void SetOffline (bool a_offline)
bool GetOffline (void) const
void NewName (const string &a_name)
void NewOwner (hsm_FileHeader *a_owner_p)
void AddToDirTree ()
 when new directory occure in cache call this method.
void EventOffline (ivd_FS_Event &a_event)
bool EventOffline (UInt32_t a_jobIdx, i_Recall_t &a_recallStr, bool a_migrateAfterRecall)
 Add FH to recall job with index a_jobIdx.
ivd_MigrationID_t GetJobMigID ()
void SetDirTreeIdx (ivd_RecordIDX_t a_dirTreeIdx)
void MakeStat (ivd_FileInfo_t &a_fInfo)
 NOTE MekeStat must be used inside try block and catch for catch(ivd_SysError &ise) exception.
void OpenFile (ivd_FS_File &a_file, const ivd_FS_File::ivd_FS_FileOperation_e a_fileOp)
 NOTE use same try catch algorith for OpenFile method as for MakeStat.
void SetFileID (ivd_FileID_t a_fileId)
 check if inode exist and set its fileID and extend atributes
void UpdateFileID (ivd_FileID_t a_fileId)
 check if inode exist and set its fileID DOESN'T set EA
void Recalled (bool a_succeed)
 this method is called after file is extracted from packer, succeed or not.
UInt64_t TruncateFile ()
 open file truncate it and set EA offline
UInt64_t TruncateFile (ivd_FS_File &a_truncFile)
 just truncate file (used also by failed recall)
void DumpListEl (ostringstream &sstr)
 hsm_FileHeader (Event_t &a_event, hsm_FileHeader *a_hsmFHOwner, hsm_FileHeader *a_hsmOldFHOwner, hsm_InoObj *a_inodeObj)
 hsm_FileHeader (hsm_FileHeader *a_hsmFHOwner, hsm_FileHeader *a_hsmOldFHOwner, hsm_InoObj *a_inodeObj, ivd_FileType_e a_fType, string a_fName, string a_fOldName)
 hsm_FileHeader ()
 Default constructor.
virtual ~hsm_FileHeader ()
UInt64_t GetInode (void) const
hsm_List_e GetList (void) const
 Get list where FH is.
ivd_Time32_t GetListIdx (void) const
 Get index on a list (for Dirty and MigCnd list).
ivd_FileSize_t GetFileSize (void) const
ivd_FileID_t GetFileID (void) const
ivd_RecordIDX_t GetRecIdx (void) const
string GetFName (void) const
string GetOldFName (void) const
hsm_InoObjGetInoObj (void) const
hsm_FileHeaderGetFOwner (void) const
UInt64_t GetFOwnerInode (void) const
hsm_FileHeaderGetOldFOwner (void) const
ivd_Time32_t GetChgTime (void) const
ivd_FileType_e GetfType (void) const
UInt16_t GetChnData (void) const
UInt32_t GetRef (void) const
 Return Reference counter of this FH.
void GetValues (UInt64_t &a_inode, string &a_fName, UInt64_t &a_fOwner) const
void GetJob (UInt32_t &a_jobNumber, UInt32_t &a_jobIdx) const
 Get job and job index.
void SetJob (UInt32_t a_jobNumber, UInt32_t a_jobIdx)
 Set job and job index.
void SetList (hsm_List_e a_fList)
void SetListIdx (ivd_Time32_t a_listIdx)
void SetRecIdx (ivd_RecordIDX_t a_idxFH)
void SetFileSize (ivd_FileSize_t a_fileSize)
void SetFileID (ivd_FileID_t a_fileId)
void SetChnData (UInt16_t a_Data)
void SetFName (string a_fname)
void SetOldFName (string a_oldFName)
void SetOwnFHObj (hsm_FileHeader *a_FHObj)
void SetOldOwnFHObj (hsm_FileHeader *a_FHObj)
cmn_Path MakePath (void)
void MakeStat (ivd_FileInfo_t &a_fInfo)
void UpdateChgTime (ivd_Time32_t a_chgTime)
void IncrRef ()
void DecrRef ()
bool IsEqual (const hsm_FileHeader *a_FileHeader) const

Static Public Member Functions

static void DumpStatus (ostringstream &sstr)

Public Attributes

 log_CLASSID_m
 Macro to add class name member s_className.

Private Member Functions

void DoDecrRef ()
 Decrement reference without locking.
cmn_Path DoMakePath (void)
 Create full path without locking.

Private Attributes

hsm_InoObjm_inodeObj
 Inode object.
hdb_String m_fName
hsm_FileHeaderm_FHOwner
 FH owner.
cmn_oneWRmanyRD m_nameOwnRW_x
hdb_String m_oldFName
hsm_FileHeaderm_oldFHOwner
 Old FH owner.
bool m_firstMigPackDone
 some time in past has been migrated yet this mean that is not compleatly new
bool m_nameOwnerChg
hsm_ChgFlag_t m_fhChgFlag
 what is changed? Create, Delete, nameOwn,
Int32_t m_objRef
 when FH is on job lists then this indeces are used it is possible that FH is in job and dirty list at the same time on dirty because of datachanged and on job because of dependencies of change name or owner -1 mean that is not in job list
Int32_t m_dirMemberRef
 If this FH is directory then m_dirMemberRef hold the number of its members.
ivd_RecordIDX_t m_nameOwnIdx
ivd_RecordIDX_t m_oldNameOwnIdx
ivd_RecordIDX_t m_dirTreeIdx
ivd_RecordIDX_t m_activeIdx
bool m_file2hsmIDset
 set when fil2hsmID relation is written to DB
hsm_DataMigStat_e m_dataMigStat
 if FH is in migration process and event manager can't lock file then set this state to eDoMigStart do migration process will abort migration and repeat it without data migration.
hsm_RecallInfoGrpm_reqHeader_p
 if recall is in progress then this pointer point to request header got from filter
ivd_Time_t m_modifyTimeAtMig
 modify time when migration started it's checked after data is packed and send to filter when CLEAN bit is set.
ivd_FileType_e m_fType
 File type ift_FILE, ift_DIR, ift_SYMLINK.
string m_fName
 File name.
string m_oldFName
 Old file name.
UInt16_t m_Data
 Flag to see what is changed.
ivd_Time32_t m_chgTime
 Last modification time of object.
hsm_List_e m_list
 Flag to know where File Header object is.
ivd_Time32_t m_listIdx
 Index in Dirty list or Migration candidate list.
UInt32_t m_jobNumber
 Job Index.
UInt32_t m_jobIdx
 Job List Index.
UInt32_t m_objRef
 Object reference.
ivd_RecordIDX_t m_idxFH
ivd_FileSize_t m_headerSize
 File Header size.

Static Private Attributes

static cmn_Mutex m_fileH_x

Friends

ostream & operator<< (ostream &a_os, hsm_FileHeader &a_o)

Constructor & Destructor Documentation

hsm_FileHeader::hsm_FileHeader ( ivd_FileID_t  a_fileID,
const string &  a_name,
const string &  a_oldName,
hsm_FileHeader a_hsmFHOwner,
hsm_FileHeader a_hsmOldFHOwner,
hsm_InoObj a_inodeObj 
)

Constructor to create File header object from event structure, File header object of file owner, File header object of old file owner, and I-node object.

Parameters:
a_event event structure
a_hsmFHOwner File header object of file owner
a_hsmOldFHOwner File header object of old file owner (in case of move event)
a_inodeObj I-node object

Definition at line 81 of file hsm_FileHeader.cpp.

References fhObjCount_g, hsm_FileHeader(), IncMemberRef(), InitFromDB(), log_FUNC_m, m_FHOwner, m_oldFHOwner, and NULL.

00087                                :
00088         m_inodeObj(a_inodeObj),
00089         m_fName(a_name),
00090         m_FHOwner(a_hsmFHOwner),
00091         m_oldFName(a_oldName),
00092         m_oldFHOwner(a_hsmOldFHOwner),
00093         m_firstMigPackDone(a_fileID != 0),
00094         m_nameOwnerChg((a_hsmOldFHOwner != NULL) || (a_oldName.length() != 0)),
00095         m_fhChgFlag(CHG_CLEAN_d),
00096         m_objRef(1),
00097         m_dirMemberRef(0),
00098         m_nameOwnIdx(0),
00099         m_oldNameOwnIdx(0),
00100         m_dirTreeIdx(0),
00101         m_activeIdx(0),
00102         m_file2hsmIDset(false),
00103         m_dataMigStat(eNotInDoMig),
00104         m_reqHeader_p(NULL),
00105         m_modifyTimeAtMig(0)
00106 {
00107     log_FUNC_m(hsm_FileHeader(ivd_FS_Event_t));
00108     InitFromDB();
00109     if (m_FHOwner != NULL) {
00110         m_FHOwner->IncMemberRef();
00111     }
00112     if (m_oldFHOwner != NULL) {
00113         m_oldFHOwner->IncMemberRef();
00114     }
00115 
00116     cmn_MutexLock l(fhObjCount_x_g);
00117     fhObjCount_g++;
00118 }
//============================================================================//

Here is the call graph for this function:

hsm_FileHeader::hsm_FileHeader ( hsm_FileHeader a_hsmFHOwner,
hsm_InoObj a_inodeObj,
hdb_String  a_fName 
)

Constructor to create File header object.

Parameters:
a_hsmFHOwner File header object of file owner
a_hsmOldFHOwner File header object of old file owner (in case of move event)
a_inodeObj I-node object
a_fType File type

Definition at line 147 of file hsm_FileHeader.cpp.

References fhObjCount_g, hsm_FileHeader(), IncMemberRef(), InitFromDB(), log_FUNC_m, m_FHOwner, and NULL.

00151         :
00152         m_inodeObj(a_inodeObj),
00153         m_fName(a_fName),
00154         m_FHOwner(a_hsmFHOwner),
00155         m_oldFName(""),
00156         m_oldFHOwner(NULL),
00157         m_firstMigPackDone(false),
00158         m_nameOwnerChg(false),
00159         m_fhChgFlag(CHG_CLEAN_d),
00160         m_objRef(1),
00161         m_dirMemberRef(0),
00162         m_nameOwnIdx(0),
00163         m_oldNameOwnIdx(0),
00164         m_dirTreeIdx(0),
00165         m_activeIdx(0),
00166         m_file2hsmIDset(false),
00167         m_dataMigStat(eNotInDoMig),
00168         m_reqHeader_p(NULL),
00169         m_modifyTimeAtMig(0)
00170 {
00171     log_FUNC_m(hsm_FileHeader(Own, OldOwn, Ino, Type, Name));
00172     InitFromDB();
00173     if (m_FHOwner != NULL) {
00174         m_FHOwner->IncMemberRef();
00175     }
00176     cmn_MutexLock l(fhObjCount_x_g);
00177     fhObjCount_g++;
00178 }
//============================================================================//

Here is the call graph for this function:

hsm_FileHeader::hsm_FileHeader ( ivd_RecordIDX_t  a_activeIdx,
hdb_Active_t a_activeRec,
bool  a_trigMig = false 
)

Definition at line 182 of file hsm_FileHeader.cpp.

References fhObjCount_g, hsm_FileHeader(), InitActive(), InitFromDB(), and log_FUNC_m.

00185         :
00186         m_inodeObj(NULL),
00187 //        m_fName(""),
00188         m_FHOwner(NULL),
00189 //        m_oldFName(""),
00190         m_oldFHOwner(NULL),
00191         m_fhChgFlag(CHG_CLEAN_d),
00192 //        m_firstMigPackDone(true),
00193 //        m_nameOwnerChg(),
00194         m_objRef(1),
00195         m_dirMemberRef(0),
00196         m_nameOwnIdx(a_activeRec.nameOwnIdx),
00197         m_oldNameOwnIdx(a_activeRec.oldNameOwnIdx),
00198         m_dirTreeIdx(0),
00199 // FIX BUG 412 member m_activeIdx not set
00200         m_activeIdx(0),
00201 // end of FIX
00202         m_file2hsmIDset(false),
00203         m_dataMigStat(eNotInDoMig),
00204         m_reqHeader_p(NULL),
00205         m_modifyTimeAtMig(0)
00206 {
00207     log_FUNC_m(hsm_FileHeader(hdb_Active_t));
00208     InitActive(a_activeIdx, a_activeRec, a_trigMig);
00209     InitFromDB();
00210     cmn_MutexLock l(fhObjCount_x_g);
00211     fhObjCount_g++;
00212 }

Here is the call graph for this function:

hsm_FileHeader::hsm_FileHeader ( hsm_RecallInfoGrp a_hsmRI  ) 

Constructor to create File header object for manual recall.

Parameters:
a_IR recall info header object

Definition at line 126 of file hsm_FileHeader.cpp.

References fhObjCount_g, hsm_FileHeader(), and log_FUNC_m.

00128         :
00129         m_inodeObj(NULL),
00130         m_FHOwner(NULL),
00131         m_oldFHOwner(NULL),
00132         m_objRef(0),
00133         m_reqHeader_p(a_hsmRI) {
00134     log_FUNC_m(hsm_FileHeader(hsm_FileHeader));
00135     cmn_MutexLock l(fhObjCount_x_g);
00136     fhObjCount_g++;
00137 }
//============================================================================//

Here is the call graph for this function:

hsm_FileHeader::hsm_FileHeader (  ) 

Default constructor.

Default Constructor.

Definition at line 220 of file hsm_FileHeader.cpp.

References fhObjCount_g, and log_FUNC_m.

Referenced by hsm_FileHeader(), hsmGetDirFH(), and hsmGetFH().

00221         :
00222         m_inodeObj(NULL),
00223         m_fName(""),
00224         m_FHOwner(NULL),
00225         m_oldFName(""),
00226         m_oldFHOwner(NULL),
00227         m_firstMigPackDone(false),
00228         m_nameOwnerChg(false),
00229         m_fhChgFlag(CHG_CLEAN_d),
00230         m_objRef(0),
00231         m_dirMemberRef(0),
00232         m_nameOwnIdx(0),
00233         m_oldNameOwnIdx(0),
00234         m_dirTreeIdx(0),
00235         m_activeIdx(0),
00236         m_file2hsmIDset(false),
00237         m_dataMigStat(eNotInDoMig),
00238         m_reqHeader_p(NULL),
00239         m_modifyTimeAtMig(0)
00240 {
00241    log_FUNC_m(hsm_FileHeader());
00242     cmn_MutexLock l(fhObjCount_x_g);
00243     fhObjCount_g++;
00244 }
//============================================================================//

Here is the caller graph for this function:

hsm_FileHeader::~hsm_FileHeader (  )  [virtual]

Destructor.

Warning:
destructor of File Header object must never be called directly by delete, always by DecrRef method!

Definition at line 252 of file hsm_FileHeader.cpp.

References dbg_DETAIL, DecMemberRef(), hsm_InoObj::DecrRef(), fhObjCount_g, log_DBG_m, log_FUNC_m, m_FHOwner, m_inodeObj, m_oldFHOwner, m_reqHeader_p, and NULL.

00252                                {
00253     log_FUNC_m(~hsm_FileHeader);
00254     if (m_reqHeader_p != NULL) {
00255         delete m_reqHeader_p;
00256          m_reqHeader_p = NULL;
00257     }
00258     if (m_FHOwner != NULL) {
00259         log_DBG_m(dbg_DETAIL, "Dec mem ref of owner.");
00260         m_FHOwner->DecMemberRef();
00261     }
00262     if (m_oldFHOwner != NULL) {
00263         log_DBG_m(dbg_DETAIL, "Dec mem ref of old owner.");
00264         m_oldFHOwner->DecMemberRef();
00265     }
00266     if (m_inodeObj != NULL) {
00267         m_inodeObj->DecrRef();
00268     }
00269     cmn_MutexLock l(fhObjCount_x_g);
00270     fhObjCount_g--;
00271 }

Here is the call graph for this function:

hsm_FileHeader::hsm_FileHeader ( Event_t a_event,
hsm_FileHeader a_hsmFHOwner,
hsm_FileHeader a_hsmOldFHOwner,
hsm_InoObj a_inodeObj 
)

hsm_FileHeader::hsm_FileHeader ( hsm_FileHeader a_hsmFHOwner,
hsm_FileHeader a_hsmOldFHOwner,
hsm_InoObj a_inodeObj,
ivd_FileType_e  a_fType,
string  a_fName,
string  a_fOldName 
)

hsm_FileHeader::hsm_FileHeader (  ) 

Default constructor.

virtual hsm_FileHeader::~hsm_FileHeader (  )  [virtual]


Member Function Documentation

void hsm_FileHeader::DumpStatus ( ostringstream &  sstr  )  [static]

Definition at line 67 of file hsm_FileHeader.cpp.

References fhObjCount_g.

Referenced by i_HSM_i::ShowStatus().

00067                                                    {
00068     sstr << "Number of FH in memory : " << fhObjCount_g << endl;
00069 }

Here is the caller graph for this function:

void hsm_FileHeader::SetModifyTimeAtMig ( ivd_Time_t  a_time  )  [inline]

Definition at line 148 of file client/hsmlist/hsm_FileHeader.h.

References m_modifyTimeAtMig.

Referenced by i_HSM_i::PackFile().

00148 { m_modifyTimeAtMig = a_time;};

Here is the caller graph for this function:

void hsm_FileHeader::InitActive ( ivd_RecordIDX_t  a_activeIdx,
hdb_Active_t a_activeRec,
bool  a_trigMig = false 
)

InitActiv is used only at startup to construct FH method is called by constructor of FH and directly if FH olready exist in cache NOTE only directory type FH can exist in cache.

resolve FH owner using dirNode record got from DB

Definition at line 275 of file hsm_FileHeader.cpp.

References CHG_DELETED_d, hdb_Active_t::chgFlags, ivd_FS_File::Close(), dbg_DETAIL, DecrRef(), ivd_FS_File::e_Cache, fio_Transaction::EndTransaction(), file, hdb_Active_t::fileID, hdb_Active_t::fType, g_fs_api_p, g_hsm_activeList_p, g_hsmDB_p, hdb_Active_t::generalInode, GetFileID(), ivd_FS_File::GetProperties(), ivd_FileSystemAPI::GetRootPath(), fio_DataBase::GetTransObj(), hdbReadNameOwnRec(), hsmGetDirFH(), IncMemberRef(), ivd_NULLCHK_m, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_activeIdx, ivd_FS_FileProperty_t::m_chunkSize, ivd_FS_FileProperty_t::m_dirtyFlag, m_FHOwner, ivd_FS_FileProperty_t::m_fileID, ivd_FS_FileProperty_t::m_fileSize, m_firstMigPackDone, m_fName, ivd_FS_FileProperty_t::m_Inode, m_inodeObj, m_nameOwnerChg, m_nameOwnIdx, ivd_FS_FileProperty_t::m_offlineFlag, m_oldFHOwner, m_oldFName, m_oldNameOwnIdx, ivd_FS_FileProperty_t::m_type, MakePath(), NameOwnChgGoToDirty(), hdb_DirNode_t::nameOwnIdx, NULL, ivd_FS_File::Open(), hsm_ActiveFH::Release(), fio_DataBase::ReleaseTransObj(), s_className, SetDirTreeIdx(), SetFHChgFlag(), SetInodeChgFlag(), fio_Transaction::StartTransaction(), ToMigCand(), UnSetInodeChgFlag(), and hsm_ActiveFH::Update().

Referenced by hsm_ActiveFH::ActiveToList(), and hsm_FileHeader().

00277                                                             {
00278     log_FUNC_m(InitActive);
00279 
00280 
00281     hdb_DirNode_t dir; // default const. it filled with zeroes
00282     ivd_RecordIDX_t dirTreeIdx = 0;
00283     hdbReadNameOwnRec(m_nameOwnIdx, dirTreeIdx, m_fName, dir);
00284 
00285     if (dir.nameOwnIdx != 0) { // file is not on mount point
00287         if (m_FHOwner == NULL) {
00288             m_FHOwner = hsmGetDirFH(dir);
00289             if (m_FHOwner != NULL) {
00290                 m_FHOwner->DecrRef(); // now is used by this FH
00291             }
00292         }
00293         if (m_FHOwner != NULL) {
00294             m_FHOwner->SetDirTreeIdx(dirTreeIdx);
00295             m_FHOwner->IncMemberRef();
00296         }
00297     }
00298 
00299     hdb_DirNode_t oldDir;
00300     ivd_RecordIDX_t oldDirTreeIdx = 0;
00301     hdbReadNameOwnRec(m_oldNameOwnIdx, oldDirTreeIdx, m_oldFName, oldDir);
00302 
00303     if (oldDir.nameOwnIdx != 0) { // file is not on mount point
00304         if (m_oldFHOwner == NULL) {
00305             m_oldFHOwner = hsmGetDirFH(oldDir);
00306             if (m_oldFHOwner != NULL) {
00307                 m_oldFHOwner->DecrRef(); // now is used by this FH
00308             }
00309         }
00310         if (m_oldFHOwner != NULL) {
00311             m_oldFHOwner->SetDirTreeIdx(oldDirTreeIdx);
00312             m_oldFHOwner->IncMemberRef();
00313         }
00314     }
00315 
00316     // if both idx are set then change nameOwner was perform
00317     m_nameOwnerChg  = m_nameOwnIdx != 0 && m_oldNameOwnIdx != 0;
00318 
00319     if (m_inodeObj == NULL) {
00320 
00321         ivd_FS_FileProperty_t fileProp;
00322         ivd_FS_File file(*g_fs_api_p, a_activeRec.generalInode, a_activeRec.fileID);
00323         try {
00324             //HPUX - The file needs to be opened ( to be in the kernel cache )
00325             file.Open(ivd_FS_File::e_Cache, g_fs_api_p->GetRootPath() + MakePath());
00326             file.GetProperties(fileProp);
00327             file.Close();
00328         }
00329         catch (ivd_SysError) {  // can't-
00330             log_DBG_m(dbg_DETAIL, "File is deletted.");
00331 
00332             a_activeRec.chgFlags |= CHG_DELETED_d;
00333 
00334             fileProp.m_type   = a_activeRec.fType;
00335             fileProp.m_Inode  = a_activeRec.generalInode;
00336             fileProp.m_fileID = a_activeRec.fileID;
00337             fileProp.m_chunkSize   = 0;
00338             fileProp.m_fileSize    = 0;
00339             fileProp.m_offlineFlag = false;
00340             fileProp.m_dirtyFlag   = false;
00341         }
00342 
00343         log_DBG_m(dbg_DETAIL, " CREATE InodeObj.");
00344         m_inodeObj = new hsm_InoObj(fileProp, a_activeRec.chgFlags);
00345         ivd_NULLCHK_m(m_inodeObj, hsm_InoObj::s_className);
00346 
00347     }
00348     else {
00349         log_DBG_m(dbg_DETAIL, " UPDATE InodeObj.");
00350         SetInodeChgFlag(a_activeRec.chgFlags);
00351     }
00352     log_DBG_m(dbg_DETAIL, "ActiveRec.chgFlag = " << hex << a_activeRec.chgFlags << dec
00353                        << "  INO " << IVD_PRINT_ID_FS(a_activeRec.generalInode)
00354                        << "  FileID = " << a_activeRec.fileID);
00355 
00356     if (a_activeRec.chgFlags & CHG_DELETED_d) {
00357         UnSetInodeChgFlag(0xFFFF);
00358         SetInodeChgFlag(CHG_DELETED_d);
00359         SetFHChgFlag(CHG_DELETED_d);
00360     }
00361     else {
00362         SetFHChgFlag(a_activeRec.chgFlags);
00363     }
00364     // can't be sure how to set m_firstMigPackDone member, so check with fileID is best
00365     // sometimes will lie that has been sometimes migrated.
00366     // this mean that some events like rename and delete will be
00367     // migratted even is not neccesary
00368     m_firstMigPackDone = GetFileID() != 0;
00369 
00370     if (m_activeIdx != 0) { // remove old before update new
00371         fio_Transaction &trans = *g_hsmDB_p->GetTransObj();
00372         trans.StartTransaction();
00373         // remove old active record
00374         g_hsm_activeList_p->Release(this,trans);
00375         m_activeIdx = a_activeIdx;
00376         // update on last active record if last event not delete
00377         if (!(a_activeRec.chgFlags & CHG_DELETED_d)) {
00378             g_hsm_activeList_p->Update(this,trans);
00379         }
00380         trans.EndTransaction();
00381         g_hsmDB_p->ReleaseTransObj(trans);
00382     }
00383     else {
00384         m_activeIdx = a_activeIdx;
00385     }
00386 
00387     if (a_trigMig) {
00388         ToMigCand();
00389     }
00390     else {
00391         NameOwnChgGoToDirty();
00392     }
00393 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::InitFromDB (  ) 

Read fileID2HSMID record and set some members.

Definition at line 397 of file hsm_FileHeader.cpp.

References hdb_file2hdbID_t::circList, clNoList, hdb_file2hdbID_t::dirTreeIdx, g_File2hdbID_p, GetFileID(), GetfType(), ift_DIR, log_FUNC_m, m_dirTreeIdx, m_file2hsmIDset, m_firstMigPackDone, m_nameOwnIdx, hsm_ListPos::m_relCandCircList, hsm_ListPos::m_relCandIdx, hdb_file2hdbID_t::nameOwnIdx, fio_RelFile::ReadRec(), and hdb_file2hdbID_t::relCandIdx.

Referenced by hsm_FileHeader().

00397                                {
00398     log_FUNC_m(InitFromDB);
00399     ivd_FileID_t fileID =  GetFileID();
00400     if (  fileID != 0 ) {    // try to get m_nameOwnIdx from DB
00401         m_firstMigPackDone = true;
00402         hdb_file2hdbID_t file2hdbID;
00403         g_File2hdbID_p->ReadRec(fileID, &file2hdbID);
00404         if (file2hdbID.circList != clNoList) {
00405             m_nameOwnIdx = file2hdbID.nameOwnIdx;
00406             m_relCandCircList   = file2hdbID.circList;
00407             if (GetfType() == ift_DIR) {
00408                 m_dirTreeIdx = file2hdbID.dirTreeIdx;
00409             }
00410             else {
00411                 m_relCandIdx = file2hdbID.relCandIdx;
00412             }
00413             // files are removed from nameOwner and fil2hsmID tables after truncation,
00414             // but directories are not
00415             if (m_nameOwnIdx > 0) {
00416                 m_file2hsmIDset = true;
00417             }
00418         }
00419         // if got idx from DB then file is in release candidate list
00421     }
00422 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::StoreActiveRec ( fio_Transaction a_trans  ) 

Definition at line 1820 of file hsm_FileHeader.cpp.

References hsm_ActiveFH::Append(), g_hsm_activeList_p, log_FUNC_m, m_activeIdx, and hsm_ActiveFH::MoveToEnd().

Referenced by Event().

01820                                                             {
01821     log_FUNC_m(StoreActiveRec);
01822 
01823     if (m_activeIdx == 0) {
01824         m_activeIdx = g_hsm_activeList_p->Append(this, a_trans);
01825     }
01826     else {
01827         m_activeIdx = g_hsm_activeList_p->MoveToEnd(this, a_trans);
01828     }
01829 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::StoreDirTreeRec ( fio_Transaction a_trans  ) 

Definition at line 1833 of file hsm_FileHeader.cpp.

References fio_Transaction::EndTransaction(), g_DirTree_p, GetFileID(), GetInode(), log_FUNC_m, m_dirTreeIdx, m_nameOwnIdx, fio_Transaction::StartTransaction(), StoreNameOwnRec(), and fio_Vector::Write2DB().

Referenced by IncMemberRef().

01833                                                              {
01834     log_FUNC_m(StoreDirTreeRec);
01835     a_trans.StartTransaction();
01836 
01837     if (m_nameOwnIdx == 0) {
01838         StoreNameOwnRec(a_trans);
01839     }
01840     hdb_DirNode_t dirTree(m_nameOwnIdx, GetFileID(), GetInode());
01841     fio_Vector dirTreeVec(*g_DirTree_p, 1, m_dirTreeIdx, true);
01842     // store it to DB
01843     dirTreeVec.Write2DB( &dirTree, 1, m_dirTreeIdx, a_trans);
01844 
01845     a_trans.EndTransaction();
01846 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::StoreNameOwnRec ( fio_Transaction a_trans  ) 

Definition at line 1850 of file hsm_FileHeader.cpp.

References dbg_DETAIL, hdb_NameOwner_t::dirTreeIdx, fio_Transaction::EndTransaction(), g_NameOwner_p, GetOwnDirTreeIdx(), log_DBG_m, log_FUNC_m, m_fName, m_nameOwnIdx, hdb_NameOwner_t::nameIdx, hdb_NameOwner_t::nameSize, fio_Transaction::StartTransaction(), fio_Vector::Write2DB(), and fio_BasicString::Write2DB().

Referenced by Event(), Recalled(), and StoreDirTreeRec().

01850                                                              {
01851     log_FUNC_m(StoreNameOwnRec);
01852     a_trans.StartTransaction();
01853     // reserve nameOwn record
01854     hdb_NameOwner_t nameOwn;
01855     // store name to DB and set its vector idx and size
01856     m_fName.Write2DB(nameOwn.nameSize, nameOwn.nameIdx, a_trans);
01857     // set DB index of owner,  should be already prepared
01858     nameOwn.dirTreeIdx = GetOwnDirTreeIdx();
01859 //    assert(nameOwn.ownerIdx > 0);
01860     log_DBG_m(dbg_DETAIL, "NameOwnIdx before update DB. " << m_nameOwnIdx
01861                         <<"  DirTreeIdx " << nameOwn.dirTreeIdx
01862                         <<"  name " << m_fName);
01863     // generate vector for nameOwner
01864     fio_Vector nameOwnVec(*g_NameOwner_p, 1, m_nameOwnIdx, true);
01865     // store it to DB
01866     nameOwnVec.Write2DB( &nameOwn, 1, m_nameOwnIdx, a_trans);
01867 
01868     log_DBG_m(dbg_DETAIL, "Name is stored on " << nameOwn.nameIdx
01869                         << "  NameOwnIdx " << m_nameOwnIdx);
01870     a_trans.EndTransaction();
01871 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::StoreOldNameOwnRec ( fio_Transaction a_trans  ) 

Definition at line 1875 of file hsm_FileHeader.cpp.

References dbg_DETAIL, hdb_NameOwner_t::dirTreeIdx, fio_Transaction::EndTransaction(), g_NameOwner_p, GetOwnDirTreeIdx(), log_DBG_m, log_FUNC_m, m_oldFName, m_oldNameOwnIdx, hdb_NameOwner_t::nameIdx, hdb_NameOwner_t::nameSize, fio_Transaction::StartTransaction(), fio_Vector::Write2DB(), and fio_BasicString::Write2DB().

Referenced by Event().

01875                                                                 {
01876     log_FUNC_m(StoreOldNameOwnRec);
01877     a_trans.StartTransaction();
01878     // reserve nameOwn record
01879     hdb_NameOwner_t nameOwn;
01880     // store name to DB and set its vector idx and size
01881     m_oldFName.Write2DB(nameOwn.nameSize, nameOwn.nameIdx, a_trans);
01882     // set DB index of owner,  should be already prepared
01883     nameOwn.dirTreeIdx = GetOwnDirTreeIdx();
01884 //    nameOwn.generalOwnInode = GetOwnerInode();
01885 //    nameOwn.ownerIdx = GetOwnersOldNameOwnIdx();
01886 //    assert(nameOwn.ownerIdx > 0);
01887     log_DBG_m(dbg_DETAIL, "OldNameOwnIdx before update DB. " << m_oldNameOwnIdx
01888                         <<"  DirTreeIdx " << nameOwn.dirTreeIdx
01889                         <<"  name " << m_oldFName);
01890     // generate vector for nameOwner
01891     fio_Vector nameOwnVec(*g_NameOwner_p, 1, m_oldNameOwnIdx, true);
01892     // store it to DB
01893     nameOwnVec.Write2DB( &nameOwn, 1, m_oldNameOwnIdx, a_trans);
01894 
01895     log_DBG_m(dbg_DETAIL, "OldName is stored on " << nameOwn.nameIdx
01896                         << "  oldNameOwnIdx " << m_oldNameOwnIdx);
01897     a_trans.EndTransaction();
01898 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::RemoveFromRelCandList ( fio_Transaction a_trans  ) 

Definition at line 1902 of file hsm_FileHeader.cpp.

References clNoList, g_hsm_relcList_p, log_FUNC_m, hsm_ListPos::m_relCandCircList, hsm_ListPos::m_relCandIdx, and hsm_FHrelc::Release().

Referenced by Event(), EventOffline(), Recalled(), and hsm_FHrelc::Truncate().

01902                                                                    {
01903     log_FUNC_m(RemoveFromRelCandList);
01904     g_hsm_relcList_p->Release(this, a_trans);
01905     m_relCandCircList   = clNoList;
01906     m_relCandIdx = 0;
01907 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::RemoveFromActiveList ( fio_Transaction a_trans  ) 

Definition at line 1911 of file hsm_FileHeader.cpp.

References dbg_DETAIL, g_hsm_activeList_p, g_NameOwner_p, log_DBG_m, log_FUNC_m, m_activeIdx, m_inodeObj, hsm_InoObj::m_lastDataUpdataInDB, m_oldFName, m_oldNameOwnIdx, hsm_ActiveFH::Release(), fio_RelFileTrans::ReleaseVectorIdx(), size, and fio_BasicString::Write2DB().

Referenced by CompleteMigIsDone().

01911                                                                   {
01912     log_FUNC_m(RemoveFromActiveList);
01913     if (m_activeIdx > 0) {
01914         m_inodeObj->m_lastDataUpdataInDB = 0;
01915         g_hsm_activeList_p->Release(this,a_trans);
01916         m_activeIdx = 0;
01917         if (m_oldNameOwnIdx > 0) {
01918             log_DBG_m(dbg_DETAIL, "Release OldNameOwnIdx " << m_oldNameOwnIdx);
01919             // release oldname own
01920             g_NameOwner_p->ReleaseVectorIdx(m_oldNameOwnIdx, 1, &a_trans);
01921             m_oldNameOwnIdx = 0;
01922         }
01923         ivd_RecordIDX_t idx(0);
01924         ivd_VectorSize_t size(0);
01925         m_oldFName.erase();
01926         m_oldFName.Write2DB(size, idx, a_trans);  // release old name
01927     }
01928 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::RemoveNameFromHSMDB ( fio_Transaction a_trans  ) 

Definition at line 1931 of file hsm_FileHeader.cpp.

References dbg_DETAIL, fio_BasicString::Dump(), g_File2hdbID_p, g_NameOwner_p, GetFileID(), log_DBG_m, log_FUNC_m, m_fName, m_nameOwnIdx, NULL, fio_RelFileTrans::ReleaseVectorIdx(), size, and fio_RelFile::WriteRec().

Referenced by CompleteMigIsDone().

01931                                                                  {
01932     log_FUNC_m(RemoveNameFromHSMDB);
01933     // remove it from ivd system
01934     if (m_nameOwnIdx > 0) {
01935         log_DBG_m(dbg_DETAIL, "Release NameOwnIdx " << m_nameOwnIdx);
01936         g_NameOwner_p->ReleaseVectorIdx(m_nameOwnIdx, 1, &a_trans);
01937         m_nameOwnIdx = 0;
01938     }
01939     ivd_RecordIDX_t idx(0);
01940     ivd_VectorSize_t size(0);
01941     m_fName.fio_Vector::Write2DB(NULL, size, idx, a_trans);  // release only vector from DB.
01942     ostringstream sstr;
01943     m_fName.Dump(sstr);
01944     log_DBG_m(dbg_DETAIL, "Release vector of file name: " << sstr.str());
01945     hdb_file2hdbID_t file2hdbID; // default constructor fill it with zerroes
01946     g_File2hdbID_p->WriteRec(GetFileID(), &file2hdbID, 1, &a_trans);
01947 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetOwnersNameOwnIdx (  ) 

Definition at line 1977 of file hsm_FileHeader.cpp.

References GetNameOwnIdx(), log_FUNC_m, m_FHOwner, and NULL.

01977                                                     {
01978     log_FUNC_m(GetOwnersNameOwnIdx);
01979     if (m_FHOwner == NULL) {
01980         return 0;
01981     }
01982     else {
01983         return m_FHOwner->GetNameOwnIdx();
01984     }
01985 }

Here is the call graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetOwnersOldNameOwnIdx (  ) 

Definition at line 1989 of file hsm_FileHeader.cpp.

References GetNameOwnIdx(), log_FUNC_m, m_oldFHOwner, and NULL.

01989                                                        {
01990     log_FUNC_m(GetOwnersOldNameOwnIdx);
01991     if (m_oldFHOwner == NULL) {
01992         return 0;
01993     }
01994     else {
01995         return m_oldFHOwner->GetNameOwnIdx();
01996     }
01997 }

Here is the call graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetNameOwnIdx (  )  [inline]

Definition at line 172 of file client/hsmlist/hsm_FileHeader.h.

References m_nameOwnIdx.

Referenced by hsm_FHrelc::Append(), hsm_ReleaseCandRec::Append(), hsm_ActiveFH::Append(), GetOwnersNameOwnIdx(), GetOwnersOldNameOwnIdx(), and hsm_ActiveFH::Update().

00172 { return m_nameOwnIdx;};

Here is the caller graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetOldNameOwnIdx (  )  [inline]

Definition at line 173 of file client/hsmlist/hsm_FileHeader.h.

References m_oldNameOwnIdx.

Referenced by hsm_ActiveFH::Append(), and hsm_ActiveFH::Update().

00173 { return m_oldNameOwnIdx;};

Here is the caller graph for this function:

bool hsm_FileHeader::operator== ( hsm_FileHeader a_fh  ) 

compare if two file headers are organicaly same have equal: name, type, inode

Definition at line 430 of file hsm_FileHeader.cpp.

References GetfType(), log_FUNC_m, m_fName, and m_inodeObj.

00430                                                      {
00431     log_FUNC_m(operator==hsm_FileHeader);
00432     return   (   m_fName     ==  a_fh.m_fName
00433              &&  GetfType()  ==  a_fh.GetfType()
00434              && *m_inodeObj  == *a_fh.m_inodeObj);
00435 }

Here is the call graph for this function:

UInt64_t hsm_FileHeader::GetInode ( void   )  const

UInt64_t hsm_FileHeader::GetOwnerInode ( void   )  const

Definition at line 480 of file hsm_FileHeader.cpp.

References GetInode(), log_FUNC_m, m_FHOwner, and NULL.

Referenced by NewOwner().

00480                                                    {
00481     log_FUNC_m(GetOwnerInode);
00482     if (m_FHOwner == NULL) {
00483         return 0;
00484     }
00485     else {
00486         return m_FHOwner->GetInode();
00487     }
00488 }

Here is the call graph for this function:

Here is the caller graph for this function:

UInt64_t hsm_FileHeader::GetOldOwnerInode ( void   )  const

Definition at line 492 of file hsm_FileHeader.cpp.

References GetInode(), log_FUNC_m, m_oldFHOwner, and NULL.

Referenced by NewOwner().

00492                                                       {
00493     log_FUNC_m(GetOldOwnerInode);
00494     if (m_oldFHOwner == NULL) {
00495         return 0;
00496     }
00497     else {
00498         return m_oldFHOwner->GetInode();
00499     }
00500 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FileID_t hsm_FileHeader::GetFileID ( void   )  const

ivd_FileID_t hsm_FileHeader::GetOwnFileID ( void   )  const

Definition at line 516 of file hsm_FileHeader.cpp.

References GetFileID(), log_FUNC_m, m_FHOwner, and NULL.

Referenced by i_HSM_i::PackFile().

00516                                                     {
00517     log_FUNC_m(GetOwnFileID);
00518     if (m_FHOwner == NULL) {
00519         return 0;
00520     }
00521     else {
00522         return m_FHOwner->GetFileID();
00523     }
00524 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FileID_t hsm_FileHeader::GetOldOwnFileID ( void   )  const

Definition at line 528 of file hsm_FileHeader.cpp.

References GetFileID(), log_FUNC_m, m_oldFHOwner, and NULL.

Referenced by i_HSM_i::PackFile().

00528                                                        {
00529     log_FUNC_m(GetOldOwnFileID);
00530     if (m_oldFHOwner == NULL) {
00531         return 0;
00532     }
00533     else {
00534         return m_oldFHOwner->GetFileID();
00535     }
00536 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FileType_e hsm_FileHeader::GetFileType ( void   )  const

Definition at line 540 of file hsm_FileHeader.cpp.

References hsm_InoObj::GetfType(), ift_UNKNOWN, log_FUNC_m, m_inodeObj, and NULL.

Referenced by Event(), and hsm_FHmigc::Migrate().

00540                                                      {
00541     log_FUNC_m(GetFileType);
00542     if (m_inodeObj == NULL) {
00543         return ift_UNKNOWN;
00544     }
00545     else {
00546         return m_inodeObj->GetfType();
00547     }
00548 }

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t hsm_FileHeader::GetShortInode (  )  const [inline]

Definition at line 187 of file client/hsmlist/hsm_FileHeader.h.

References hsm_InoObj::GetShortInode(), m_inodeObj, and NULL.

Referenced by hsm_FHcache::Insert(), hsm_FHcache::Remove(), and hsm_FHcache::RemoveLastButOne().

00187                                               {
00188         return  m_inodeObj == NULL
00189                 ? 0
00190                 : m_inodeObj->GetShortInode();
00191     };

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetOwnDirTreeIdx (  ) 

Definition at line 1965 of file hsm_FileHeader.cpp.

References GetDirTreeIdx(), log_FUNC_m, m_FHOwner, and NULL.

Referenced by StoreNameOwnRec(), and StoreOldNameOwnRec().

01965                                                  {
01966     log_FUNC_m(GetOwnDirTreeIdx);
01967     if (m_FHOwner == NULL) {
01968         return 0;
01969     }
01970     else {
01971         return m_FHOwner->GetDirTreeIdx();
01972     }
01973 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetDirTreeIdx (  )  [inline]

Definition at line 194 of file client/hsmlist/hsm_FileHeader.h.

References m_dirTreeIdx.

Referenced by GetOwnDirTreeIdx().

00194 { return m_dirTreeIdx;};

Here is the caller graph for this function:

Int32_t hsm_FileHeader::GetRecallJobIdx (  )  const [inline]

Definition at line 196 of file client/hsmlist/hsm_FileHeader.h.

References hsm_RecallInfoGrp::m_jobIdx, m_reqHeader_p, and NULL.

Referenced by hsm_Recall::ProcRecBSStart(), hsm_Recall::ProcRecEmbData(), and hsm_Recall::ProcRecRawData().

00196                                              {
00197         return   m_reqHeader_p != NULL
00198                  ? m_reqHeader_p->m_jobIdx
00199                  : -1;
00200     };

Here is the caller graph for this function:

ivd_RecordIDX_t hsm_FileHeader::GetActiveIdx (  )  [inline]

Definition at line 203 of file client/hsmlist/hsm_FileHeader.h.

References m_activeIdx.

Referenced by hsm_ActiveFH::Release(), and hsm_ActiveFH::Update().

00203 { return m_activeIdx;};

Here is the caller graph for this function:

void hsm_FileHeader::SetActiveIdx ( ivd_RecordIDX_t  a_activeIdx  )  [inline]

Definition at line 204 of file client/hsmlist/hsm_FileHeader.h.

References m_activeIdx.

00204 {m_activeIdx = a_activeIdx;};

ivd_FileSize_t hsm_FileHeader::GetFileSize ( void   )  const

Method safely return file size from i-node object (if object IS_NULL return 0).

Definition at line 567 of file hsm_FileHeader.cpp.

References dbg_DETAIL, hsm_InoObj::GetFileSize(), log_DBG_m, log_FUNC_m, m_inodeObj, and NULL.

Referenced by AddToReleaseCanList(), hsm_FHrelc::Append(), hsm_ReleaseCandRec::Append(), hsm_ActiveFH::Append(), CompleteMigIsDone(), EventOffline(), Recalled(), hsm_FHrelc::Truncate(), and hsm_ActiveFH::Update().

00567                                                      {
00568     log_FUNC_m(GetFileSize);
00569     if (m_inodeObj != NULL) {
00570         return m_inodeObj->GetFileSize();
00571     }
00572     else {
00573         log_FUNC_m(GetFileSize);
00574         log_DBG_m(dbg_DETAIL, "  GetFileSize FAILED: Inode object IS_NULL");
00575         return 0;
00576     }
00577 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FileSize_t hsm_FileHeader::GetFileSizeForMig ( void   )  const

Definition at line 581 of file hsm_FileHeader.cpp.

References CHG_DATA_d, dbg_DETAIL, hsm_InoObj::GetFileSize(), hsm_InoObj::GetInodeChgFlag(), HSM_FILE_HEADER_SIZE, log_DBG_m, log_FUNC_m, m_inodeObj, and NULL.

Referenced by hsm_FHmigc::Append(), FileToSeqElem(), hsm_FHmigc::Migrate(), and hsm_FHmigc::Remove().

00581                                                            {
00582     log_FUNC_m(GetFileSizeForMig);
00583     if (m_inodeObj != NULL) {
00584         if ((m_inodeObj->GetInodeChgFlag() & CHG_DATA_d) == CHG_DATA_d) {
00585             ivd_FileSize_t tfSize = m_inodeObj->GetFileSize();
00586             if (tfSize == 0) {
00587                 return HSM_FILE_HEADER_SIZE;
00588             }
00589             else {
00590                 return tfSize;
00591             }
00592         }
00593         else {
00594             return HSM_FILE_HEADER_SIZE;
00595         }
00596     }
00597     else{
00598         log_FUNC_m(GetFileSizeForMig);
00599         log_DBG_m(dbg_DETAIL, "  GetFileSizeForMig FAILED: Inode object IS_NULL");
00600         return 0;
00601     }
00602 }

Here is the call graph for this function:

Here is the caller graph for this function:

string hsm_FileHeader::GetFName ( void   )  const [inline]

string hsm_FileHeader::GetOldFName ( void   )  const [inline]

Definition at line 210 of file client/hsmlist/hsm_FileHeader.h.

References m_oldFName.

Referenced by CompleteMigIsDone().

00210 { return m_oldFName  ;};

Here is the caller graph for this function:

hsm_InoObj* hsm_FileHeader::GetInoObj ( void   )  const [inline]

Definition at line 211 of file client/hsmlist/hsm_FileHeader.h.

References m_inodeObj.

00211 { return m_inodeObj  ;};

hsm_FileHeader* hsm_FileHeader::GetFOwner ( void   )  const [inline]

Definition at line 212 of file client/hsmlist/hsm_FileHeader.h.

References m_FHOwner.

Referenced by i_HSM_i::PackFile().

00212 { return m_FHOwner   ;};

Here is the caller graph for this function:

hsm_FileHeader* hsm_FileHeader::GetOldFOwner ( void   )  const [inline]

Definition at line 213 of file client/hsmlist/hsm_FileHeader.h.

References m_oldFHOwner.

00213 { return m_oldFHOwner;};

ivd_FileType_e hsm_FileHeader::GetfType (  )  const [inline]

Definition at line 215 of file client/hsmlist/hsm_FileHeader.h.

References hsm_InoObj::GetfType(), ift_UNKNOWN, m_inodeObj, and NULL.

Referenced by AddToReleaseCanList(), hsm_FHrelc::Append(), hsm_ReleaseCandRec::Append(), hsm_ActiveFH::Append(), CompleteMigIsDone(), DecMemberRef(), Event(), IncMemberRef(), InitFromDB(), MakeStat(), operator==(), ToMigCand(), and hsm_ActiveFH::Update().

00215                                      { return m_inodeObj != NULL
00216                                             ? m_inodeObj->GetfType()
00217                                             : ift_UNKNOWN;
00218     };

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t hsm_FileHeader::GetRef ( void   )  const [inline]

be careful of using GetRef, it's not locked and now is use only in cache and JobComplete that are locked or lock fileID

Definition at line 221 of file client/hsmlist/hsm_FileHeader.h.

References m_dirMemberRef, and m_objRef.

Referenced by hsm_TimedList::Append(), and hsm_FHpVecMgr::RemoveLastButOne().

00221 { return m_objRef + m_dirMemberRef;};

Here is the caller graph for this function:

string hsm_FileHeader::GetRecallIntoName ( void   )  [inline]

Definition at line 223 of file client/hsmlist/hsm_FileHeader.h.

References ivd_FS_File::GetFullPathRef(), hsm_RecallInfoGrp::m_fsFile, m_reqHeader_p, and NULL.

Referenced by i_HSM_i::Recall().

00223                                    {
00224         return m_reqHeader_p != NULL
00225             ? (string)m_reqHeader_p->m_fsFile.GetFullPathRef()
00226             : string();
00227     };

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FS_File* hsm_FileHeader::GetRecallFile (  )  [inline]

Definition at line 229 of file client/hsmlist/hsm_FileHeader.h.

References hsm_RecallInfoGrp::m_fsFile, m_reqHeader_p, and NULL.

00229                                  {
00230         return m_reqHeader_p != NULL
00231             ? &m_reqHeader_p->m_fsFile
00232             : NULL;
00233     };

hsm_RecallInfoGrp* hsm_FileHeader::GetRecallInfoGrp (  )  [inline]

Definition at line 235 of file client/hsmlist/hsm_FileHeader.h.

References m_reqHeader_p.

Referenced by hsm_Recall::IsFileFromDFforRecall().

00235 { return m_reqHeader_p; };

Here is the caller graph for this function:

void hsm_FileHeader::SetFileSize ( ivd_FileSize_t  a_fileSize  ) 

Method set file data size to i-node object (if object is not NULL set the value otherwise do nothing).

Definition at line 609 of file hsm_FileHeader.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_inodeObj, NULL, and hsm_InoObj::SetFileSize().

Referenced by EventOffline(), and ToMigCand().

00609                                                           {
00610     log_FUNC_m(SetFileSize);
00611     if (m_inodeObj != NULL) {
00612         m_inodeObj->SetFileSize(a_fileSize);
00613     }
00614     else {
00615         log_FUNC_m(SetFileSize);
00616         log_DBG_m(dbg_DETAIL, "  SetFileSize FAILED: Inode object IS_NULL");
00617     }
00618 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::ResetDataInPacker (  )  [inline]

Definition at line 239 of file client/hsmlist/hsm_FileHeader.h.

References m_inodeObj, NULL, and hsm_InoObj::ResetDataInPacker().

Referenced by CompleteMigIsDone().

00239 { if (m_inodeObj != NULL) {m_inodeObj->ResetDataInPacker();}};

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::SetDataInPacker (  )  [inline]

Definition at line 241 of file client/hsmlist/hsm_FileHeader.h.

References m_inodeObj, NULL, and hsm_InoObj::SetDataInPacker().

Referenced by i_HSM_i::PackFile().

00241 { if (m_inodeObj != NULL) {m_inodeObj->SetDataInPacker();}};

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::IsDataInPacker (  )  [inline]

Definition at line 243 of file client/hsmlist/hsm_FileHeader.h.

References hsm_InoObj::IsDataInPacker(), m_inodeObj, and NULL.

Referenced by CompleteMigIsDone().

00243                            { return m_inodeObj != NULL
00244                                     ? m_inodeObj->IsDataInPacker()
00245                                     : false;
00246     };

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_Time32_t hsm_FileHeader::GetMigAllowedTime (  )  [inline]

Definition at line 248 of file client/hsmlist/hsm_FileHeader.h.

References hsm_InoObj::GetMigAllowedTime(), m_inodeObj, and NULL.

Referenced by i_HSM_i::PackFile().

00248                                      {return m_inodeObj != NULL
00249                                     ? m_inodeObj->GetMigAllowedTime()
00250                                     : 0;
00251     };

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::UnSetInodeChgFlag ( hsm_ChgFlag_t  a_inodeChgFlag  )  [inline]

Definition at line 253 of file client/hsmlist/hsm_FileHeader.h.

References m_inodeObj, NULL, and hsm_InoObj::UnSetInodeChgFlag().

Referenced by Event(), and InitActive().

00253 { if (m_inodeObj != NULL) {m_inodeObj->UnSetInodeChgFlag(a_inodeChgFlag);}};

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::SetInodeChgFlag ( hsm_ChgFlag_t  a_inodeChgFlag  )  [inline]

Definition at line 254 of file client/hsmlist/hsm_FileHeader.h.

References m_inodeObj, NULL, and hsm_InoObj::SetInodeChgFlag().

Referenced by CompleteMigIsDone(), Event(), and InitActive().

00254 { if (m_inodeObj != NULL) {m_inodeObj->SetInodeChgFlag(a_inodeChgFlag);}};

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::CleanChgFlag (  ) 

Definition at line 655 of file hsm_FileHeader.cpp.

References hsm_InoObj::CleanChgFlag(), log_FUNC_m, m_fhChgFlag, m_inodeObj, m_modifyTimeAtMig, and NULL.

Referenced by CompleteMigIsDone().

00655                                    {
00656     log_FUNC_m(CleanChgFlag);
00657     m_fhChgFlag = 0;
00658     if (m_inodeObj != NULL) {m_inodeObj->CleanChgFlag(m_modifyTimeAtMig);}
00659 }

Here is the call graph for this function:

Here is the caller graph for this function:

hsm_ChgFlag_t hsm_FileHeader::GetChgFlag ( void   )  const

Definition at line 663 of file hsm_FileHeader.cpp.

References hsm_InoObj::GetInodeChgFlag(), log_FUNC_m, m_fhChgFlag, m_inodeObj, and NULL.

Referenced by hsm_ActiveFH::Append(), CompleteMigIsDone(), DumpListEl(), MigrationIsDone(), i_HSM_i::PackFile(), and hsm_ActiveFH::Update().

00663                                                    {
00664     log_FUNC_m(GetChgFlag);
00665     if (m_inodeObj != NULL) {
00666         return m_inodeObj->GetInodeChgFlag() | m_fhChgFlag;
00667     }
00668     else {
00669         return m_fhChgFlag;
00670     }
00671 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::UnSetFHChgFlag ( hsm_ChgFlag_t  a_fhChgFlag  )  [inline]

Definition at line 258 of file client/hsmlist/hsm_FileHeader.h.

References m_fhChgFlag.

00258 { m_fhChgFlag &= ~a_fhChgFlag; };

void hsm_FileHeader::SetFHChgFlag ( hsm_ChgFlag_t  a_fhChgFlag  )  [inline]

Definition at line 259 of file client/hsmlist/hsm_FileHeader.h.

References m_fhChgFlag.

Referenced by Event(), InitActive(), and i_HSM_i::PackFile().

00259 { m_fhChgFlag |= a_fhChgFlag; };

Here is the caller graph for this function:

bool hsm_FileHeader::IsDeleted (  ) 

Definition at line 439 of file hsm_FileHeader.cpp.

References hsm_InoObj::IsDeleted(), log_FUNC_m, m_inodeObj, and NULL.

Referenced by MakeStat(), hsm_FHmigc::Migrate(), hsm_Recall::RecallOfFileCanceled(), and TruncateFile().

00439                                {
00440     log_FUNC_m(IsDeleted);
00441     if (m_inodeObj != NULL) {
00442         return m_inodeObj->IsDeleted();
00443     }
00444     else {
00445         return false; // deleted file must have phantom inode object, so this is not deleted
00446     }
00447 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::IsDirty (  ) 

Definition at line 451 of file hsm_FileHeader.cpp.

References hsm_InoObj::IsDirty(), log_FUNC_m, m_inodeObj, and NULL.

00451                              {
00452     log_FUNC_m(IsDirty);
00453     if (m_inodeObj != NULL) {
00454         return m_inodeObj->IsDirty();
00455     }
00456     else {
00457         return false; // deleted file must have fantom inode object, so this is not deletted
00458     }
00459 }

Here is the call graph for this function:

hsm_DataMigStat_e hsm_FileHeader::GetDataMigStat (  )  [inline]

Definition at line 263 of file client/hsmlist/hsm_FileHeader.h.

References m_dataMigStat.

Referenced by fs_api::FindAndPrepareFH(), and i_HSM_i::PackFile().

00263 {return m_dataMigStat;};

Here is the caller graph for this function:

void hsm_FileHeader::SetDataMigStat ( hsm_DataMigStat_e  a_stat  )  [inline]

Definition at line 264 of file client/hsmlist/hsm_FileHeader.h.

References m_dataMigStat.

Referenced by i_HSM_i::DoMigrationJob(), and fs_api::FindAndPrepareFH().

00264 {m_dataMigStat = a_stat;};

Here is the caller graph for this function:

void hsm_FileHeader::SetFName ( string  a_fname  )  [inline]

Definition at line 266 of file client/hsmlist/hsm_FileHeader.h.

References m_fName.

00266 { m_fName = a_fname;   };

void hsm_FileHeader::SetOldFName ( string  a_oldFName  )  [inline]

Definition at line 267 of file client/hsmlist/hsm_FileHeader.h.

References m_oldFName.

00267 { m_oldFName = a_oldFName;} ;

void hsm_FileHeader::SetOwnFHObj ( hsm_FileHeader a_FHObj  )  [inline]

Definition at line 268 of file client/hsmlist/hsm_FileHeader.h.

References m_FHOwner.

00268 { m_FHOwner    = a_FHObj;   };

void hsm_FileHeader::SetOldOwnFHObj ( hsm_FileHeader a_FHObj  )  [inline]

Definition at line 269 of file client/hsmlist/hsm_FileHeader.h.

References m_oldFHOwner.

00269 { m_oldFHOwner = a_FHObj;   };

void hsm_FileHeader::SendReply ( UInt16_t  a_reply  ) 

Definition at line 1766 of file hsm_FileHeader.cpp.

References log_FUNC_m, hsm_RecallInfoGrp::m_fsFile, m_reqHeader_p, NULL, and ivd_FS_File::ReplySyncEvents().

Referenced by EventOffline(), i_HSM_i::Recall(), Recalled(), and hsm_FHADPRecall::RecallFileFromADP().

01766                                               {
01767     log_FUNC_m(SendReply);
01768     if (m_reqHeader_p != NULL) {
01769         m_reqHeader_p->m_fsFile.ReplySyncEvents(a_reply);
01770         delete m_reqHeader_p;
01771         m_reqHeader_p = NULL;
01772     }
01773 }

Here is the call graph for this function:

Here is the caller graph for this function:

cmn_Path hsm_FileHeader::MakePath (  ) 

cmn_Path hsm_FileHeader::GetFullPath (  ) 

return empty path if name not exist

Definition at line 697 of file hsm_FileHeader.cpp.

References log_FUNC_m, m_fName, and MakePath().

Referenced by fs_api::AddGenericEvent(), fs_api::GetDirFH(), operator<<(), and i_HSM_i::PackFile().

00697                                      {
00698     log_FUNC_m(GetFullPath);
00699     if (  m_fName.length() != 0) {
00700         return MakePath();
00701     }
00702     else {
00703         return cmn_Path("");
00704     }
00705 }

Here is the call graph for this function:

Here is the caller graph for this function:

cmn_Path hsm_FileHeader::GetOldFullPath (  ) 

return empty path if old name not exist

Definition at line 709 of file hsm_FileHeader.cpp.

References log_FUNC_m, m_oldFHOwner, m_oldFName, MakePath(), and NULL.

Referenced by DumpListEl(), Event(), fs_api::EventMove(), FileToSeqElem(), MigCanToPreJob(), MigrationIsDone(), operator<<(), i_HSM_i::PackFile(), and ToMigCand().

00709                                         {
00710     log_FUNC_m(GetOldFullPath);
00711     if (m_oldFName.length() != 0) {
00712         if (m_oldFHOwner != NULL) {
00713             return m_oldFHOwner->MakePath() + m_oldFName;
00714         }
00715         else {
00716             return cmn_Path(m_oldFName);
00717         }
00718     }
00719     else {
00720         return cmn_Path("");
00721     }
00722 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::IncMemberRef (  ) 

Definition at line 1345 of file hsm_FileHeader.cpp.

References dbg_DETAIL, g_hsm_dirWaitList_p, g_hsm_fhLock, g_hsmDB_p, GetfType(), GetInode(), fio_DataBase::GetTransObj(), ift_DIR, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, hsm_ListPos::m_dirListPos, m_dirMemberRef, m_dirTreeIdx, m_objRef, fio_DataBase::ReleaseTransObj(), hsm_TimedList::Remove(), and StoreDirTreeRec().

Referenced by hsm_FileHeader(), InitActive(), and NewOwner().

01345                                    {
01346     log_FUNC_m(IncMemberRef);
01347 
01348     ivd_GenInode_t inode = GetInode();
01349     log_DBG_m(dbg_DETAIL, "INO " << IVD_PRINT_ID_FS(inode)
01350                        << "  objRef " << m_objRef);
01351     g_hsm_fhLock.LockByID(inode);
01352 
01353     m_dirMemberRef++;
01354     log_DBG_m(dbg_DETAIL, " Member reference, INC " << m_dirMemberRef);
01355 
01356     if (m_dirMemberRef == 1) {
01357         if (  GetfType()   == ift_DIR
01358            && m_dirTreeIdx == 0      ) {
01359             fio_Transaction *trans_p = g_hsmDB_p->GetTransObj();
01360             StoreDirTreeRec(*trans_p);
01361             g_hsmDB_p->ReleaseTransObj(&trans_p);
01362         }
01363     }
01364     if (m_dirListPos != hsm_FHtimed_li()) {
01365         g_hsm_dirWaitList_p->Remove(m_dirListPos);
01366         m_dirListPos = hsm_FHtimed_li();
01367     }
01368     g_hsm_fhLock.UnLockByID(inode);
01369 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::DecMemberRef (  ) 

Definition at line 1373 of file hsm_FileHeader.cpp.

References hsm_TimedList::Append(), dbg_DETAIL, dbg_NORM, g_hsm_dirWaitList_p, g_hsm_fhLock, GetfType(), GetInode(), ift_DIR, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, hsm_ListPos::m_dirListPos, m_dirMemberRef, m_objRef, and hsm_TimedList::SpliceToEnd().

Referenced by ~hsm_FileHeader().

01373                                   {
01374     log_FUNC_m(DecMemberRef);
01375     ivd_GenInode_t inode = GetInode();
01376     log_DBG_m(dbg_DETAIL, "INO " << IVD_PRINT_ID_FS(inode)
01377                        << "  objRef " << m_objRef);
01378     g_hsm_fhLock.LockByID(inode);
01379 
01380     m_dirMemberRef--;
01381     log_DBG_m(dbg_DETAIL, " Member reference, DEC " << m_dirMemberRef);
01382 
01383     if (   GetfType()     == ift_DIR
01384         && m_dirMemberRef == 0
01385         && m_objRef       == 1      ) { // only referenced by cache
01386         if (m_dirListPos != hsm_FHtimed_li()) {
01387             log_DBG_m(dbg_NORM, "Dir is splice to end of list." << IVD_PRINT_ID_FS(GetInode()));
01388             g_hsm_dirWaitList_p->SpliceToEnd(m_dirListPos);
01389         }
01390         else {
01391             log_DBG_m(dbg_NORM, "Dir is append to end of list."<< IVD_PRINT_ID_FS(GetInode()));
01392             m_dirListPos = g_hsm_dirWaitList_p->Append(this);
01393         }
01394     }
01395     g_hsm_fhLock.UnLockByID(inode);
01396 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::CleanDirListPos (  )  [inline]

Definition at line 284 of file client/hsmlist/hsm_FileHeader.h.

References hsm_ListPos::m_dirListPos.

Referenced by hsm_DirWaitList::TaskTime().

00284 { m_dirListPos = hsm_FHtimed_li(); };

Here is the caller graph for this function:

void hsm_FileHeader::DecInodeRef (  ) 

Definition at line 1400 of file hsm_FileHeader.cpp.

References hsm_InoObj::DecrRef(), log_FUNC_m, m_inodeObj, and NULL.

01400                                  {
01401     log_FUNC_m(DecInodeRef);
01402     if (m_inodeObj != NULL) {
01403         m_inodeObj->DecrRef();
01404     }
01405 }

Here is the call graph for this function:

void hsm_FileHeader::IncrRef (  ) 

method to increment reference to this object to know how many List records are referenced to it

Definition at line 1412 of file hsm_FileHeader.cpp.

References dbg_DETAIL, GetInode(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, and m_objRef.

Referenced by hsm_TimedList::Append(), hsm_FHmigc::Append(), hsm_FHlist::Append(), hsm_FHADPRecall::Append(), hsm_JobElemVecMgr::Insert(), hsm_FHpVecMgr::Insert(), SetOldOwnFHObj(), and SetOwnFHObj().

01412                             {
01413     log_FUNC_m(IncrRef);
01414     m_objRef++;
01415     log_DBG_m(dbg_DETAIL, "Inc objRef = " << m_objRef << ". INO " << IVD_PRINT_ID_FS(GetInode()));
01416 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::DecrRef (  ) 

method to decrement reference to this object.

This method is used for deleting the object from memory. It should be deleted just in case that no List record is referenced to it.

Definition at line 1424 of file hsm_FileHeader.cpp.

References dbg_DETAIL, dbg_NORM, GetInode(), ie_FATAL_ERROR, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_dirMemberRef, and m_objRef.

Referenced by i_HSM_i::ActivateFiles(), hsm_ActiveFH::ActiveToList(), TreeWalk::CheckDir(), fs_api::DismissFH(), fs_api::EventDelete(), fs_api::EventMove(), fs_api::GetDirFH(), hsmGetDirFH(), hsmGetFH(), InitActive(), hsm_ActiveFH::OrphanedToMigList(), hsm_JobElemVecMgr::ReleaseElementNoLock(), hsm_FHmigc::Remove(), hsm_FHADPRecall::Remove(), i_HSM_i::TrigEfficientRecall(), and hsm_FHrelc::Truncate().

01424                             {
01425     log_FUNC_m(DecrRef);
01426 
01427     if (m_objRef <= 0) {
01428         ostringstream sstr;
01429         sstr << "Cannot dereference FH object. Reference is already 0 INO " << IVD_PRINT_ID_FS(GetInode());
01430         throw ivd_InternalError(ie_FATAL_ERROR, sstr.str(), true);
01431     }
01432     m_objRef--;
01433 
01434     log_DBG_m(dbg_DETAIL, "Dec objRef = " << m_objRef << ". INO " << IVD_PRINT_ID_FS(GetInode()));
01435     if (  m_objRef       == 0
01436        && m_dirMemberRef == 0) {
01437         log_DBG_m(dbg_NORM, "Ref is 0. FH is going to delete." << *this);
01438         delete this;
01439         return;
01440     }
01441 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::Event ( fs_api::Event_e  a_eventType,
fio_Transaction trans,
cmn_Path movedFrom = NULL 
)

Definition at line 727 of file hsm_FileHeader.cpp.

References assert, CHG_ATTR_d, CHG_CREATE_d, CHG_DATA_d, CHG_DELETED_d, CHG_NAMEOWN_d, cmn_Num2Str(), dbg_DETAIL, dbg_NORM, fs_api::eChgAttr, fs_api::eChgData, fs_api::eChgNameOwn, fs_api::eCreate, fs_api::eDelFile, fio_Transaction::EndTransaction(), eNoList, fs_api::eOpen, fs_api::eRelease, g_fsLog, g_hsm_activeList_p, g_hsm_FHCache_p, g_hsm_relcList_p, g_mig, hsm_MigByAPI::GetAPIMode(), GetFileID(), GetFileType(), GetfType(), GetInode(), GetOldFullPath(), ie_ARGUMENT_MISSING, ie_HSM_COLLOCATION, ie_NOTYPE, ift_FILE, InodeChgGoToDirty(), ivd_Error, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_activeIdx, m_firstMigPackDone, m_inodeObj, hsm_InoObj::m_lastDataUpdataInDB, m_list, m_nameOwnIdx, m_objRef, m_oldFHOwner, m_oldFName, hsm_ListPos::m_relCandIdx, MakePath(), NameOwnChgGoToDirty(), NewName(), NewOwner(), NULL, hsm_ActiveFH::Release(), hsm_FHcache::Remove(), hsm_ListPos::RemoveFromList(), RemoveFromRelCandList(), SetFHChgFlag(), SetInodeChgFlag(), hsm_FHrelc::SpaceCheck(), fio_Transaction::StartTransaction(), StoreActiveRec(), StoreNameOwnRec(), StoreOldNameOwnRec(), UnSetInodeChgFlag(), and log_ivdfs::Write().

Referenced by fs_api::AddGenericEvent(), fs_api::EventDelete(), fs_api::EventMove(), fs_api::GetDirFH(), and hsm_FHmigc::SendToPM().

00729                                                 {
00730     log_FUNC_m(Event);
00731     switch (a_eventType) {
00732     case fs_api::eChgData: {
00733         log_DBG_m(dbg_NORM, "Event: ChgData INO " << IVD_PRINT_ID_FS(GetInode()));
00734         // SpaceCheck wakeup release thread if is a sleep
00735         g_hsm_relcList_p->SpaceCheck();
00736 
00737         SetInodeChgFlag(CHG_DATA_d);
00738         InodeChgGoToDirty();
00739 
00740         ivd_Time32_t currentTime(time(NULL));
00741         // update DB every 300 seconds
00742         // prevent large files to be to long on the same position in circular list
00743         if (m_inodeObj->m_lastDataUpdataInDB < currentTime - 300) {
00744             log_DBG_m(dbg_NORM, "Event: ChgData path=" << MakePath());
00745             // m_lastDataUpdataInDB is reset when RemoveFromActiveList() method is called
00746             m_inodeObj->m_lastDataUpdataInDB = currentTime;
00747 
00748             trans.StartTransaction();
00749             if (m_nameOwnIdx == 0) {
00750                 StoreNameOwnRec(trans);
00751             }
00752             StoreActiveRec(trans);
00753             if (m_relCandIdx != 0) {  // remove it form release candidate list
00754                 RemoveFromRelCandList(trans);
00755             }
00756             trans.EndTransaction();
00757         }
00758         }
00759         break;
00760     case fs_api::eCreate: {
00761             log_DBG_m(dbg_NORM, "Event: Create INO " << IVD_PRINT_ID_FS(GetInode())
00762                              << " path=" << MakePath());
00763             if ((g_mig.GetAPIMode()) && (GetFileType() == ift_FILE)) {
00764                 log_DBG_m(dbg_NORM, "Recall only mode: Just log file creation.");
00765                 g_fsLog.Write(GetInode(), GetFileID(), 0, MakePath(), "", CHG_CREATE_d);
00766                 throw ivd_Error(ie_HSM_COLLOCATION, "Skipping Create event");
00767                 break;
00768             }
00769             // SpaceCheck wakeup release thread if is a sleep
00770             g_hsm_relcList_p->SpaceCheck();
00771 
00772             // IMPROVEMENT  almost twice faster
00773             // set as DATA was changed if not size will be 0 and no data mig. occure
00774             // No DB update when data change event come already done.
00775             // fix bug 671
00776             if (GetfType() == ift_FILE) {
00777                 SetFHChgFlag(CHG_CREATE_d | CHG_DATA_d);
00778             }else {
00779                 SetFHChgFlag(CHG_CREATE_d);
00780             }
00781             g_fsLog.Write(GetInode(), GetFileID(), 0, MakePath(), "", CHG_CREATE_d);
00782             // end fix bug
00783             m_inodeObj->m_lastDataUpdataInDB = time(NULL);
00784 
00785             NameOwnChgGoToDirty();
00786             trans.StartTransaction();
00787             StoreNameOwnRec(trans);
00788             StoreActiveRec(trans);
00789             if (m_relCandIdx != 0) {  // remove it form release candidate list
00790                 RemoveFromRelCandList(trans);
00791             }
00792             trans.EndTransaction();
00793         }
00794         break;
00795     case fs_api::eChgNameOwn: {
00796             log_DBG_m(dbg_NORM, "Event: ChgNameOwn INO " << IVD_PRINT_ID_FS(GetInode()));
00797             SetFHChgFlag(CHG_NAMEOWN_d);
00798 
00799             if (movedFrom == NULL) {
00800                 ostringstream sstr;
00801                 sstr << "Old path is expected at ChgNameOwn event. INO " << IVD_PRINT_ID_FS(GetInode());
00802                 throw ivd_InternalError(ie_ARGUMENT_MISSING, sstr.str(), true);
00803             }
00804 
00805             g_fsLog.Write(GetInode(), GetFileID(), 0, MakePath(), *movedFrom, CHG_NAMEOWN_d);
00806 
00807             NameOwnChgGoToDirty();
00808             trans.StartTransaction();
00809             StoreNameOwnRec(trans);
00810             if (   m_oldFName.length() != 0
00811                 || m_oldFHOwner        != 0) {
00812                 StoreOldNameOwnRec(trans);
00813             }
00814             StoreActiveRec(trans);
00815             if (m_relCandIdx != 0) {  // remove it form release candidate list
00816                 RemoveFromRelCandList(trans);
00817             }
00818             trans.EndTransaction();
00819         }
00820         break;
00821     case fs_api::eChgAttr: {
00822             log_DBG_m(dbg_NORM, "Event: ChgAttr INO " << IVD_PRINT_ID_FS(GetInode())
00823                              << " path=" << MakePath());
00824             SetInodeChgFlag(CHG_ATTR_d);
00825             NameOwnChgGoToDirty();
00826             trans.StartTransaction();
00827             if (m_nameOwnIdx == 0) {
00828                 StoreNameOwnRec(trans);
00829             }
00830             StoreActiveRec(trans);
00831             if (m_relCandIdx != 0) {  // remove it form release candidate list
00832                 RemoveFromRelCandList(trans);
00833             }
00834             trans.EndTransaction();
00835         }
00836         break;
00837     case fs_api::eDelFile:
00838         log_DBG_m(dbg_DETAIL, "Event: DelFile INO " << IVD_PRINT_ID_FS(GetInode())
00839                          << " old path=" << GetOldFullPath()
00840                          << *this);
00841             g_fsLog.Write(GetInode(), GetFileID(), 0, "", *movedFrom, CHG_DELETED_d);
00843         if (!m_firstMigPackDone) {
00844             log_DBG_m(dbg_DETAIL, "  File is deleted and will be deleted from Cache too. File ID = 0");
00845 //            RemoveFromHSM();
00846             RemoveFromList(this);
00847 
00848             trans.StartTransaction();
00849             if (m_activeIdx > 0) {
00850                 g_hsm_activeList_p->Release(this,trans);
00851             }
00852             trans.EndTransaction();
00853 
00854             g_hsm_FHCache_p->Remove(this);
00855             return;
00856         }
00857         else {
00859             NewName(string(""));
00860             NewOwner(NULL);
00861             NameOwnChgGoToDirty();
00862             // to be proper removed from previous list specialy migCand
00863             // where size of file need to be substracted
00864             // set only deleted flag all other must be cleaned
00865             UnSetInodeChgFlag(0xFFFF);
00866 
00868             // fix bug 481  deletted files are not migratted.
00869             SetInodeChgFlag(CHG_DELETED_d);
00870             SetFHChgFlag(CHG_DELETED_d);
00871 
00872             trans.StartTransaction();
00873             StoreNameOwnRec(trans);
00874             StoreOldNameOwnRec(trans);
00875             StoreActiveRec(trans);
00876             if (m_relCandIdx != 0) {  // remove it form release candidate list
00877                 RemoveFromRelCandList(trans);
00878             }
00879             trans.EndTransaction();
00880         }
00881         break;
00882     case fs_api::eRelease:
00883         log_DBG_m(dbg_NORM, "Event: Release INO " << IVD_PRINT_ID_FS(GetInode()));
00884         if (m_list == eNoList) { // close file and is on no lists then remove it
00885             // reference must be 1 at this point
00886             assert(m_objRef == 1);
00887             g_hsm_FHCache_p->Remove(this);
00888         }
00889         break;
00890     case fs_api::eOpen:
00891         log_DBG_m(dbg_NORM, "Event: Open INO " << IVD_PRINT_ID_FS(GetInode()));
00892         break;
00893     default :
00894         throw ivd_InternalError(ie_NOTYPE,
00895             "Wrong list type in FH hsm_List_e = " + cmn_Num2Str(m_list) , true);
00896         break;
00897     };
00898 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::NameOwnChgGoToDirty (  ) 

Remove from HSM in case of syserror see hsm_FHdirty::TaskTime() or hsm_FileHeader::Event() NOTE!!! method doesn't remove FH from permanent release candidate list.

void RemoveFromHSM();

Definition at line 918 of file hsm_FileHeader.cpp.

References eNoList, ePreJobList, log_FUNC_m, m_list, and hsm_ListPos::ObjChgGoToDirty().

Referenced by Event(), and InitActive().

00918                                          {
00919     log_FUNC_m(NameOwnChgGoToDirty);
00920 
00921     // If object is not yet on any lists then move it on dirty
00922     // If file is not yet on job list then is not need to move it on the end
00923     // of the dirty list.
00924     if (m_list == eNoList || m_list > ePreJobList) {
00925         ObjChgGoToDirty(this);
00926     }
00927 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::InodeChgGoToDirty (  ) 

Definition at line 931 of file hsm_FileHeader.cpp.

References g_hsm_dirtyList_p, hsm_TimedList::GetLeastWaitTime(), log_FUNC_m, m_inodeObj, hsm_ListPos::ObjChgGoToDirty(), and hsm_InoObj::SetMigAllowedTime().

Referenced by Event().

00931                                        {
00932     log_FUNC_m(InodeChgGoToDirty);
00933 
00934     m_inodeObj->SetMigAllowedTime(g_hsm_dirtyList_p->GetLeastWaitTime());
00935 
00936     ObjChgGoToDirty(this);
00937 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::DirtyToMigCnd (  ) 

Definition at line 941 of file hsm_FileHeader.cpp.

References cmn_Num2Str(), eDirtyList, ie_HSM_INVLIST, log_FUNC_m, m_list, and ToMigCand().

Referenced by hsm_FHdirty::TaskTime().

00941                                    {
00942     log_FUNC_m(DirtyToMigCnd);
00943 
00944     if (m_list == eDirtyList) {
00945         ToMigCand();
00946     }
00947     else {
00948         log_FUNC_m(MoveToMigCnd);
00949         throw ivd_InternalError(ie_HSM_INVLIST,
00950             "FH must be on dirty or noone list. Current list = " + cmn_Num2Str(m_list) , true);
00951     }
00952 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::ToMigCand (  ) 

Definition at line 955 of file hsm_FileHeader.cpp.

References hsm_FHmigc::Append(), CHG_DELETED_d, ivd_FS_File::Close(), dbg_NORM, ivd_FS_File::e_Cache, eMigCndList, file, g_fs_api_p, g_hsm_migcList_p, GetFileID(), hsm_InoObj::GetFileSize(), GetfType(), GetInode(), hsm_InoObj::GetInodeChgFlag(), GetOldFullPath(), ivd_FS_File::GetProperties(), ivd_FileSystemAPI::GetRootPath(), ie_HSM_MULTIPLE_ID, ift_FILE, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, ivd_FS_FileProperty_t::m_fileID, ivd_FS_FileProperty_t::m_fileSize, m_inodeObj, m_list, hsm_ListPos::m_migCanPos, MakePath(), hsm_ListPos::ObjChgGoToDirty(), ivd_FS_File::Open(), hsm_ListPos::RemoveFromList(), SetFileID(), SetFileSize(), and UpdateFileID().

Referenced by CompleteMigIsDone(), DirtyToMigCnd(), InitActive(), and hsm_ActiveFH::OrphanedToMigList().

00955                                {
00956     log_FUNC_m(ToMigCand);
00957 
00958     // Check if file ID changed since event was generated, skip if delete event.
00959     if (!(m_inodeObj->GetInodeChgFlag() & CHG_DELETED_d)) {
00960 
00961         ivd_FS_File file(*g_fs_api_p, GetInode());
00962 
00963         ivd_FS_FileProperty_t fileProp;
00964         try {
00965             //HPUX - The file needs to be opened ( to be in the kernel cache )
00966             file.Open(ivd_FS_File::e_Cache, g_fs_api_p->GetRootPath() + MakePath());
00967             file.GetProperties(fileProp);
00968         }
00969         catch (ivd_SysError &ise) {
00970             log_DBG_m(dbg_NORM,
00971                 "  File is probably delete. Put back in dirty list.");
00972             ObjChgGoToDirty(this);
00973             //HPUX CLose file
00974             file.Close();
00975             return;
00976         }
00977         ivd_FileID_t fid = GetFileID();
00978         if (fid != fileProp.m_fileID) {
00979             ostringstream sstr;
00980             sstr << " INO " << IVD_PRINT_ID_FS(GetInode())
00981                 << " hsm_FileHeader=" << fid
00982                 << " GetProperties=" << fileProp.m_fileID;
00983             if ((fid != 0) && (fileProp.m_fileID != 0)) {
00984                 throw ivd_InternalError(ie_HSM_MULTIPLE_ID, sstr.str(), true);
00985             }
00986             if (fid == 0) {
00987                 log_DBG_m(dbg_NORM, "Update fileID in FH: " << sstr.str());
00988                 UpdateFileID(fileProp.m_fileID);
00989             }
00990             else {
00991                 try {
00992                     log_DBG_m(dbg_NORM, "Update fileID in EA: " << sstr.str());
00993                     SetFileID(fid);
00994                 }
00995                 catch (ivd_SysError &ise) {
00996                     ObjChgGoToDirty(this);
00997                     return;
00998                 }
00999             }
01000         }
01001         if ( GetfType() == ift_FILE ) {
01002             SetFileSize(fileProp.m_fileSize);
01003         }
01004         //HPUX close file
01005         file.Close();
01006     }
01007 
01008 
01009     log_DBG_m(dbg_NORM, "ToMigCnd: INO " << IVD_PRINT_ID_FS(GetInode())
01010         << " size=" << m_inodeObj->GetFileSize()
01011         << " chgFlag=0x" << hex << m_inodeObj->GetInodeChgFlag()
01012             << " path " << MakePath()
01013             << " old path " << GetOldFullPath());
01014     m_migCanPos = g_hsm_migcList_p->Append(this);
01015     RemoveFromList(this); // remove after insert because of reference counter
01016     m_list      = eMigCndList;
01017 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::MigCanToPreJob ( Int32_t  a_preJobIdx  ) 

Definition at line 1021 of file hsm_FileHeader.cpp.

References cmn_Num2Str(), dbg_NORM, eMigCndList, ePreJobList, g_hsm_preJobList_p, hsm_InoObj::GetFileSize(), GetInode(), hsm_InoObj::GetInodeChgFlag(), GetOldFullPath(), ie_HSM_INVLIST, hsm_JobListMgr::Insert(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_inodeObj, hsm_ListPos::m_jobElemIdx, m_jobIdx, m_list, m_nameOwnerChg, MakePath(), and hsm_ListPos::RemoveFromList().

Referenced by hsm_FHmigc::Migrate().

01021                                                     {
01022     log_FUNC_m(MigCanToPreJob);
01023 /*    log_DBG_m(dbg_DETAIL, "Mig2preJob dir entry '" << (m_fName == "" ? m_oldFName : m_fName) <<
01024                           "' with INO " <<
01025                           IVD_PRINT_ID_FS(GetInode()) <<
01026                           " FileID " << GetFileID() << " Type " << GetfType());
01027 */
01028     if (   m_list == eMigCndList) {
01029         log_DBG_m(dbg_NORM, "MigCanToPreJob: INO " << IVD_PRINT_ID_FS(GetInode())
01030             << " size=" << m_inodeObj->GetFileSize()
01031             << " chgFlag=0x" << hex << m_inodeObj->GetInodeChgFlag()
01032             << " path " << MakePath()
01033             << " old path " << GetOldFullPath());
01034 //NEW       || (m_list == ePreJobList && m_reqHeader_p != NULL) { // in case of recall
01035         // do not put in list if is there because of change name/owner and is not jet migrated
01036         if ( !m_nameOwnerChg
01037            || m_jobIdx == -1) { // if job index exist then is already there
01038             m_jobElemIdx = g_hsm_preJobList_p->Insert(a_jobIdx, this);
01039             m_jobIdx     = a_jobIdx;
01040         }
01041         RemoveFromList(this);// remove after insert because of reference counter
01042         m_list = ePreJobList;
01043     }
01044     else {
01045         throw ivd_InternalError(ie_HSM_INVLIST,
01046             "FH must be on mig can list. Current list = " + cmn_Num2Str(m_list) , true);
01047     }
01048 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::MigPreJobToPM ( i_JobRequest_t migElem  ) 

Definition at line 1051 of file hsm_FileHeader.cpp.

References eJobList, FileToSeqElem(), log_FUNC_m, and m_list.

Referenced by hsm_FHmigc::SendToPM().

01051                                                           {
01052     log_FUNC_m(MigPreJobToPM);
01053 
01054     FileToSeqElem(migElem);
01055     m_list = eJobList;
01056 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::FileToSeqElem ( i_JobRequest_t migElem  ) 

Definition at line 1059 of file hsm_FileHeader.cpp.

References dbg_NORM, i_JobRequest_t::fileIdx, i_JobRequest_t::fSize, hsm_InoObj::GetFileSize(), GetFileSizeForMig(), GetInode(), hsm_InoObj::GetInodeChgFlag(), GetOldFullPath(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_inodeObj, hsm_ListPos::m_jobElemIdx, and MakePath().

Referenced by hsm_JobElemVecMgr::JobToSequence(), and MigPreJobToPM().

01059                                                            {
01060     log_FUNC_m(FileToSeqElem);
01061     log_DBG_m(dbg_NORM, "FileToPM: INO " << IVD_PRINT_ID_FS(GetInode())
01062             << " size=" << m_inodeObj->GetFileSize()
01063             << " chgFlag=0x" << hex << m_inodeObj->GetInodeChgFlag()
01064             << " path " << MakePath()
01065             << " old path " << GetOldFullPath());
01066 
01067     migElem.fSize     = GetFileSizeForMig();
01068     migElem.fileIdx   = m_jobElemIdx;
01069 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::MigrationIsDone (  ) 

this method is called soon after all data is sent to packer

Definition at line 1073 of file hsm_FileHeader.cpp.

References CHG_CHGFILE_d, dbg_NORM, fio_Transaction::EndTransaction(), g_fsLog, g_hsm_activeList_p, g_hsmDB_p, GetChgFlag(), GetFileID(), hsm_InoObj::GetFileSize(), GetInode(), GetOldFullPath(), fio_DataBase::GetTransObj(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_firstMigPackDone, m_inodeObj, m_nameOwnerChg, hsm_ListPos::m_packedInDF, MakePath(), fio_DataBase::ReleaseTransObj(), fio_Transaction::StartTransaction(), hsm_ActiveFH::Update(), and log_ivdfs::Write().

Referenced by i_HSM_i::DoMigrationJob().

01073                                      {
01074     log_FUNC_m(MigrationIsDone);
01075     // fix bug 871, do not un set data change bit
01076     // this was done because of hard-links to prevent migration of already migratted file,
01077     // but they are not implemented yet.
01078 //    if (IsDataInPacker()) {
01079 //        UnSetInodeChgFlag(CHG_DATA_d);
01080 //    }
01081     /* Only change file is logged here.
01082        Changes regarding name are logged in fs_api class implemented into hsm_fs_api.ccp file.
01083        Explanation:
01084        Method  MigrationIsDone() could be called more times for same file and same event
01085        In case of rename event we got unconsistent log, because two rename logs will be written.
01086     */
01087 
01088     hsm_ChgFlag_t chgFlags = GetChgFlag();
01089     if (chgFlags & CHG_CHGFILE_d) {
01090        g_fsLog.Write(GetInode(), GetFileID(), 0, MakePath(), GetOldFullPath(), chgFlags & CHG_CHGFILE_d);
01091     }
01092 
01093     // Created files has not set fileID in DB,
01094     // update it now.
01095     if (m_firstMigPackDone) {
01096         log_DBG_m(dbg_NORM, "New file is migrated first time. Update fileID into HSMDB."
01097                          << " INO " << IVD_PRINT_ID_FS(GetInode()));
01098         fio_Transaction &trans = *g_hsmDB_p->GetTransObj();
01099         trans.StartTransaction();
01100         // update on last active record
01101         // It is good to set reserved fileID also in HSMDB
01102         // In case when file is deleted then HSM it knows to which fileID belongs.
01103         g_hsm_activeList_p->Update(this,trans);
01104         trans.EndTransaction();
01105         g_hsmDB_p->ReleaseTransObj(trans);
01106     }
01107 
01108     m_nameOwnerChg     = false;
01109     m_firstMigPackDone = true;
01110     m_packedInDF       = true;
01111     log_DBG_m(dbg_NORM, "MigrationIsDone: INO " << IVD_PRINT_ID_FS(GetInode())
01112             << ", size=" << m_inodeObj->GetFileSize()
01113             << ", chgFlag=0x" << hex << chgFlags
01114             << ", path " << MakePath()
01115             << ", old path " << GetOldFullPath());
01116 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::AddToReleaseCanList ( fio_Transaction a_trans  ) 

Definition at line 1121 of file hsm_FileHeader.cpp.

References hsm_FHrelc::Append(), dbg_DETAIL, dbg_NORM, fio_Transaction::EndTransaction(), g_hsm_relcList_p, GetFileID(), GetFileSize(), GetFName(), GetfType(), hsm_CheckFile2hsmdbRec(), ift_FILE, log_DBG_m, log_FUNC_m, hsm_ListPos::m_relCandCircList, hsm_ListPos::m_relCandIdx, and fio_Transaction::StartTransaction().

Referenced by i_HSM_i::ActivateFiles().

01121                                                                  {
01122     log_FUNC_m(AddToReleaseCanList);
01123 
01124     if (GetfType() != ift_FILE) {
01125         //only files can be released
01126         return false;
01127     }
01128 
01129     if (GetFileSize() >  0) {
01130         log_DBG_m(dbg_NORM, "File  size > 0");
01131 
01132         if (m_relCandIdx == 0) {
01133             if (!hsm_CheckFile2hsmdbRec(GetFileID(), this)) {
01134                 // file is not added if it is already on file2hdbID.
01135                 a_trans.StartTransaction();
01136                 g_hsm_relcList_p->Append( this,
01137                                           true,
01138                                           a_trans);
01139                 a_trans.EndTransaction();
01140 
01141             }
01142         }
01143         else {
01144             log_DBG_m(dbg_NORM, "File '" << GetFName()
01145                     << "' is already on truc list " << m_relCandCircList
01146                     << "  idx " << m_relCandIdx);
01147         }
01148 
01149         log_DBG_m(dbg_DETAIL, "File '" << GetFName()
01150                 << "' was added to release list. "
01151                 << "  Size  " << GetFileSize()
01152                 << "  Type " << GetfType());
01153     }
01154 
01155     return true;
01156 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::CompleteMigIsDone ( bool  a_succeed,
fio_Transaction a_trans 
)

Definition at line 1161 of file hsm_FileHeader.cpp.

References hsm_FHrelc::Append(), CHG_DATA_d, CHG_DELETED_d, CleanChgFlag(), ivd_FS_File::Close(), dbg_DETAIL, dbg_LOW, dbg_NORM, ivd_FS_File::e_Cache, fio_Transaction::EndTransaction(), eNoList, file, g_File2hdbID_p, g_fs_api_p, g_hsm_FHCache_p, g_hsm_preJobList_p, g_hsm_relcList_p, GetChgFlag(), GetFileID(), GetFileSize(), hsm_InoObj::GetFileSize(), GetFName(), GetfType(), GetInode(), hsm_InoObj::GetInodeChgFlag(), GetOldFName(), ivd_FileSystemAPI::GetRootPath(), hsm_CheckFile2hsmdbRec(), ift_DIR, ift_FILE, IsDataInPacker(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_dirTreeIdx, m_file2hsmIDset, m_inodeObj, hsm_ListPos::m_jobElemIdx, m_jobIdx, m_list, m_nameOwnIdx, hsm_ListPos::m_relCandCircList, hsm_ListPos::m_relCandIdx, MakePath(), hsm_ListPos::ObjChgGoToDirty(), ivd_FS_File::Open(), hsm_JobListMgr::ReleaseElement(), RemoveFromActiveList(), hsm_FHcache::RemoveLastButOne(), RemoveNameFromHSMDB(), ResetDataInPacker(), SetInodeChgFlag(), fio_Transaction::StartTransaction(), ToMigCand(), and fio_RelFile::WriteRec().

Referenced by i_HSM_i::CompleteMigration().

01161                                                                                {
01162     log_FUNC_m(CompleteMigIsDone);
01163 
01164 
01166     if (!a_succeed) {
01167         // prepare object to repeat migration
01168         if (IsDataInPacker()) {
01169             SetInodeChgFlag(CHG_DATA_d); // data is still changed
01170             ResetDataInPacker(); // data is no more in packer
01171         }
01172         return false; // file was not migrated
01173     }
01174     else {
01175         UInt16_t tchgData = GetChgFlag();
01176 
01177         log_DBG_m(dbg_NORM, "CompleteMigIsDone: INO " << IVD_PRINT_ID_FS(GetInode())
01178             << " size=" << m_inodeObj->GetFileSize()
01179             << " chgFlag=0x" << hex << m_inodeObj->GetInodeChgFlag()
01180             << " dataInPacker=" << boolalpha << IsDataInPacker());
01181 
01182         if (     tchgData & CHG_DATA_d
01183             &&   IsDataInPacker()
01184             && !(tchgData & CHG_DELETED_d)) {
01185             ivd_FS_File file(*g_fs_api_p, GetInode());
01186             try {
01187                 //HPUX - The file needs to be opened ( to be in the kernel cache )
01188                 file.Open(ivd_FS_File::e_Cache, g_fs_api_p->GetRootPath() + MakePath());
01189                 CleanChgFlag();
01190                 tchgData &= ~CHG_DATA_d;
01191                 //HPUX - Close File
01192                 file.Close();
01193             }
01194             catch (ivd_SysError &ies) { // probably file changed or umount occured or file is deletted
01195 
01196                 log_DBG_m(dbg_NORM, "Can't set clean bit, data changed.");
01197                 // do same things as unsucceed
01198                 SetInodeChgFlag(CHG_DATA_d); // data is stil changed
01199                 ResetDataInPacker(); // data is no more in packer
01200 
01201                 //HPUX - Close File
01202                 file.Close();
01203                 ObjChgGoToDirty(this);
01204                 return false;
01205             }
01206         }
01207 
01208         // TODO do not remove from active list and add to release candidate list if file is
01209         // still dirty.
01210         //bug 8458
01211         //data changed but it is not in packer (maybe changed again while packing)
01212         if (    !IsDataInPacker()
01213              && !(tchgData & CHG_DELETED_d)
01214              && (tchgData & CHG_DATA_d)
01215              &&  (GetfType() == ift_FILE)) {
01216 
01217             SetInodeChgFlag(tchgData);
01218             ToMigCand();
01219             ResetDataInPacker(); // data is no more in packer
01220 
01221 
01222             log_DBG_m(dbg_LOW, "Dirty file was not deleted from active list. INO: "
01223                     << IVD_PRINT_ID_FS(GetInode())
01224                     << " FID: " << GetFileID()
01225                     << "Name: '" << GetFName() << "'"
01226                     << ", OldName: '" << GetOldFName() << "'")
01227             return false; // file was not migrated
01228         }
01229 
01230         a_trans.StartTransaction();
01231 
01232         RemoveFromActiveList(a_trans);
01233 
01234         if (tchgData & CHG_DELETED_d) {
01235             RemoveNameFromHSMDB(a_trans);
01236         }
01237         else {
01238              // FIX bug 860
01239             if (GetfType() == ift_DIR) {
01240                 // if entry is directory then store fileID vs. HSMDB directory tree index relationship
01241                 if (!m_file2hsmIDset) {
01242                     hdb_file2hdbID_t file2hdbID(m_nameOwnIdx, m_relCandCircList, m_dirTreeIdx); // default constructor fill it with zerroes
01243                     if (hsm_CheckFile2hsmdbRec(GetFileID(), this)) {
01244                         // if directory is already updated in file2hdbID then continue.
01245                         // Update the record
01246                     }
01247                     g_File2hdbID_p->WriteRec(GetFileID(), &file2hdbID, 1, &a_trans);
01248                     m_file2hsmIDset = true;
01249                 }
01250             } else if (  GetFileSize() >  0 // add to retaintion list
01251                       && GetfType() == ift_FILE ) {
01252 
01253                 if (m_relCandIdx == 0) {  //
01254                     if (!hsm_CheckFile2hsmdbRec(GetFileID(), this)) {
01255                         // file is not added if it is already on file2hdbID.
01256                         g_hsm_relcList_p->Append( this,
01257                                                   true,
01258                                                   a_trans);
01259                     }
01260                 }
01261                 else {
01262                     log_DBG_m(dbg_NORM, "File '" << GetFName()
01263                             << "' is already on truc list " << m_relCandCircList
01264                             << "  idx " << m_relCandIdx);
01265                 }
01266             }
01267             else {
01270                     log_DBG_m(dbg_DETAIL, "File '" << GetFName()
01271                             << "' is not put to release list. "
01272                             << "  Size  " << GetFileSize()
01273                             << "  Type " << GetfType()
01274                             << "  IsDataInPacker " << IsDataInPacker());
01275             }
01276         }
01277 
01278         a_trans.EndTransaction();
01279 
01280         // data is no more in packer, it's migrated now
01281         ResetDataInPacker();
01282     }
01283 
01284     // get FH from cache if its
01285     if (g_hsm_FHCache_p->RemoveLastButOne(this)) {
01286         // remove from job list, do not set IDXes cause don't exist any more
01287         g_hsm_preJobList_p->ReleaseElement(m_jobIdx, m_jobElemIdx);
01288     }
01289     else {
01290         // remove from job list
01291         g_hsm_preJobList_p->ReleaseElement(m_jobIdx, m_jobElemIdx);
01292         m_jobIdx = m_jobElemIdx = -1;
01293         m_list   = eNoList;
01294     }
01295     return true;
01296 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::SendToPM ( UInt32_t  filesNoFID,
UInt32_t  preJobIdx 
)

void hsm_FileHeader::SetOffline ( bool  a_offline  ) 

Definition at line 675 of file hsm_FileHeader.cpp.

References g_fs_api_p, ivd_FileSystemAPI::GetRootPath(), log_FUNC_m, m_inodeObj, MakePath(), NULL, and hsm_InoObj::SetOffline().

Referenced by EventOffline(), and TruncateFile().

00675                                               {
00676     log_FUNC_m(SetOffline);
00677     if (m_inodeObj != NULL) {
00678         m_inodeObj->SetOffline(a_offline, g_fs_api_p->GetRootPath() + MakePath());
00679     }
00680 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::GetOffline ( void   )  const

Definition at line 552 of file hsm_FileHeader.cpp.

References hsm_InoObj::GetOffline(), log_FUNC_m, m_inodeObj, and NULL.

00552                                            {
00553     log_FUNC_m(GetOffline);
00554     if ( m_inodeObj == NULL){
00555         return false;
00556     }
00557     else {
00558         return m_inodeObj->GetOffline();
00559     }
00560 }

Here is the call graph for this function:

void hsm_FileHeader::NewName ( const string &  a_name  ) 

Definition at line 1300 of file hsm_FileHeader.cpp.

References CHG_NAMEOWN_d, dbg_NORM, GetInode(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_firstMigPackDone, m_fName, m_inodeObj, m_nameOwnerChg, m_nameOwnRW_x, m_oldFName, and hsm_InoObj::SetInodeChgFlag().

Referenced by Event(), and fs_api::EventMove().

01300                                                  {
01301     log_FUNC_m(NewName);
01302     cmn_WantWriteLock l(m_nameOwnRW_x);
01303     if (  m_firstMigPackDone  // if fresh FH then just update FH
01304        &&  m_oldFName.length() == 0) {
01305         hdb_String s(m_fName);      // swap string values and vector indeces
01306         m_fName    = m_oldFName;    // old name is empty, thus this clean vec idx and size
01307         m_oldFName = s;             //
01308         m_nameOwnerChg = true;
01309     }
01310     log_DBG_m(dbg_NORM, "NewName: INO " << IVD_PRINT_ID_FS(GetInode())
01311                         << " new name=" << a_name
01312                         << " current name=" << m_fName
01313                         << " old name=" << m_oldFName);
01314     m_fName     = a_name;
01315     m_inodeObj->SetInodeChgFlag(CHG_NAMEOWN_d);
01316 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::NewOwner ( hsm_FileHeader a_owner_p  ) 

Definition at line 1320 of file hsm_FileHeader.cpp.

References CHG_NAMEOWN_d, dbg_NORM, GetInode(), GetOldOwnerInode(), GetOwnerInode(), IncMemberRef(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_FHOwner, m_firstMigPackDone, m_inodeObj, m_nameOwnerChg, m_nameOwnRW_x, m_oldFHOwner, NULL, and hsm_InoObj::SetInodeChgFlag().

Referenced by Event(), and fs_api::EventMove().

01320                                                        {
01321     log_FUNC_m(NewOwner);
01322     cmn_WantWriteLock l(m_nameOwnRW_x);
01323     if (  m_firstMigPackDone  // if fresh FH then just update FH
01324        &&  m_oldFHOwner == NULL) {
01325         m_oldFHOwner = m_FHOwner; 
01326         m_nameOwnerChg = true;
01327     }
01328 // fix bug 478   a_owner was used to write new owner inode, but when delete occure
01329 // new owner is NULL.
01330     ivd_GenInode_t newInode = a_owner_p != NULL
01331                             ? a_owner_p->GetInode()
01332                             : 0;
01333     log_DBG_m(dbg_NORM, "NewOwner: new ownIno=" << IVD_PRINT_ID_FS(newInode)
01334                         << " current ownIno=" << IVD_PRINT_ID_FS(GetOwnerInode())
01335                         << " old ownIno=" << IVD_PRINT_ID_FS(GetOldOwnerInode()));
01336     m_FHOwner   = a_owner_p;
01337     if (m_FHOwner != NULL) {
01338         m_FHOwner->IncMemberRef();
01339     }
01340     m_inodeObj->SetInodeChgFlag(CHG_NAMEOWN_d);
01341 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::AddToDirTree (  ) 

when new directory occure in cache call this method.

void hsm_FileHeader::EventOffline ( ivd_FS_Event a_event  ) 

Definition at line 1457 of file hsm_FileHeader.cpp.

References ivd_FS_File::AddSyncEvent(), hsm_FHADPRecall::Append(), ivd_FS_File::Close(), dbg_DETAIL, dbg_LOW, ivd_FS_File::e_Cache, fio_Transaction::EndTransaction(), evt_ERROR, file, i_Recall_t::fileID, i_Recall_t::fileIdx, i_Recall_t::fileSize, g_cmn, g_fs_api_p, g_hsm_FHADPRecall_p, g_hsm_preJobList_p, g_hsm_relcList_p, g_hsmDB_p, g_iPM, ivd_FS_Event::GetCause(), ivd_FS_Event::GetChunkOff(), ivd_FS_Event::GetChunkSize(), ivd_FS_Event::GetFileID(), GetFileSize(), ivd_BaseException::GetFriendly(), GetInode(), hsm_JobListMgr::GetJobIdx(), ivd_FS_Event::GetPath(), ivd_FS_File::GetProperties(), ivd_FileSystemAPI::GetRootPath(), fio_DataBase::GetTransObj(), hjs_RECALL, HSM_CAUSE_OFFLINE, HSM_CAUSE_RECALL, hsm_JobListMgr::Insert(), ipc_EXEC_m, hsm_FHADPRecall::IsAlternateDataPathSet(), ivd_FS_ERR_Reply, ivd_FS_OK_Reply, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), ivd_FS_FileProperty_t::m_fileID, ivd_FS_FileProperty_t::m_fileSize, m_fName, hsm_RecallInfoGrp::m_fsFile, ivd_FS_FileProperty_t::m_Inode, hsm_RecallInfoGrp::m_jobElemIdx, hsm_RecallInfoGrp::m_jobIdx, ivd_Product::m_nameShort, ivd_FS_FileProperty_t::m_offlineFlag, hsm_ListPos::m_relCandIdx, m_reqHeader_p, MakePath(), i_Recall_t::migrationID, NULL, ivd_FS_File::Open(), PathListToPath(), cmn_Global::prod, fio_DataBase::ReleaseTransObj(), RemoveFromRelCandList(), ivd_FS_Event::ReplySyncEvent(), SendReply(), ivd_FS_File::SetDataOnline(), SetFileSize(), hsm_JobListMgr::SetJobStatus(), hsm_JobListMgr::SetMigJobID(), SetOffline(), hsm_FHrelc::SpaceCheck(), and fio_Transaction::StartTransaction().

Referenced by EventOffline(), and i_HSM_i::TrigEfficientRecall().

01457                                                       {
01458     log_FUNC_m(EventOffline);
01459 
01460    ivd_FS_FileProperty_t fileProp;
01461    if (m_reqHeader_p == NULL) {
01462         ivd_FS_File file(*g_fs_api_p, GetInode()); //TODO , GetFileID());
01463         ivd_PathList_t pathList;
01464 
01465         a_event.GetPath(pathList);
01466         cmn_Path fileName = g_fs_api_p->GetRootPath() + PathListToPath(pathList);
01467         ivd_FS_File cacheFile(*g_fs_api_p, fileName);
01468         try {
01469             //HPUX - The file needs to be opened (to be in the kernel cache)
01470             cacheFile.Open(ivd_FS_File::e_Cache);
01471             file.GetProperties(fileProp);
01472 
01473             if (!fileProp.m_offlineFlag) {
01474                 log_DBG_m(dbg_DETAIL, "File is already recalled.");
01475                 if (a_event.GetCause() == HSM_CAUSE_OFFLINE) {
01476                     a_event.ReplySyncEvent(ivd_FS_OK_Reply);
01477                 }
01478                 return;
01479             }
01480             if (fileProp.m_fileSize == 0) {
01481                 log_DBG_m(dbg_LOW, "File (id:" << fileProp.m_fileID <<
01482                     ", Inode:" << fileProp.m_Inode <<
01483                     " .size is 0 no recall needed. ");
01484                 // Overwrite on Windows triggers recall with fileSize=0
01485                 // bug 3780
01486                 // WORKAROUND: Set data online with size 0 and reply
01487 
01488                 //set file online
01489 
01490                 file.SetDataOnline(0, 0);
01491 
01492                 a_event.ReplySyncEvent(ivd_FS_OK_Reply);
01493                 return;
01494             }
01495             //HPUX CLose file
01496             cacheFile.Close();
01497         }
01498         catch (ivd_SysError &ise) {  // can't
01499             log_DBG_m(dbg_DETAIL, "File is deleted.");
01500             if (a_event.GetCause() == HSM_CAUSE_OFFLINE) {
01501                 a_event.ReplySyncEvent(ivd_FS_ERR_Reply);
01502             }
01503             //HPUX CLose file
01504             cacheFile.Close();
01505         }
01506 
01507         if (   a_event.GetChunkOff()  == 0
01508             && a_event.GetChunkSize() == 0) { // recall because of truncate to 0
01509             SetOffline(false);
01510             if ( a_event.GetCause() == HSM_CAUSE_OFFLINE) {
01511                 a_event.ReplySyncEvent(ivd_FS_OK_Reply);
01512             }
01513             log_DBG_m(dbg_DETAIL, "ReWrite offline file.");
01514             return;
01515         }
01516 
01517         m_reqHeader_p = new hsm_RecallInfoGrp(file, fileProp.m_fileSize);
01518 
01519         if ( a_event.GetCause() != HSM_CAUSE_RECALL) {
01520             m_reqHeader_p->m_fsFile.AddSyncEvent(a_event);
01521         }
01522     }
01523     else {
01524         if ( a_event.GetCause() != HSM_CAUSE_RECALL) {
01525             m_reqHeader_p->m_fsFile.AddSyncEvent(a_event);
01526         }
01527         log_DBG_m (dbg_DETAIL, "  RECALL of file: " << m_fName << " already in progress");
01528         return;
01529     }
01530 // end
01531 
01532 
01533     if (a_event.GetFileID() == 0) {
01534         if (g_hsm_FHADPRecall_p->IsAlternateDataPathSet()) {
01535             g_hsm_FHADPRecall_p->Append(this);
01536             return;
01537         }
01538         else {
01539             ostringstream sstr;
01540             sstr << "Can not recall. No fileID. Error or no alternate data path set. File: '"
01541                 << MakePath() << "'.";
01542             log_WriteEvent(evt_ERROR, sstr.str());
01543             SendReply(ivd_FS_ERR_Reply);
01544             return;
01545         }
01546     }
01547 
01548     m_reqHeader_p->m_jobIdx = g_hsm_preJobList_p->GetJobIdx(1);
01549 
01550     g_hsm_preJobList_p->SetJobStatus(m_reqHeader_p->m_jobIdx, hjs_RECALL);
01551 
01552     m_reqHeader_p->m_jobElemIdx = g_hsm_preJobList_p->Insert(m_reqHeader_p->m_jobIdx, this);
01553 
01554 
01555     try {
01557         SetFileSize(fileProp.m_fileSize);
01558 
01559         struct i_Recall_t recallStr;
01560         recallStr.fileID        = a_event.GetFileID();
01561         recallStr.migrationID   = 0;
01562         recallStr.fileSize      = GetFileSize();
01563         recallStr.fileIdx       = m_reqHeader_p->m_jobElemIdx;
01564         log_DBG_m (dbg_DETAIL, "  RECALL of file: " << m_fName
01565                             << " with FileID " << recallStr.fileID
01566                             << " file size " << recallStr.fileSize
01567                             << " cause: " << (int)a_event.GetCause());
01568 
01569         if (m_relCandIdx != 0) {  // remove it form release candidate list
01570             fio_Transaction &trans = *g_hsmDB_p->GetTransObj();
01571             trans.StartTransaction();
01572             RemoveFromRelCandList(trans);
01573             trans.EndTransaction();
01574             g_hsmDB_p->ReleaseTransObj(trans);
01575         }
01576         g_hsm_relcList_p->SpaceCheck();
01577         ipc_EXEC_m(
01578             i_JobID_t hsmJobIndexID = g_iPM->Recall(recallStr);
01579             g_hsm_preJobList_p->SetJobStatus(m_reqHeader_p->m_jobIdx, hjs_RECALL);
01580             g_hsm_preJobList_p->SetMigJobID(m_reqHeader_p->m_jobIdx, hsmJobIndexID, 0);
01581         );
01582     }
01583     catch (ivd_Exception &ie) {
01584         log_ERR_m("PM->Recall() failed: " + ie.GetFriendly());
01585         ostringstream sstr;
01586         sstr << "Failed to start recall on " << g_cmn.prod.m_nameShort
01587              << "-PM (" << ie.GetFriendly() << ").";
01588         log_WriteEvent(evt_ERROR, sstr.str());
01589         SendReply(ivd_FS_ERR_Reply);
01590     }
01591     catch (...){
01592         log_ERR_m("PM->Recall() failed: unknown exception");
01593         log_WriteEvent(evt_ERROR, "Failed to start recall on "
01594                                   + g_cmn.prod.m_nameShort + "-PM.");
01595         SendReply(ivd_FS_ERR_Reply);
01596     }
01597 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FileHeader::EventOffline ( UInt32_t  a_jobIdx,
i_Recall_t a_recallStr,
bool  a_migrateAfterRecall 
)

Add FH to recall job with index a_jobIdx.

Definition at line 1600 of file hsm_FileHeader.cpp.

References ivd_FS_File::AddSyncEvent(), dbg_DETAIL, dbg_LOW, ivd_FS_File::e_Cache, fio_Transaction::EndTransaction(), EventOffline(), file, i_Recall_t::fileID, i_Recall_t::fileIdx, i_Recall_t::fileSize, g_fs_api_p, g_hsm_FHCache_p, g_hsm_preJobList_p, g_hsm_relcList_p, g_hsmDB_p, GetFileID(), GetFileSize(), GetInode(), ivd_FS_File::GetProperties(), ivd_FileSystemAPI::GetRootPath(), fio_DataBase::GetTransObj(), HSM_CAUSE_MIGRATE, hsm_JobListMgr::Insert(), log_DBG_m, log_FUNC_m, ivd_FS_FileProperty_t::m_fileID, ivd_FS_FileProperty_t::m_fileSize, m_fName, hsm_RecallInfoGrp::m_fsFile, ivd_FS_FileProperty_t::m_Inode, hsm_RecallInfoGrp::m_jobElemIdx, hsm_RecallInfoGrp::m_jobIdx, ivd_FS_FileProperty_t::m_offlineFlag, hsm_ListPos::m_relCandIdx, m_reqHeader_p, MakePath(), i_Recall_t::migrationID, NULL, fio_DataBase::ReleaseTransObj(), RemoveFromRelCandList(), hsm_FHcache::RemoveLastButOne(), ivd_FS_File::SetDataOnline(), hsm_FHrelc::SpaceCheck(), and fio_Transaction::StartTransaction().

01602                                                                     {
01603     log_FUNC_m(EventOffline(jobIdx));
01604 
01605     a_recallStr.fileID = 0; // if failed then fileID is not set.
01606 
01607     if (m_reqHeader_p != NULL) { //
01608         log_DBG_m (dbg_DETAIL, "Manual RECALL of file: " << m_fName << ", but recall already in progress.");
01609         return false;
01610     }
01611     else {
01612         ivd_FS_FileProperty_t fileProp;
01613         // create file object to be stored in m_reqHeader
01614         ivd_FS_File file(*g_fs_api_p, GetInode(), GetFileID());
01615         try {
01616             // temporary fileobject, just for asure the file dentry in filter.
01617             ivd_FS_File fileTemp(*g_fs_api_p, g_fs_api_p->GetRootPath() + MakePath());
01618             //HPUX - The file needs to be opened ( to be in the kernel cache )
01619             fileTemp.Open(ivd_FS_File::e_Cache);
01620             // file object has to be used for get propertites because
01621             // also its properties are set
01622             file.GetProperties(fileProp);
01623             fileTemp.Close();
01624             if (!fileProp.m_offlineFlag) {
01625                 log_DBG_m(dbg_DETAIL, "File is already recalled.");
01626                 g_hsm_FHCache_p->RemoveLastButOne(this);
01627                 return false;
01628             }
01629             if (fileProp.m_fileSize == 0) {
01630                 log_DBG_m(dbg_LOW, "File (id:" << fileProp.m_fileID <<
01631                     ", Inode:" << fileProp.m_Inode <<
01632                     " .size is 0 no recall needed. ");
01633                 //set file online
01634                 file.SetDataOnline(0, 0);
01635                 g_hsm_FHCache_p->RemoveLastButOne(this);
01636                 return false;
01637             }
01638         }
01639         catch (ivd_SysError &ise) {  // can't
01640             log_DBG_m(dbg_DETAIL, "File is deletted.");
01641             g_hsm_FHCache_p->RemoveLastButOne(this);
01642             return false;
01643         }
01644 
01645         m_reqHeader_p = new hsm_RecallInfoGrp(file, fileProp.m_fileSize);
01646         if (a_migrateAfterRecall) {
01647             ivd_FS_Event event;
01648             event.SetCause(HSM_CAUSE_MIGRATE);
01649             m_reqHeader_p->m_fsFile.AddSyncEvent(event);
01650         }
01651     }
01652 
01653     m_reqHeader_p->m_jobIdx = a_jobIdx;
01654 
01655     m_reqHeader_p->m_jobElemIdx = g_hsm_preJobList_p->Insert(a_jobIdx, this);
01656 
01657     a_recallStr.fileID        = GetFileID();
01658     a_recallStr.migrationID   = 0;
01659     a_recallStr.fileSize      = GetFileSize();
01660     a_recallStr.fileIdx       = m_reqHeader_p->m_jobElemIdx;
01661 
01662     if (m_relCandIdx != 0) {  // remove it form release candidate list
01663         fio_Transaction &trans = *g_hsmDB_p->GetTransObj();
01664         trans.StartTransaction();
01665         RemoveFromRelCandList(trans);
01666         trans.EndTransaction();
01667         g_hsmDB_p->ReleaseTransObj(trans);
01668     }
01669     g_hsm_relcList_p->SpaceCheck();
01670 
01671     return true;
01672 }

Here is the call graph for this function:

ivd_MigrationID_t hsm_FileHeader::GetJobMigID (  ) 

Definition at line 1445 of file hsm_FileHeader.cpp.

References g_hsm_preJobList_p, hsm_JobListMgr::GetMigrationID(), log_FUNC_m, and m_jobIdx.

01445                                               {
01446     log_FUNC_m(GetJobMigID);
01447     if (m_jobIdx == -1) {
01448         return 0;  // FH is not in job list
01449     }
01450     else {
01451         return g_hsm_preJobList_p->GetMigrationID(m_jobIdx);
01452     }
01453 }

Here is the call graph for this function:

void hsm_FileHeader::SetDirTreeIdx ( ivd_RecordIDX_t  a_dirTreeIdx  )  [inline]

Definition at line 329 of file client/hsmlist/hsm_FileHeader.h.

References m_dirTreeIdx.

Referenced by InitActive().

00329 { m_dirTreeIdx = a_dirTreeIdx;};

Here is the caller graph for this function:

void hsm_FileHeader::MakeStat ( ivd_FileInfo_t &  a_fInfo  ) 

NOTE MekeStat must be used inside try block and catch for catch(ivd_SysError &ise) exception.

Definition at line 1777 of file hsm_FileHeader.cpp.

References dbg_NORM, g_fs_api_p, GetfType(), GetInode(), ivd_FileSystemAPI::GetRootPath(), IsDeleted(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, MakePath(), cmn_File::SetFullPath(), and cmn_File::StatF().

Referenced by i_HSM_i::PackFile().

01777                                                      {
01778     log_FUNC_m(MakeStat);
01780     if (IsDeleted()) {
01781         // file is deleted -> cannot get attributes
01782         memset(&a_fInfo, 0, sizeof(a_fInfo));
01783         a_fInfo.type   = GetfType();
01784         a_fInfo.idOnFS = GetInode();
01785     }
01786     else {
01787         cmn_File acctFile;
01788         acctFile.SetFullPath(g_fs_api_p->GetRootPath() + MakePath());
01789         try {
01790             log_DBG_m(dbg_NORM, "StatF of INO " << IVD_PRINT_ID_FS(GetInode()));
01791             acctFile.StatF(a_fInfo);
01792         }
01793         catch (ivd_SysError &ise) {
01794             log_DBG_m(dbg_NORM, "StatF failed. INO " << IVD_PRINT_ID_FS(GetInode()));
01795             throw;
01796         }
01797         // With STAT command it is not possible to get UInt64_t type of inode.
01798         // UInt64 type of inode is known just in HSM.
01799         a_fInfo.idOnFS = GetInode();
01800 
01801     }
01802 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::OpenFile ( ivd_FS_File a_file,
const ivd_FS_File::ivd_FS_FileOperation_e  a_fileOp 
)

NOTE use same try catch algorith for OpenFile method as for MakeStat.

Definition at line 1806 of file hsm_FileHeader.cpp.

References dbg_NORM, g_fs_api_p, GetInode(), ivd_FileSystemAPI::GetRootPath(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, MakePath(), and ivd_FS_File::Open().

Referenced by i_HSM_i::PackFile(), and TruncateFile().

01807                                                       {
01808     log_FUNC_m(OpenFile);
01809     try {
01810         a_file.Open(a_fileOp, g_fs_api_p->GetRootPath() + MakePath());
01811     }
01812     catch (ivd_SysError &ise) {
01813         log_DBG_m(dbg_NORM, "OpenF failed. INO " << IVD_PRINT_ID_FS(GetInode()));
01814         throw;
01815     }
01816 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::SetFileID ( ivd_FileID_t  a_fileId  ) 

check if inode exist and set its fileID and extend atributes

Definition at line 629 of file hsm_FileHeader.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_inodeObj, NULL, and hsm_InoObj::SetFileID().

Referenced by fs_api::AddGenericEvent(), hsm_FHmigc::SendToPM(), and ToMigCand().

00629                                                    {
00630     log_FUNC_m(SetFileID);
00631 
00632     if (m_inodeObj != NULL) {
00633         m_inodeObj->SetFileID(a_fileId);
00634     }
00635     else {
00636         log_DBG_m(dbg_DETAIL, "  SetFileID FAILED: Inode object IS_NULL");
00637     }
00638 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::UpdateFileID ( ivd_FileID_t  a_fileId  ) 

check if inode exist and set its fileID DOESN'T set EA

Definition at line 642 of file hsm_FileHeader.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_inodeObj, NULL, and hsm_InoObj::UpdateFileID().

Referenced by ToMigCand().

00642                                                       {
00643     log_FUNC_m(UpdateFileID);
00644 
00645     if (m_inodeObj != NULL) {
00646         m_inodeObj->UpdateFileID(a_fileId);
00647     }
00648     else {
00649         log_DBG_m(dbg_DETAIL, "  UpdateFileId FAILED: Inode object IS_NULL");
00650     }
00651 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::Recalled ( bool  a_succeed  ) 

this method is called after file is extracted from packer, succeed or not.

Definition at line 1675 of file hsm_FileHeader.cpp.

References hsm_FHrelc::Append(), ivd_FS_File::Close(), dbg_DETAIL, dbg_NORM, hsm_RecallInfoGrp::DumpChunks(), ivd_FS_File::e_Cache, ivd_FS_File::e_RefCount, fio_Transaction::EndTransaction(), file, g_fs_api_p, g_fsLog, g_hsm_FHCache_p, g_hsm_preJobList_p, g_hsm_relcList_p, g_hsmDB_p, hsm_InoObj::GetChnSize(), GetFileID(), GetFileSize(), GetFName(), GetInode(), ivd_FileSystemAPI::GetRootPath(), fio_DataBase::GetTransObj(), hsm_CheckFile2hsmdbRec(), ivd_FS_ERR_Reply, ivd_FS_OK_Reply, log_DBG_m, log_ERR_m, log_FUNC_m, log_WRN_m, m_fName, hsm_RecallInfoGrp::m_fsFile, m_inodeObj, hsm_RecallInfoGrp::m_jobElemIdx, hsm_RecallInfoGrp::m_jobIdx, m_nameOwnIdx, hsm_ListPos::m_relCandIdx, m_reqHeader_p, MakePath(), NULL, hsm_JobListMgr::ReleaseElement(), fio_DataBase::ReleaseTransObj(), RemoveFromRelCandList(), hsm_FHcache::RemoveLastButOne(), SendReply(), ivd_FS_File::SetDataOnline(), ivd_FS_File::SetFullPath(), fio_Transaction::StartTransaction(), StoreNameOwnRec(), and log_ivdfs::Write().

Referenced by i_HSM_i::EfficientRecall(), hsm_Recall::FileRecalledCheck(), and i_HSM_i::Recall().

01675                                             {
01676     log_FUNC_m(Recalled);
01677     if (m_reqHeader_p == NULL) {
01678         log_ERR_m("  Recall of file " << m_fName << " has no request header set.");
01679         return;
01680     }
01681     UInt32_t jobIdx     = m_reqHeader_p->m_jobIdx;
01682     UInt32_t jobElemIdx = m_reqHeader_p->m_jobElemIdx;
01683     // after SendReply m_reqHeader_p is released
01684     if (a_succeed) {
01685         // SendReply need full path to open file before trig migration.
01686         // NOTE: File is not open for EA update, but it should be.
01687         // It is hard to manipulate with m_fsFile, because it is used for
01688         // manual recall into too. NEED redesign.
01689         // NOTE: concu rentmanual recall into two different places is impossible.
01690 
01691         m_reqHeader_p->m_fsFile.SetFullPath(g_fs_api_p->GetRootPath() + MakePath());
01692 
01693         ivd_FS_File file(*g_fs_api_p, g_fs_api_p->GetRootPath() + MakePath());
01694         try {
01695             //HPUX - The file needs to be opened ( to be in the kernel cache )
01696             file.Open(ivd_FS_File::e_Cache);
01697             //WIN - just a dummy open used for increasing open reference counter in filter file context
01698             file.Open(ivd_FS_File::e_RefCount);
01699             m_reqHeader_p->m_fsFile.Close();
01700             m_reqHeader_p->m_fsFile.SetDataOnline(0, m_inodeObj->GetChnSize());
01701         }
01702         catch (ivd_SysError &ise) {
01703             log_DBG_m(dbg_NORM,
01704                 "Can't set online. File is probably deleted or moved.");
01705             SendReply(ivd_FS_ERR_Reply);
01706             goto out;
01707         }
01708 
01709         ostringstream sstr;
01710         sstr << "Recalled. ";
01711         m_reqHeader_p->DumpChunks(sstr);
01712         g_fsLog.Write(GetInode(), GetFileID(), jobIdx, MakePath(), sstr.str().c_str());
01713 
01714         // NOTE! m_reqHeader_p is no more valid after SendReply() is called
01715 
01716         SendReply(ivd_FS_OK_Reply);
01717         log_DBG_m(dbg_DETAIL, "  File is SUCCESSFULY written to disk. File size = " << GetFileSize() );
01718 
01719 
01720         if (GetFileSize() > 0) {
01722             fio_Transaction &trans = *g_hsmDB_p->GetTransObj();
01723             trans.StartTransaction();
01724             if (m_relCandIdx != 0) {  // remove it form release candidate list
01725                 RemoveFromRelCandList(trans);
01726             }
01727             else if (hsm_CheckFile2hsmdbRec(GetFileID(), this)) {
01728                 RemoveFromRelCandList(trans);
01729             }
01730 
01731             if (m_nameOwnIdx == 0) {
01732                 StoreNameOwnRec(trans);
01733             }
01734             // add to releaseCand list
01735                 g_hsm_relcList_p->Append( this,
01736                                           false,
01737                                           trans);
01738 
01739             trans.EndTransaction();
01740             g_hsmDB_p->ReleaseTransObj(trans);
01741        }
01742         else {
01743             log_WRN_m("File size = 0. " << GetFName());
01744         }
01745     }
01746     else {
01747         SendReply(ivd_FS_ERR_Reply);
01748     }
01749 out:
01750     // get FH from cache if its
01751     if (g_hsm_FHCache_p->RemoveLastButOne(this)) {
01752         // remove from job list, do not set IDXes cause don't exist any more
01753     }
01754     if (a_succeed) {
01755         // remove element with data size notification
01756         g_hsm_preJobList_p->ReleaseElement(jobIdx, jobElemIdx, GetFileSize());
01757     }
01758     else {
01759         // remove from job list
01760         g_hsm_preJobList_p->ReleaseElement(jobIdx, jobElemIdx);
01761     }
01762 }

Here is the call graph for this function:

Here is the caller graph for this function:

UInt64_t hsm_FileHeader::TruncateFile (  ) 

open file truncate it and set EA offline

Definition at line 2001 of file hsm_FileHeader.cpp.

References dbg_DETAIL, dbg_NORM, ivd_FS_File::e_Release, g_fs_api_p, GetFileID(), ivd_FS_File::GetFullPathRef(), GetInode(), IsDeleted(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, OpenFile(), and SetOffline().

Referenced by i_HSM_i::Recall(), hsm_Recall::RecallOfFileCanceled(), hsm_FHrelc::Truncate(), and TruncateFile().

02001                                       {
02002     log_FUNC_m(TruncateFile);
02003 
02004     ivd_FS_File truncFile(*g_fs_api_p, GetInode(), GetFileID());
02005     UInt64_t truncSize = 0;
02006     try {
02007         if (!IsDeleted()) {
02008             // fix bug 531
02009             SetOffline(true);
02010 
02011             //truncFile.Close();
02012             // fix bug 216, SetOffline check if no one use file
02013             // so OpenFile must be after SetOffline
02014             OpenFile(truncFile, ivd_FS_File::e_Release);
02015             log_DBG_m(dbg_DETAIL, "  truncate file " << truncFile.GetFullPathRef());
02016             truncSize = TruncateFile(truncFile);
02017         }
02018     }
02019     catch (ivd_SysError &ise) {
02020         log_DBG_m(dbg_NORM, "File " << truncFile.GetFullPathRef()
02021             << " INO " << IVD_PRINT_ID_FS(GetInode())
02022             << " was not truncated, can be deleted or currently used." << endl << ise);
02023     // fix bug 216 and 1690
02024         throw;
02025     // end
02026     }
02027 
02028     return truncSize;
02029 }

Here is the call graph for this function:

Here is the caller graph for this function:

UInt64_t hsm_FileHeader::TruncateFile ( ivd_FS_File a_truncFile  ) 

just truncate file (used also by failed recall)

Definition at line 2033 of file hsm_FileHeader.cpp.

References ivd_FS_File::Close(), dbg_NORM, ivd_FS_File::GetFullPathRef(), GetInode(), ivd_FS_File::GetProperties(), IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, ivd_FS_FileProperty_t::m_fileSize, ivd_FS_File::Release(), and TruncateFile().

02033                                                               {
02034     log_FUNC_m(TruncateFile(ivd_FS_File));
02035 
02036     ivd_FS_FileProperty_t fProp;
02037     try {
02038         log_DBG_m(dbg_NORM, "TruncateFile: INO " << IVD_PRINT_ID_FS(GetInode())
02039                            << " path=" << a_truncFile.GetFullPathRef());
02040         a_truncFile.GetProperties(fProp);
02041         a_truncFile.Release();
02042         a_truncFile.Close();
02043     }
02044     catch (ivd_SysError &ise) {
02045         log_DBG_m(dbg_NORM, "File " << a_truncFile.GetFullPathRef()
02046             << " INO " << IVD_PRINT_ID_FS(GetInode())
02047             << " was not truncated!" << endl << ise);
02048         throw;
02049     }
02050 
02051     return fProp.m_fileSize;
02052 }

Here is the call graph for this function:

void hsm_FileHeader::DumpListEl ( ostringstream &  sstr  ) 

Definition at line 2055 of file hsm_FileHeader.cpp.

References GetChgFlag(), GetFileID(), GetInode(), GetOldFullPath(), IVD_PRINT_ID_FS, m_oldFName, and MakePath().

Referenced by hsm_FHmigc::DumpList(), and hsm_FHdirty::DumpList().

02055                                                    {
02056     sstr << "0x" << hex << setw(4) << setfill('0') << GetChgFlag() << setfill(' ') << dec
02057          << ", " << setw(9) << GetFileID()
02058          << ", " << IVD_PRINT_ID_FS(GetInode())
02059          << ", '" << MakePath() << "',";
02060 
02061     if ( m_oldFName.length() ) {
02062         sstr << " '" << GetOldFullPath() << "'";
02063     }
02064     sstr << endl;
02065 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FileHeader::DoDecrRef (  )  [private]

Decrement reference without locking.

cmn_Path hsm_FileHeader::DoMakePath ( void   )  [private]

Create full path without locking.

UInt64_t hsm_FileHeader::GetInode ( void   )  const

hsm_List_e hsm_FileHeader::GetList ( void   )  const [inline]

Get list where FH is.

Reimplemented from hsm_ListPos.

Definition at line 118 of file include/ivd/hsm_FileHeader.h.

References m_list.

Referenced by fs_api::GetDirFH(), hsm_ActiveFH::OrphanedToMigList(), and i_HSM_i::PackFile().

00118 { return m_list      ;};

Here is the caller graph for this function:

ivd_Time32_t hsm_FileHeader::GetListIdx ( void   )  const [inline]

Get index on a list (for Dirty and MigCnd list).

Definition at line 120 of file include/ivd/hsm_FileHeader.h.

References m_listIdx.

00120 { return m_listIdx   ;};

ivd_FileSize_t hsm_FileHeader::GetFileSize ( void   )  const

ivd_FileID_t hsm_FileHeader::GetFileID ( void   )  const

ivd_RecordIDX_t hsm_FileHeader::GetRecIdx ( void   )  const [inline]

Definition at line 123 of file include/ivd/hsm_FileHeader.h.

References m_idxFH.

00123 { return m_idxFH     ;};

string hsm_FileHeader::GetFName ( void   )  const [inline]

Definition at line 124 of file include/ivd/hsm_FileHeader.h.

References m_fName.

00124 { return m_fName     ;};

string hsm_FileHeader::GetOldFName ( void   )  const [inline]

Definition at line 125 of file include/ivd/hsm_FileHeader.h.

References m_oldFName.

00125 { return m_oldFName  ;};

hsm_InoObj* hsm_FileHeader::GetInoObj ( void   )  const [inline]

Definition at line 126 of file include/ivd/hsm_FileHeader.h.

References m_inodeObj.

00126 { return m_inodeObj  ;};

hsm_FileHeader* hsm_FileHeader::GetFOwner ( void   )  const [inline]

Definition at line 127 of file include/ivd/hsm_FileHeader.h.

References m_FHOwner.

00127 { return m_FHOwner   ;};

UInt64_t hsm_FileHeader::GetFOwnerInode ( void   )  const

hsm_FileHeader* hsm_FileHeader::GetOldFOwner ( void   )  const [inline]

Definition at line 129 of file include/ivd/hsm_FileHeader.h.

References m_oldFHOwner.

00129 { return m_oldFHOwner;};

ivd_Time32_t hsm_FileHeader::GetChgTime ( void   )  const [inline]

Definition at line 130 of file include/ivd/hsm_FileHeader.h.

References m_chgTime.

00130 { return m_chgTime   ;};

ivd_FileType_e hsm_FileHeader::GetfType ( void   )  const [inline]

Definition at line 131 of file include/ivd/hsm_FileHeader.h.

References m_fType.

00131 { return m_fType     ;}; 

UInt16_t hsm_FileHeader::GetChnData ( void   )  const

UInt32_t hsm_FileHeader::GetRef ( void   )  const [inline]

Return Reference counter of this FH.

Definition at line 134 of file include/ivd/hsm_FileHeader.h.

References m_objRef.

00134 { return m_objRef    ;};

void hsm_FileHeader::GetValues ( UInt64_t a_inode,
string &  a_fName,
UInt64_t a_fOwner 
) const

void hsm_FileHeader::GetJob ( UInt32_t a_jobNumber,
UInt32_t a_jobIdx 
) const [inline]

Get job and job index.

Definition at line 137 of file include/ivd/hsm_FileHeader.h.

References m_jobIdx, and m_jobNumber.

00137                                                                                    { 
00138                                   a_jobNumber = m_jobNumber; 
00139                                   a_jobIdx    = m_jobIdx;
00140     }; 

void hsm_FileHeader::SetJob ( UInt32_t  a_jobNumber,
UInt32_t  a_jobIdx 
) [inline]

Set job and job index.

Definition at line 142 of file include/ivd/hsm_FileHeader.h.

References m_jobIdx, and m_jobNumber.

00142                                                                            { 
00143                                   m_jobNumber = a_jobNumber; 
00144                                   m_jobIdx    = a_jobIdx;
00145     }; 

void hsm_FileHeader::SetList ( hsm_List_e  a_fList  )  [inline]

Reimplemented from hsm_ListPos.

Definition at line 146 of file include/ivd/hsm_FileHeader.h.

References m_list.

00146 { m_list       = a_fList;   }; 

void hsm_FileHeader::SetListIdx ( ivd_Time32_t  a_listIdx  )  [inline]

Definition at line 147 of file include/ivd/hsm_FileHeader.h.

References m_listIdx.

00147 { m_listIdx    = a_listIdx; };

void hsm_FileHeader::SetRecIdx ( ivd_RecordIDX_t  a_idxFH  )  [inline]

Definition at line 148 of file include/ivd/hsm_FileHeader.h.

References m_idxFH.

00148 { m_idxFH      = a_idxFH   ;}; // Circular list

void hsm_FileHeader::SetFileSize ( ivd_FileSize_t  a_fileSize  ) 

void hsm_FileHeader::SetFileID ( ivd_FileID_t  a_fileId  ) 

void hsm_FileHeader::SetChnData ( UInt16_t  a_Data  ) 

void hsm_FileHeader::SetFName ( string  a_fname  )  [inline]

Definition at line 152 of file include/ivd/hsm_FileHeader.h.

References m_fName.

00152 { m_fName    = a_fname;   };

void hsm_FileHeader::SetOldFName ( string  a_oldFName  )  [inline]

Definition at line 153 of file include/ivd/hsm_FileHeader.h.

References m_oldFName.

00153 { m_oldFName = a_oldFName;} ; 

void hsm_FileHeader::SetOwnFHObj ( hsm_FileHeader a_FHObj  )  [inline]

Definition at line 154 of file include/ivd/hsm_FileHeader.h.

References IncrRef(), and m_FHOwner.

00154                                                              { 
00155                         m_FHOwner = a_FHObj;
00156                         m_FHOwner->IncrRef();
00157     };

Here is the call graph for this function:

void hsm_FileHeader::SetOldOwnFHObj ( hsm_FileHeader a_FHObj  )  [inline]

Definition at line 158 of file include/ivd/hsm_FileHeader.h.

References IncrRef(), and m_oldFHOwner.

00158                                                              { 
00159                         m_oldFHOwner = a_FHObj;   
00160                         m_oldFHOwner->IncrRef();
00161     };

Here is the call graph for this function:

cmn_Path hsm_FileHeader::MakePath ( void   ) 

void hsm_FileHeader::MakeStat ( ivd_FileInfo_t &  a_fInfo  ) 

void hsm_FileHeader::UpdateChgTime ( ivd_Time32_t  a_chgTime  ) 

void hsm_FileHeader::IncrRef (  ) 

void hsm_FileHeader::DecrRef (  ) 

bool hsm_FileHeader::IsEqual ( const hsm_FileHeader a_FileHeader  )  const


Friends And Related Function Documentation

ostream& operator<< ( ostream &  a_os,
hsm_FileHeader a_o 
) [friend]

Definition at line 2068 of file hsm_FileHeader.cpp.

02068                                                          {
02069     cmn_Time modTime(a_o.m_modifyTimeAtMig);
02070     a_os << " FH dump: " << endl
02071          << "Inode          " << IVD_PRINT_ID_FS(a_o.GetInode()) << endl
02072          << "file path     '" << a_o.GetFullPath() << "'" << endl
02073          << "old file path '" << a_o.GetOldFullPath() << "'" << endl
02074          << "is migrated    " << boolalpha << a_o.m_firstMigPackDone << endl
02075          << "nameOwnerChg   " << boolalpha << a_o.m_nameOwnerChg << endl
02076          << "fhChgFlag      0x" << hex << a_o.m_fhChgFlag << dec << endl
02077          << "objRef         " << a_o.m_objRef << endl
02078          << "dirMemberRef   " << a_o.m_dirMemberRef << endl
02079          << "nameOwnIdx     " << a_o.m_nameOwnIdx << endl
02080          << "oldNameOwnIdx  " << a_o.m_oldNameOwnIdx << endl
02081          << "dirTreeIdx     " << a_o.m_dirTreeIdx << endl
02082          << "activeIdx      " << a_o.m_activeIdx << endl
02083          << "m_list         " << a_o.m_list << endl
02084          << "m_jobIdx       " << a_o.m_jobIdx << endl
02085          << "m_jobElemIdx   " << a_o.m_jobElemIdx << endl
02086          << "m_relCandIdx   " << a_o.m_relCandIdx << endl
02087          << "m_relCandCircList " << a_o.m_relCandCircList << endl
02088          << "file2hsmIDset  " << boolalpha << a_o.m_file2hsmIDset << endl
02089          << "dataMigStat    " << a_o.m_dataMigStat << endl
02090          << "reqHeader_p    0x" << hex << (void*)a_o.m_reqHeader_p << dec << endl
02091          << "modTimeAtMig   " << modTime.Time2YMDhms() << endl;
02092     return   a_os;
02093 }


Member Data Documentation

Macro to add class name member s_className.

Reimplemented from hsm_ListPos.

Definition at line 89 of file client/hsmlist/hsm_FileHeader.h.

Definition at line 96 of file client/hsmlist/hsm_FileHeader.h.

Referenced by MakePath(), NewName(), and NewOwner().

some time in past has been migrated yet this mean that is not compleatly new

Definition at line 103 of file client/hsmlist/hsm_FileHeader.h.

Referenced by Event(), InitActive(), InitFromDB(), MigrationIsDone(), NewName(), NewOwner(), and operator<<().

what is changed? Create, Delete, nameOwn,

Definition at line 107 of file client/hsmlist/hsm_FileHeader.h.

Referenced by CleanChgFlag(), GetChgFlag(), operator<<(), SetFHChgFlag(), and UnSetFHChgFlag().

when FH is on job lists then this indeces are used it is possible that FH is in job and dirty list at the same time on dirty because of datachanged and on job because of dependencies of change name or owner -1 mean that is not in job list

Object reference

Definition at line 118 of file client/hsmlist/hsm_FileHeader.h.

Referenced by DecMemberRef(), DecrRef(), Event(), GetRef(), IncMemberRef(), IncrRef(), and operator<<().

If this FH is directory then m_dirMemberRef hold the number of its members.

Definition at line 121 of file client/hsmlist/hsm_FileHeader.h.

Referenced by DecMemberRef(), DecrRef(), GetRef(), IncMemberRef(), and operator<<().

set when fil2hsmID relation is written to DB

Definition at line 128 of file client/hsmlist/hsm_FileHeader.h.

Referenced by CompleteMigIsDone(), InitFromDB(), and operator<<().

if FH is in migration process and event manager can't lock file then set this state to eDoMigStart do migration process will abort migration and repeat it without data migration.

Definition at line 135 of file client/hsmlist/hsm_FileHeader.h.

Referenced by GetDataMigStat(), operator<<(), and SetDataMigStat().

if recall is in progress then this pointer point to request header got from filter

Definition at line 138 of file client/hsmlist/hsm_FileHeader.h.

Referenced by EventOffline(), GetRecallFile(), GetRecallInfoGrp(), GetRecallIntoName(), GetRecallJobIdx(), operator<<(), Recalled(), SendReply(), and ~hsm_FileHeader().

modify time when migration started it's checked after data is packed and send to filter when CLEAN bit is set.

Definition at line 145 of file client/hsmlist/hsm_FileHeader.h.

Referenced by CleanChgFlag(), operator<<(), and SetModifyTimeAtMig().

File type ift_FILE, ift_DIR, ift_SYMLINK.

..

Definition at line 78 of file include/ivd/hsm_FileHeader.h.

Referenced by GetfType().

string hsm_FileHeader::m_fName [private]

File name.

Definition at line 80 of file include/ivd/hsm_FileHeader.h.

string hsm_FileHeader::m_oldFName [private]

Old file name.

Definition at line 82 of file include/ivd/hsm_FileHeader.h.

Flag to see what is changed.

It should be OR-ed between specific flags: 1 - data is changed 2 - meta data is changed 4 - alternate data is changed 8 - File Header is changed

Definition at line 90 of file include/ivd/hsm_FileHeader.h.

Last modification time of object.

Definition at line 92 of file include/ivd/hsm_FileHeader.h.

Referenced by GetChgTime().

Flag to know where File Header object is.

Reimplemented from hsm_ListPos.

Definition at line 94 of file include/ivd/hsm_FileHeader.h.

Referenced by CompleteMigIsDone(), DirtyToMigCnd(), Event(), GetList(), MigCanToPreJob(), MigPreJobToPM(), NameOwnChgGoToDirty(), operator<<(), SetList(), and ToMigCand().

Index in Dirty list or Migration candidate list.

Definition at line 96 of file include/ivd/hsm_FileHeader.h.

Referenced by GetListIdx(), and SetListIdx().

Job Index.

Definition at line 98 of file include/ivd/hsm_FileHeader.h.

Referenced by GetJob(), and SetJob().

Job List Index.

Reimplemented from hsm_ListPos.

Definition at line 100 of file include/ivd/hsm_FileHeader.h.

Referenced by CompleteMigIsDone(), GetJob(), GetJobMigID(), MigCanToPreJob(), operator<<(), and SetJob().

Object reference.

Definition at line 102 of file include/ivd/hsm_FileHeader.h.

Definition at line 104 of file include/ivd/hsm_FileHeader.h.

Referenced by GetRecIdx(), and SetRecIdx().

File Header size.

It is generic size filled from configuration!

Definition at line 106 of file include/ivd/hsm_FileHeader.h.

Definition at line 108 of file include/ivd/hsm_FileHeader.h.


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

Generated on Mon Feb 27 19:28:07 2012 for OPENARCHIVE by  doxygen 1.5.6