public static FsImageProto.INodeSection.INodeDirectory.Builder BuildINodeDirectory (INodeDirectoryAttributes dir, FSImageFormatProtobuf.SaverContext state) { QuotaCounts quota = dir.GetQuotaCounts(); FsImageProto.INodeSection.INodeDirectory.Builder b = FsImageProto.INodeSection.INodeDirectory .NewBuilder().SetModificationTime(dir.GetModificationTime()).SetNsQuota(quota.GetNameSpace ()).SetDsQuota(quota.GetStorageSpace()).SetPermission(BuildPermissionStatus(dir, state.GetStringMap())); if (quota.GetTypeSpaces().AnyGreaterOrEqual(0)) { b.SetTypeQuotas(BuildQuotaByStorageTypeEntries(quota)); } AclFeature f = dir.GetAclFeature(); if (f != null) { b.SetAcl(BuildAclEntries(f, state.GetStringMap())); } XAttrFeature xAttrFeature = dir.GetXAttrFeature(); if (xAttrFeature != null) { b.SetXAttrs(BuildXAttrs(xAttrFeature, state.GetStringMap())); } return(b); }
public override bool MetadataEquals(INodeDirectoryAttributes other) { return(other != null && GetQuotaCounts().Equals(other.GetQuotaCounts()) && GetPermissionLong () == other.GetPermissionLong() && GetAclFeature() == other.GetAclFeature() && GetXAttrFeature () == other.GetXAttrFeature()); }