Esempio n. 1
0
            /// <exception cref="System.IO.IOException"/>
            private INodeReference LoadINodeReference(FsImageProto.INodeReferenceSection.INodeReference
                                                      r)
            {
                long  referredId = r.GetReferredId();
                INode referred   = fsDir.GetInode(referredId);

                INodeReference.WithCount withCount = (INodeReference.WithCount)referred.GetParentReference
                                                         ();
                if (withCount == null)
                {
                    withCount = new INodeReference.WithCount(null, referred);
                }
                INodeReference @ref;

                if (r.HasDstSnapshotId())
                {
                    // DstReference
                    @ref = new INodeReference.DstReference(null, withCount, r.GetDstSnapshotId());
                }
                else
                {
                    @ref = new INodeReference.WithName(null, withCount, r.GetName().ToByteArray(), r.
                                                       GetLastSnapshotId());
                }
                return(@ref);
            }
Esempio n. 2
0
 private void DumpINodeReference(FsImageProto.INodeReferenceSection.INodeReference
                                 r)
 {
     @out.Write("<ref>");
     O("referredId", r.GetReferredId()).O("name", r.GetName().ToStringUtf8()).O("dstSnapshotId"
                                                                                , r.GetDstSnapshotId()).O("lastSnapshotId", r.GetLastSnapshotId());
     @out.Write("</ref>\n");
 }