EldoS | Feel safer!

Software components for data protection, secure storage and transfer

AddMountingPoint Delays

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#24516
Posted: 04/09/2013 21:25:41
by ujsoft (Basic support level)
Joined: 04/09/2013
Posts: 2

Hi,

I am experiencing noticable delays on calls to AddMountingPoint.
I start several processes that execute the code below.
The observation is that every other process gets delayed
on the call to AddMountingPoint.

CbFs driver version is 4.0.127.309.
Calling from 32 bit process on Windows 7 64 bit

Any ideas what may be the reason?


Thank you.

Code:
Code
  FCbFS := TCallbackFileSystem.Create(nil);
  FCbFsBridge := TCbFsEventHandlerBridge.Create(FCbFs, SyncLayer);

  FCbFs.OnFlushFile := nil;
  FCbFs.OnGetFileNameByFileId := nil;
  FCbFs.OnGetFileSecurity := nil;
  FCbFs.OnSetFileSecurity := nil;

  FCbFS.SerializeCallbacks := True;
  FCbFS.MetaDataCacheEnabled := False;
  FCbFS.CallAllOpenCloseCallbacks := True;
  FCbFS.ShortFileNameSupport := False;

  FCbFS.SetRegistrationKey(CBFS_RegKey);
  FCbFS.GetModuleStatus(CBFS_Guid, CBFS_MODULE_DRIVER, Installed, VersionHigh,
    VersionLow, nil);
  if not Installed then
    raise Exception.Create(SDriverNotInstalled);

  FCbFs.Initialize('713CC6CE-B3E2-4fd9-838D-E28F558F6866');
  FCbFS.CreateStorage;
  FCbFS.MountMedia(0);

  FCbFS.AddMountingPoint(MountAs, CBFS_SYMLINK_SIMPLE, nil);  //<<< DELAY !!!
#24517
Posted: 04/09/2013 23:40:22
by Eugene Mayevski (EldoS Corp.)

First please remember to mark your code pieces with CODE tag or corresponding CODE button above the message box on this page.


Now to your question. Check if Mapper sample exposes the same problem. If it does, then it's something in the system ( some antivirus, application firewall etc) slows down operations.

If Mapper works fine but your code doesn't, try to narrow down the problem by commenting out logic in event handlers changing StorageType and StorageCharacteristics


Sincerely yours
Eugene Mayevski
#24558
Posted: 04/10/2013 17:50:08
by ujsoft (Basic support level)
Joined: 04/09/2013
Posts: 2

Eugene,

Below is console version of Mapper sample provided with CbFs.
It uses Eldos code in Main.pas, but this is console application.
Attached is a screenshot of what I see on my PC.
Like I said every other process gets delayed on call to FCbFs.AddMountingPoint.
Simply run this program from Windows Explorer and hopefully you will see the problem.

Thanks a lot,


Code
program ConsoleMapper;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  Windows,
  SysUtils,
  Main in 'C:\Program Files (x86)\EldoS\Callback File System\Samples\VCL\Mapper\Main.pas' {frmMain};

const
  DriveLetters: array[0..3] of Char = ('K', 'L', 'M', 'N');

function FindDriveLetter: Char;
var
  I: Integer;
  Root: string;
begin
  Result := #0;
  for I := Low(DriveLetters) to High(DriveLetters) do
  begin
    Root := DriveLetters[I] + ':\';
    if GetDriveType(PChar(Root)) = DRIVE_NO_ROOT_DIR then
    begin
      Result := DriveLetters[I];
      Exit;
    end;
  end;
end;

var
  DriveLetter: Char;
  TickCount: Cardinal;
begin
  DriveLetter := FindDriveLetter;
  if DriveLetter <> #0 then
  try
    frmMain := TfrmMain.Create(nil);
    try
      frmMain.edtRootPath.Text := ExtractFilePath(ParamStr(0));
      frmMain.edtMountinPoint.Text := DriveLetter + ':';
      frmMain.btnMountClick(nil);

      TickCount := GetTickCount();
      Writeln(Format('Adding mounting point %s: ...', [DriveLetter]));
      frmMain.btnAddPointClick(nil);

      Writeln(Format('Done. Elapsed: %d ms', [GetTickCount() - TickCount]));

      Writeln('Press Enter to exit...');
      Readln;
      frmMain.btnDeletePointClick(nil);
      frmMain.btnUnmountClick(nil);
    finally
      frmMain.Free;
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.


#24568
Posted: 04/11/2013 03:31:06
by Volodymyr Zinin (EldoS Corp.)

Moved to helpdesk.

Reply

Statistics

Topic viewed 1227 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!