Changeset 3588

Show
Ignore:
Timestamp:
10/31/2009 04:15:36 PM (3 weeks ago)
Author:
brian
Message:

First whack at enabling use of custom namelibs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • XrdHdfs/XrdHdfs.cc

    r3552 r3588  
    99/******************************************************************************/ 
    1010 
    11 //          $Id: XrdHdfs.cc,v 1.20 2008/06/09 10:44:30 ganis Exp $ 
    12  
    13 const char *XrdHdfsCVSID = "$Id: XrdHdfs.cc,v 1.20 2008/06/09 10:44:30 ganis Exp $"; 
     11const char *XrdHdfsSVNID = "$Id$"; 
    1412 
    1513#include <sys/types.h> 
     
    9896   static const char *epname = "Opendir"; 
    9997#endif 
     98   int retc; 
    10099 
    101100// Return an error if we have already opened 
     
    104103// Set up values for this directory object 
    105104// 
     105   if (XrdHdfsSS->the_N2N) { 
     106       char actual_path[XrdOssMAX_PATH_LEN+1]; 
     107       if ((retc = XrdHdfsSS->the_N2N->lfn2pfn(dir_path, actual_path, sizeof(actual_path)))) 
     108          return retc; 
     109          else fname = strdup(actual_path); 
     110   } 
    106111   fname = strdup(dir_path); 
    107112   dirPos = 0; 
     
    246251   if (fh != NULL) 
    247252      return -XRDOSS_E8003; 
     253 
     254   int retc; 
     255   if (XrdHdfsSS->the_N2N) { 
     256       char actual_path[XrdOssMAX_PATH_LEN+1]; 
     257       if ((retc = XrdHdfsSS->the_N2N->lfn2pfn(dir_path, actual_path, sizeof(actual_path)))) 
     258          return retc; 
     259          else fname = strdup(actual_path); 
     260   } 
    248261   fname = strdup(path); 
    249262 
     
    473486/*         F i l e   S y s t e m   O b j e c t   I n t e r f a c e s          */ 
    474487/******************************************************************************/ 
    475    
     488  
     489/******************************************************************************/ 
     490/*                                  I n i t                                   */ 
     491/******************************************************************************/ 
     492 
     493/* 
     494  Function: Initialize HDFS system. 
     495 
     496  Input:    None 
     497 
     498  Output:   Returns zero upon success otherwise (-errno). 
     499*/ 
     500int XrdHdfsSys::Init(XrdSysLogger *lp, const char *configfn) 
     501
     502   int NoGo; 
     503   const char *tmp; 
     504 
     505// Do the herald thing 
     506// 
     507   eDest.logger(lp); 
     508   eDest.Say("Copr. 2009, Brian Bockelman, Hdfs Version " XrdHdfsSVNID); 
     509 
     510// Initialize the subsystems 
     511// 
     512   tmp = ((NoGo=Configure(configfn)) ? "failed." : "completed."); 
     513   eDest.Say("------ HDFS storage system initialization ", tmp); 
     514 
     515// All done. 
     516// 
     517   return NoGo; 
     518
     519  
    476520/******************************************************************************/ 
    477521/*                            g e t V e r s i o n                             */ 
  • XrdHdfs/XrdHdfs.hh

    r3552 r3588  
    129129 
    130130/******************************************************************************/ 
    131 /*                          X r d H d f s                           */ 
     131/*                          X r d H d f s S y s                               */ 
    132132/******************************************************************************/ 
    133133   
     
    174174                            const char *y=""); 
    175175 
     176char             *N2N_Lib;   // -> Name2Name Library Path 
     177char             *N2N_Parms; // -> Name2Name Object Parameters 
     178XrdOucName2Name  *the_N2N;   // -> File mapper object 
     179 
    176180XrdHdfsSys() : XrdOss() {} 
    177181virtual ~XrdHdfsSys() {} 
    178182 
     183private: 
     184 
     185int    Configure(const char *); 
     186int    ConfigN2N(XrdSysError &Eroute); 
     187int    ConfigProc(XrdSysError &Eroute); 
     188int    ConfigXeq(char *, XrdOucStream &, XrdSysError &); 
     189int    xnml(XrdOucStream &Config, XrdSysError &Eroute); 
     190 
    179191}; 
    180192#endif