diff --git a/Makefile.in b/Makefile.in index 312535f353..7ba5141e6a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -335,6 +335,9 @@ dvolser: project tviced usd libafsrpc libafsauthent volser echo Not building DAFS volser for ${SYS_NAME} ;; \ esac +rxosdsrc: rxgen + ${COMPILE_PART1} rxosd ${COMPILE_PART2A} source + venus: cmd comerr volser ptserver +${COMPILE_PART1} venus ${COMPILE_PART2} +${COMPILE_PART1} venus/test ${COMPILE_PART2} @@ -468,7 +471,7 @@ ${DEST}/bin/dedebug: dedebug # libafs build targets # libafs: config export lwp_depinstall rx_depinstall vlserver_depinstall tvlserver_depinstall rxkad_depinstall fsint_depinstall \ - libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall auth_depinstall + libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall auth_depinstall rxosdsrc src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME} +${COMPILE_PART1} libafs ${COMPILE_PART2} @@ -885,6 +888,7 @@ distclean: clean src/rxgen/Makefile \ src/rxkad/Makefile \ src/rxkad/test/Makefile \ + src/rxosd/Makefile \ src/rxstat/Makefile \ src/scout/Makefile \ src/sgistuff/Makefile \ diff --git a/configure.ac b/configure.ac index 9f42d8ec86..136ee59054 100644 --- a/configure.ac +++ b/configure.ac @@ -204,6 +204,7 @@ src/rxdebug/Makefile \ src/rxgen/Makefile \ src/rxkad/Makefile \ src/rxkad/test/Makefile \ +src/rxosd/Makefile \ src/rxstat/Makefile \ src/scout/Makefile \ src/sgistuff/Makefile \ diff --git a/src/rxosd/.gitignore b/src/rxosd/.gitignore new file mode 100644 index 0000000000..0369bdf6ce --- /dev/null +++ b/src/rxosd/.gitignore @@ -0,0 +1,7 @@ +# After changing this file, please run +# git ls-files -i --exclude-standard +# to check that you haven't inadvertently ignored any tracked files. + +/rxosd +/readabyte +/osd diff --git a/src/rxosd/Makefile.in b/src/rxosd/Makefile.in new file mode 100644 index 0000000000..6b9dcd164d --- /dev/null +++ b/src/rxosd/Makefile.in @@ -0,0 +1,199 @@ +# Generated automatically from Makefile.in by configure. +# +# Copyright (c) 2006, Hartmut Reuter, +# RZG, Max-Planck-Institut f. Plasmaphysik. +# All Rights Reserved. +# +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config +include @TOP_OBJDIR@/src/config/Makefile.pthread + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +HSM_LIB=@HSM_LIB@ +HSM_INC=@HSM_INC@ + +VICED=../viced +VLSERVER=../vlserver +LWP=../lwp +LIBACL=../libacl +UTIL=../util +DIR=../dir +VOL=../vol +OSDDBSRC=${srcdir}/../osddb +FSINT=../fsint + +CC=${MT_CC} + +CLIENTOBJS=osd.o + +RXOSDOBJS=rxosd.o rxosd.ss.o rxosd.cs.o rxosd.xdr.o rxosd_hpss.o rxosd_dcache.o + +LWPOBJS=lock.o threadname.o + +UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o + +VOLOBJS= devname.o common.o ihandle.o namei_ops.o + +OSDDBOBJS=osddb.cs.o osddb.xdr.o osddbuser.o + +objects= ${RXOSDOBJS} ${LWPOBJS} ${UTILOBJS} ${VOLOBJS} ${OSDDBOBJS} + +LIBS=${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/libcmd.a + +source: rxosd.h rxosd.cs.c rxosd.xdr.c Krxosd.cs.c Krxosd.xdr.c ${TOP_INCDIR}/afs/rxosd.h + +all: Krxosd.cs.c Krxosd.xdr.c rxosd.h \ + ${TOP_INCDIR}/afs/rxosd.h ${TOP_LIBDIR}/librxosd.a + + +dest: all + +${TOP_INCDIR}/afs/rxosd.h: rxosd.h + ${INSTALL} $? $@ + +osd: osd.o rxosd.cs.o osddbuser.o policy_parser.o + ${AFS_LDRULE} osd.o rxosd.cs.o rxosd.xdr.o policy_parser.o \ + ${OSDDBOBJS} ${LIBS} ${MT_LIBS} ${XLIBS} + +CFLAGS_rxosd.o = ${HSM_INC} ${PNFS_OPT} -DBUILDING_RXOSD + +CFLAGS_hpss.o = ${HSM_INC} ${PNFS_OPT} -DBUILDING_RXOSD + +CFLAGS_dcache.o = ${HSM_INC} ${PNFS_OPT} -DBUILDING_RXOSD + +policy_parser.o: policies.tab.c + ${AFS_CCRULE} policy.tab.c + +policies.tab.c: policies.y + ${YACC} -b policies ${srcdir}/policies.y + +assert.o: ${UTIL}/assert.c + ${AFS_CCRULE} ${UTIL}/assert.c + +uuid.o: ${UTIL}/uuid.c + ${AFS_CCRULE} ${UTIL}/uuid.c + +serverLog.o: ${UTIL}/serverLog.c + ${AFS_CCRULE} ${UTIL}/serverLog.c + +fileutil.o: ${UTIL}/fileutil.c + ${AFS_CCRULE} ${UTIL}/fileutil.c + +volparse.o: ${UTIL}/volparse.c + ${AFS_CCRULE} ${UTIL}/volparse.c + +flipbase64.o: ${UTIL}/flipbase64.c + ${AFS_CCRULE} ${UTIL}/flipbase64.c + +netutils.o: ${UTIL}/netutils.c + ${AFS_CCRULE} ${UTIL}/netutils.c + +dirpath.o: ${UTIL}/dirpath.c + ${AFS_CCRULE} ${UTIL}/dirpath.c + +softsig.o: ${UTIL}/softsig.c + ${AFS_CCRULE} ${UTIL}/softsig.c + +lock.o: ${LWP}/lock.c + ${AFS_CCRULE} ${LWP}/lock.c + +threadname.o: ${LWP}/threadname.c + ${AFS_CCRULE} ${LWP}/threadname.c + +netprocs.o: ${LIBACL}/netprocs.c + ${AFS_CCRULE} ${LIBACL}/netprocs.c + +devname.o: ${VOL}/devname.c + ${AFS_CCRULE} ${VOL}/devname.c + +# only for darwin +fstab.o: ${VOL}/fstab.c + ${AFS_CCRULE} ${VOL}/fstab.c + +common.o: ${VOL}/common.c + ${AFS_CCRULE} ${VOL}/common.c + +CFLAGS_ihandle.o=-DBUILDING_RXOSD + +ihandle.o: ${VOL}/ihandle.c + ${AFS_CCRULE} ${VOL}/ihandle.c + +CFLAGS_namei_ops.o = ${HSM_INC} ${PNFS_OPT} -DBUILDING_RXOSD + +namei_ops.o: ${VOL}/namei_ops.c + ${AFS_CCRULE} ${VOL}/namei_ops.c + +osddb.h: ${OSDDBSRC}/osddb.xg + ${RXGEN} -x -h -o $@ ${OSDDBSRC}/osddb.xg + +osddb.cs.c: ${OSDDBSRC}/osddb.xg osddb.h + ${RXGEN} -x -C -o $@ ${OSDDBSRC}/osddb.xg + +osddb.xdr.c: ${OSDDBSRC}/osddb.xg osddb.h + ${RXGEN} -x -c -o $@ ${OSDDBSRC}/osddb.xg + +osddbuser.o: ${OSDDBSRC}/osddbuser.c + ${AFS_CCRULE} ${OSDDBSRC}/osddbuser.c + +afsaux.o: ${FSINT}/afsaux.c + ${AFS_CCRULE} ${FSINT}/afsaux.c + +rxosd.ss.c: rxosd.xg rxosd.h + ${RXGEN} -x -S -o $@ ${srcdir}/rxosd.xg + +rxosd.cs.c: rxosd.xg rxosd.h + ${RXGEN} -x -C -o $@ ${srcdir}/rxosd.xg + +Krxosd.cs.c: rxosd.xg rxosd.h + ${RXGEN} -x -k -C -o $@ ${srcdir}/rxosd.xg + +rxosd.xdr.c: rxosd.xg rxosd.h + ${RXGEN} -x -c -o $@ ${srcdir}/rxosd.xg + +Krxosd.xdr.c: rxosd.xg rxosd.h + ${RXGEN} -x -k -c -o $@ ${srcdir}/rxosd.xg + +rxosd.h: rxosd.xg + ${RXGEN} -x -h -o $@ ${srcdir}/rxosd.xg + +rxosd: rxosd.h ${objects} ${LIBS} + ${AFS_LDRULE} -ldl ${objects} ${LIBS} ${MT_LIBS} ${XLIBS} \ + ${HSM_LIB} + +CFLAGS_readabyte.o = ${HSM_INC} ${PNFS_OPT} -DBUILDING_RXOSD + +readabyte: readabyte.o + ${AFS_LDRULE} -ldl readabyte.o rxosd_hpss.o rxosd_dcache.o \ + ${MT_LIBS} ${HSM_LIB} + +librxosd.a: rxosd.xdr.o rxosd.cs.o + ${RM} -f $@ + ${AR} crv $@ rxosd.xdr.o rxosd.cs.o + ${RANLIB} $@ + +${TOP_LIBDIR}/librxosd.a: librxosd.a + ${INSTALL} $? $@ + +install: + ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir} + ${INSTALL} -d ${DESTDIR}${bindir} + ${INSTALL_PROGRAM} rxosd ${DESTDIR}}${afssrvlibexecdir}/rxosd + ${INSTALL_PROGRAM} readabyte ${DESTDIR}${afssrvlibexecdir}/readabyte + ${INSTALL_PROGRAM} osd ${DESTDIR}${bindir}/osd + +dest: + ${INSTALL} -d ${DEST}/root.server/usr/afs/bin + ${INSTALL} -d ${DEST}/bin + ${INSTALL_PROGRAM} rxosd ${DEST}/root.server/usr/afs/bin/rxosd + ${INSTALL_PROGRAM} readabyte ${DEST}/root.server/usr/afs/bin/readabyte + ${INSTALL_PROGRAM} osd ${DEST}/bin/osd + +clean: + $(RM) -f *.o rxosd.*.* rxosd.[oh] Krxo* osd core AFS_component_version_number.c osddb* policy_parser.c + +include ../config/Makefile.version + diff --git a/src/rxosd/rxosd.xg b/src/rxosd/rxosd.xg new file mode 100644 index 0000000000..53ccfacb53 --- /dev/null +++ b/src/rxosd/rxosd.xg @@ -0,0 +1,320 @@ +/* + * RX OSD interface description + */ + +package RXOSD_ +prefix S + +%#include +%#include + +/* prototype for pseudo-RPC call */ +%char *RXOSD_TranslateOpCode(afs_int32 code); + +%#define OSD_SERVER_PORT htons(7011) /* as MR-AFS remioserver */ +%#define OSD_SERVICE_PORT htons(0) +%#define OSD_SERVICE_ID 900 /* same as REMIOSRV for MR-AFS */ +%#define OSD_NULL 0 +%#define OSD_RXKAD 2 +%#define RXOSD_RESTARTING -100 + +%#ifndef OSD_WAIT_FOR_TAPE +%#define OSD_WAIT_FOR_TAPE 1096 +%#endif + +%#define T10_CDB_SIZE 200 + +typedef opaque t10rock; + +%#define CAPCRYPTLEN 72 +struct t10cap { + afs_uint32 pid_hi; + afs_uint32 pid_lo; + afs_uint32 oid_hi; + afs_uint32 oid_lo; + afs_uint32 maxlen_hi; + afs_uint32 maxlen_lo; + afs_uint32 ip; + short port; + short reserved; + afsUUID uuid; + afs_uint32 cap; + afs_uint32 expires; + afs_uint32 user; + afs_uint32 spare[3]; + afs_uint32 epoch; + afs_uint32 cid; +}; + +struct t10sec { + char check[20]; + char nonce[12]; + char datain[4]; + char dataout[4]; +}; + +struct t10cdb { + char operation; + char control; + char res1[5]; + char lng; + char action[2]; + char service[6]; + char pid[8]; + char oid[8]; + char res2[4]; + char length[8]; + char offset[8]; + char attrparm[28]; + struct t10cap cap; + struct t10sec sec; +}; + +struct osd_incdec { + afs_uint64 oid; + afs_uint64 pid; + afs_int32 todo; + afs_int32 done; +}; +typedef struct osd_incdec osd_incdecList <>; + +struct osd_md5 { + afs_uint64 oid; + afs_uint64 pid; + afs_uint64 size; + afs_uint32 md5[4]; +}; + +struct osd_obj_desc { + afs_uint64 oid; + afs_uint64 pid; + afs_uint32 id; + afs_uint32 ip; + afs_uint32 stripe; +}; +typedef struct osd_obj_desc osd_obj_descList <>; + +struct osd_segm_desc { + afs_uint64 length; + afs_uint32 stripes; + afs_uint32 stripe_size; + osd_obj_descList objList; +}; +typedef struct osd_segm_desc osd_segm_descList <>; + +struct rxosd_fetch_entry { + afs_uint64 part_id; + afs_uint64 obj_id; + afs_uint32 user; + afs_uint32 time; + afs_uint32 fileserver; + struct osd_segm_descList list; +}; +typedef struct rxosd_fetch_entry rxosd_fetch_entryList<>; + +%#define TAPE_FETCH 1 +%#define XFERING 2 +%#define SET_FILE_READY 3 + +struct FetchEntry { + afs_uint32 Requestor; + afs_uint32 TimeStamp; + afs_uint32 Volume; + afs_uint32 Vnode; + afs_uint32 Uniquifier; + afs_uint32 rank; + afs_uint32 state; + afs_uint32 caller; +}; +typedef FetchEntry FetchEntryList<>; + +struct WipeCandidate { + afs_uint64 p_id; + afs_uint64 o_id; + afs_uint64 size; + afs_uint32 atime; +}; +typedef WipeCandidate WipeCandidateList<>; + +struct activerpc { + afs_uint32 num; + afs_uint32 ip; + afs_uint64 part; + afs_uint64 obj; +}; +typedef activerpc activerpcList<>; + +struct varname { + char name[64]; +}; + +struct rxosd_stat { + afs_uint32 rpc; + afs_uint64 cnt; +}; +typedef rxosd_stat rxosd_statList<>; + +struct rxosd_kbps { + afs_uint32 val[96]; +}; + +create_part (IN afs_uint64 part_id) = 1; + +create (IN afs_uint64 part_id, + IN afs_uint64 from_id, + OUT afs_uint64 *obj_id) = 2; + +hardlink (IN afs_uint64 from_part, + IN afs_uint64 from_id, + IN afs_uint64 to_part, + IN afs_uint64 to_id, + OUT afs_uint64 *obj_id) = 3; + +write (IN t10rock rock, + IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 offset, + IN afs_uint64 length) split = 4; + +write_keep (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 offset, + IN afs_uint64 length, + IN afs_uint32 atime, + IN afs_uint32 mtime) split = 5; + +writePS (IN t10rock rock, + IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 offset, + IN afs_uint64 length, + IN afs_uint32 stripe_size, + IN afs_uint32 nstripes, + IN afs_uint32 mystripe) split = 6; + +read (IN t10rock rock, + IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 offset, + IN afs_uint64 length) split = 7; + +readPS (IN t10rock rock, + IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 offset, + IN afs_uint64 length, + IN afs_uint32 stripe_size, + IN afs_uint32 nstripes, + IN afs_uint32 mystripe) split = 8; + +truncate (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint64 length) = 9; + +incdec (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_int32 diff) = 10; + +bulkincdec (INOUT osd_incdecList *list) = 11; + +remove_part (IN afs_uint64 part_id) = 12; + +list (IN afs_uint64 part_id, + IN afs_uint64 start_id) split = 13; + +examine (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + OUT afs_uint64 *size, + OUT afs_uint32 *linkcount, + OUT afs_uint32 *mtime, + OUT afs_uint32 *atime) = 14; + +examineHSM (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + OUT afs_uint64 *size, + OUT afs_uint32 *linkcount, + OUT afs_uint32 *time, + OUT afs_int32 *status) = 15; + +list_part (IN afs_uint64 start_id) split = 16; + +copy (IN afs_uint64 from_part, + IN afs_uint64 to_part, + IN afs_uint64 from_id, + IN afs_uint64 to_id, + IN afs_uint32 to_osd) = 17; + +CopyOnWrite (IN afs_uint64 part_id, + IN afs_uint64 from_id, + IN afs_uint64 offs, + IN afs_uint64 length, + IN afs_uint64 size, + OUT afs_uint64 *obj_id) = 18; + +Dummy (IN afs_uint32 in, + OUT afs_uint32 *out) = 19; + +md5sum (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + OUT struct osd_md5 *md5) = 20; + +create_archive (IN afs_uint64 part_id, + IN afs_uint64 from_id, + IN struct osd_segm_descList *list, + OUT struct osd_md5 *output) = 21; + +restore_archive (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint32 user, + IN struct osd_segm_descList *listi, + OUT osd_md5 *output) = 22; + +close_file (IN afs_uint64 part_id, + IN afs_uint64 obj_id) = 23; + +fetchqueue (OUT FetchEntryList *list) = 24; + +wipe_candidates (IN afs_uint32 lun, + IN afs_uint32 max, + IN afs_uint32 algorithm, + IN afs_uint32 minMB, + IN afs_uint32 spare, + OUT WipeCandidateList *list) = 25; + +Variable (IN afs_int32 cmd, + IN string name<256>, + IN afs_int64 value, + OUT afs_int64 *result) = 26; + +threads (OUT struct activerpcList *list) = 27; + +statistic (IN afs_int32 reset, + OUT afs_uint32 *since, + OUT afs_uint64 *received, + OUT afs_uint64 *sent, + OUT rxosd_statList *stat, + OUT struct rxosd_kbps *kbpsrcvd, + OUT struct rxosd_kbps *kbpssent) = 28; + +setatime (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN afs_uint32 atime, + IN afs_uint32 mtime) = 29; + +updatecounters (IN afs_uint64 bytes_rcvd, + IN afs_uint64 bytes_sent) = 30; + +write_to_hpss (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN struct osd_segm_descList *list, + OUT osd_md5 *output) = 31; + +read_from_hpss (IN afs_uint64 part_id, + IN afs_uint64 obj_id, + IN struct osd_segm_descList *list, + OUT osd_md5 *output) = 32; + +ProbeServer () = 33; + +/* end package */ +