diff --git a/RapidCopy_ja_JP.qm b/RapidCopy_ja_JP.qm index fa65091..cf1833d 100644 Binary files a/RapidCopy_ja_JP.qm and b/RapidCopy_ja_JP.qm differ diff --git a/RapidCopy_ja_JP.ts b/RapidCopy_ja_JP.ts index 5784680..70ab8dd 100644 --- a/RapidCopy_ja_JP.ts +++ b/RapidCopy_ja_JP.ts @@ -1020,223 +1020,223 @@ Please check to think well the order dependent.<br> QObject - + Source path to copy. - + Specify operation mode.(Default: dif) - + Specify the job that is already registered. - + Specify the joblist that is already registered. - + Specify the size(MB) of the main buffer for Read/Write opration. - + Write to the detailed filelog(detail of copy/delete files with checksum) It is stored YYYY/MM/DD-hh:mm:ss-N.log in RapidCopy/Log directory. - + Specify the filename of standard logfile. - + Write the operation/errors information to the standard logfile(RapidCopy.log). - + Copy symlink as link. - + Start at once without waiting for the finish of other FastCopy executing. - + Skip to create empty directories when /include or /exclude option is used. - + Show error dialog (and operation is interrupted), if an error occurred. - + Estimate complete time. - + Verify written files data. - + Specify speed control level. - + Rename filename and wipe(overwrite Random data) before deleting. - + Copy ACL (only HFS+). - + Copy EA(Extend Attribute). - + Reproduce hardlink as much as possible. - + Change updating behavior overwrite the target to delete and recreate the target. (If /linkdest option is enabled, this option is enabled by default.) If you want always to enable, write [main] recreate=1 in RapidCopy.ini - + Specify source files by textfile. User is able to describe 1 filename per line. - + Don't stored in the task tray. - + Close automatically after execution is finished with no errors. - + Close automatically and forcedly after execution is finished. - + Don't start to execute. - + Specify Auto/Same/Diff HDD mode. (default: auto) - + Specify include filter. - + Specify exclude filter. - + Specify oldest timestamp filter. - + Specify newest timestamp filter. - + Specify minimum size filter. - + Specify maximum size filter. - + Don't confirm before deleting. - + Don't Show error dialog, Even if critical errors occurred. - + Specify post-process action name. - + Destination Directory.(If delete mode is specified, then to option isn't used. - + LTFS mode. - + Ignore hidden files and folders that begin from the . - + Specifies the window x position at startup. Must specify with --ypos. - + Specifies the window y position at startup. Must specify with --xpos. - + Write to the csv file(based on deteiled file log)It is stored YYYY/MM/DD-hh:mm:ss-N.csv in RapidCopy/Log directory. - + illgal option -- - + Too small(<300000) hashtable for linkdest. - + Can't open: @@ -1432,7 +1432,9 @@ Please refer to help for details or DestDir field Tooltip. - http://www.lespace.co.jp/file_bl/rapidcopy/manual/ + + https://github.com/KengoSawa2/RapidCopy + http://www.lespace.co.jp/file_bl/rapidcopy/manual/ http://www.lespace.co.jp/file_bl/rapidcopy/manual/ @@ -1593,19 +1595,19 @@ Please send this file to author. - + Standby スタンバイ - + Hibernate ハイバネート - + Shutdown シャットダウン @@ -1769,11 +1771,6 @@ YYYYMMDD ex) 20090101 CLI mode is not Supported. コマンドラインモードはサポートしていません - - - http://www.lespace.co.jp/file_bl/rapidcopy/manual/index_en.html - - RapidCopyPro update detected. 新しいバージョンがあります @@ -1842,7 +1839,7 @@ Disk devices,FileSystems,drivers,cables.... "新しいウインドウを開く"をRapidCopyの実行中に行うことはできません。 - + ves @@ -1861,17 +1858,17 @@ Disk devices,FileSystems,drivers,cables.... 正常時/エラー時 - + RapidCopy RapidCopy - + Clear path パスをクリア - + Diff (Size) Diff (Name/Size) 差分(サイズ) @@ -1881,27 +1878,27 @@ Disk devices,FileSystems,drivers,cables.... nas - + ea ea - + nodot - + xpos - + ypos - + %04d%02d%02d-%02d%02d%02d-%d%s.csv @@ -1911,29 +1908,29 @@ Disk devices,FileSystems,drivers,cables.... コピー先にNTFSディレクトリを指定する事はできません。 - + The case from the sensitive file system you are trying to copy a file system that is case-insensitive. Change the source file name or change the case sensitive file system. 大文字小文字を区別するファイルシステムから大文字小文字を区別しないファイルシステムにコピーしようとしています。 コピー元のファイル名を変更するか、大文字小文字を区別するファイルシステムに変更してください。 - + FinAct Saved/Created. 終了時処理を保存/作成しました。 - + FinAct Deleted. 終了時処理を削除しました - + Job Saved/Created. ジョブを保存/作成しました。 - + Job Add Error. ジョブ追加でエラーが発生しました @@ -1968,65 +1965,65 @@ Are you sure you want to quit the RapidCopyPro? RapidCopyPro ライセンス情報: - + Filesize change detected. Check file. ファイルサイズ変更を検知しました。ファイルを確認してください。 - + Warning:LTFS prohibit character detected. Prohibit character Convert to _ LTFS禁則文字を検出したため、"_"に自動置換しました。 - + LTFS prohibit character Convert error. You need to do the conversion process. LTFS禁則文字の自動置換に失敗しました。コピー元のLTFS禁則文字を変更してください。 - + JobList Created. JobList Saved/Created. ジョブリストを作成しました。 - + JobList Created Error.Plz Report. JobList Saved/Created Error. ジョブリストの作成でエラーが発生しました。作者に連絡してください。 - + Job will delete. Are you ok? ジョブを削除します、よろしいですか? - + JobList Deleted. ジョブリストを削除しました。 - + JobList Deleted Error. ジョブリスト削除に失敗しました。 - + JobList Entry Max detected. max = 256 ジョブリストに登録できる上限を超えました。256個以内にしてください。 - + JobGroup delete Error. plz report. ジョブグループ削除でエラーが発生しました。作者に連絡してください。 - + input/select JobList name Set JobListName 新規作成/削除するジョブリスト名を入力または選択 - + Cancel JobList ジョブリストキャンセル @@ -2035,17 +2032,17 @@ Are you sure you want to quit the RapidCopyPro? 登録 - + Operation not permitted. check file. 当該操作は許可されていません、ファイルへのアクセス権限を確認してください。 - + Maximum allowable hard links to a single file has been exceeded. hardlink operation has been canceled. - + Notice: EA has been lost. EA name is below. Notice: EA has been lost. EA name = 注意:EAはコピーされません、EAの名称は以下の通りです。 @@ -2055,12 +2052,12 @@ Are you sure you want to quit the RapidCopyPro? OS標準の効果音を選択してください - + About %s %s について - + Enter Copy Destination folder in the DestDir button or drag-and-drop. Put '/' at the end, create a folder of the source folder name to the destination. Don't put a '/' at the end, copy the data directly below the source folder to the destination. @@ -2073,124 +2070,129 @@ Don't put a '/' at the end, copy the data directly below the sour ジョブを削除しました。 - + Wait for finish action... 終了時処理に設定した各アクションの終了を待っています... - + RapidCopy Execution finished. RapidCopyの実行が終了しました - + Input %d Path. 入力パス数:%d - + Added %d Path. Total %d Paths. 追加パス数:%d 合計パス数:%d - + Please make sure the source or destination is set. コピー元とコピー先が指定されているか 確認してください - + Source paths is too long. Reduce the paths. Source paths is too long. Reduce the paths within 1MB. コピー元に指定したパス長が長すぎます。パス数を減らしてください。 - + Source cleared. コピー元パスをリセットしました - + Dest cleared. コピー先パスをリセットしました - + Can't select the other sound of RapidCopy folder. You can not select the other sound of RapidCopy folder. 未使用 RapidCopyフォルダ以外のフォルダは指定できません。 - + No sound. サウンド無し - + Execute JobList ジョブリスト実行 - + Job Overwrite. ジョブ内容を上書きしました - + Single Jobs シングルジョブ一覧 - + is not saved. changing save? JobList is not saved. changing save? は保存されていません、保存しますか? - + Job name changed. ジョブ名称を変更しました。 - + The name is duplicate. Please renameing. ジョブ名が重複しています。 - + JobLists ジョブリスト一覧 - + Can't Save/Delete JobList Job. Please renaming. ジョブリスト名の保存/削除に失敗しました。別の名称を指定してください。 - + JobList Rename ジョブリストリネーム - + JobList will delete. Are you ok? ジョブリストを削除します。 - + All Job will delete. Are you ok? 全てのジョブを削除します。 - + job changed detected. If you want save(overwrite), press Option+S job changed detected. If you want save(overwrite) Plz press ⌥+S 現在選択中のジョブ内容の変更を検知しました。保存する場合はOption+Sで保存してください。 - + + LTFS prohibit character duplication detected. You should change source file/folder name. + + + + Enter Copy source files and folders in the Source button or drag-and-drop. コピー元ファイル/フォルダをダイアログやD&Dで入力します(複数入力可) @@ -2199,7 +2201,7 @@ Don't put a '/' at the end, copy the data directly below the sour コピー先フォルダをダイアログやD&Dで入力します - + Add/Modify/Del... 追加/変更/削除... @@ -2208,13 +2210,13 @@ Don't put a '/' at the end, copy the data directly below the sour 許可されていない操作を実行しました。ファイル名またはファイルの属性が適切か確認してください。 - + Call function is not supported on the system. Call function is not supported by the system. Plaease Report. 未サポートのシステムコールをコールしました。 - + Failed update Date information. Please re-run with [Diff (Size/date)]. 日時情報の更新に失敗しました。コピー終了後に差分(サイズ/日付)を再実行してください。 @@ -2225,129 +2227,129 @@ Don't put a '/' at the end, copy the data directly below the sour 許可されていない操作を実行しました。ファイル名またはファイルの属性が適切か確認してください。 - + No such file or directory. check exists. No such file or directory. check file exists. コピー中のstat等で、対象ファイルが消えていると出力される。 ファイルまたはディレクトリが見つからないので対象ファイルへの処理をキャンセルしました。実在を確認してください。 - + Interrupted function call. signalで割り込まれた場合に発生。 システム割り込み処理により、対象ファイルへの処理がキャンセルされました。対象ファイルのコピーを再実行してください。 - + An I/O error occurred while (read/write) file system. check Device or file system. デバイス都合とかで色々発生するはず I/Oエラーが発生しました。デバイスまたはファイルシステムが正常か確認してください。 - + A requested action cannot be performed by the device. キャラクタデバイスファイルまたはブロックスペシャルファイルへのopenで発生する可能性あり 特殊ファイルに対してシステムコールを実行しました。対象ファイルが通常のファイルであることを確認してください。 - + Arg list too long. setxattr等で異常な値を指定した場合に出力 システムコールで異常なサイズのデータを指定したため、当該処理をキャンセルしました。 - + Exec format error. たぶんでないので無視 - + Bad file descripter. check file permission. 不正ファイルハンドル指定です。アクセス権を確認後、問題が無ければレポートを送付してください。 - + Cannot allocate memory. please make sure sufficient amount of memory exists. システムメモリ不足です。メモリの空きを確認してからコピーを再実行してください。 - + Permission denied. check permission or system prohibit char usage. Permission denied. check permission. アクセス拒否です。アクセス権または禁止ファイル名でないか確認してください。 - + (read/write) operation internal error was occured. Plaease Report. readまたはwrite処理の内部矛盾が発生しました。レポートを送付してください。 - + Not a block device. check block device or file. たぶんでないので放置 ブロックデバイスではありません。ブロックデバイスか通常ファイルであることを確認してください。 - + Resource busy. check the system resource,run again. システムや他プログラムによって開かれているか、マウントポイントを指定しています。 - + file or directory exists. Please running again by removing the target file as necessary. 普通は先に削除するため、発生しない。隙間で何かやられた? 上書き書き込みに失敗しました。必要に応じて対象を削除した後にコピーを再実行してください。 - + A hard link to a file on another file system was attempted. hardlink operation has been canceled. ハードリンクをソース元と異なるディスクに作成する事はできません。 - + An attempt was made to apply an inappropriate function to a device. operation has been canceled. ファイルに対するmmap使ってないので出ないはず - + A component of the path prefix is not a directory. check file path. パス不正を検出しました。パスの一部がディレクトリではありません。 - + Directory for instructions intended for the file has been specified. check file. ディレクトリ対象処理でファイルが指定されました。パスを確認してください。 - + Invalid argument was passed to a system call. Please report. 不正引数指定により処理をキャンセルしました。レポートを送付してください。 - + Too many open files in system. close unnecessary files or extend the number of files open. システム定義値以上のファイルを開いています。不要ファイルを閉じるかシステム定義を変更してください。 - + Too many open files in RapidCopy. Please report. 内部矛盾 RapidCopyが不正に大量のファイルを開いているため失敗しました。レポートを送付してください。 - + File was greater than the maximum file size. check target file system file size limited. ファイルサイズの上限を越えたファイルを作成しようとしました。ファイルシステム仕様を確認してください。 - + There is no free space remaining on the file system containing the file. check the free space. ファイルシステムに空きがありません。空き容量を確保してください。 - + Tried to open a read-only file in writing. check permission or device. 読込専用ファイルを書込用にオープンしました。アクセス権または読込専用デバイスの確認をしてください。 @@ -2356,67 +2358,67 @@ Don't put a '/' at the end, copy the data directly below the sour システム定義のハードリンク上限を越えました。システム定義を変更するかハードリンクを減らしてください。 - + Resource temporarily unavailable. Resource temporarily unavailable. please Report. システムの一時的なリソース不足が発生しました。 - - + + Operation not supported at this file system. Can't support EA or ACL at this file system. Please note that EA or ACL has been lost. EA,ACLエラーログを有効にしていないと出力されない。追加メッセージでXATTRなのはACLなのかを説明する。 指定ファイル属性に未対応のファイルシステムです。 - + Network is down. check network connection. ネットワークダウンを検知しました。ネットワーク接続を確認してください。 - + Network is unreachable. check network connection. ネットワーク到達不能を検知しました。ネットワーク接続を確認してください。 - + Network is reset. check network connection. ネットワークリセットを検知しました。ネットワーク接続を確認してください。 - + Network connection is aborted. check network connection. ネットワークコネクション断を検知しました。ネットワーク接続を確認してください。 - + Network connection is reset. check network connection. ネットワークリセットを検知しました。ネットワーク接続を確認してください。 - + No socket buffer space available. check system socket buffer. ネットワークソケット用バッファ枯渇を検知しました。ソケット用バッファの状況を確認してください。 - + Time out detected. check network connection or target system. Time out detected. check network connection. タイムアウトを検知しました。ネットワーク環境や相手システムが正常か確認してください。 - + Too many levels of symbolic links. check loop symbolic link or MAXSIMLINKS. 解決不能なシンボリックリンクを検出しました。ループしていないか、またはMAXSIMLINKSシステム定義値を確認してください。 - + File name too long. check file path. ファイル名が長過ぎます。正常なファイル名かどうか確認してください。 - + Detected a write to disk quota limit. Please check the quota. ディスククオータ制限です。クオータによる制限がないか確認してください。 @@ -2426,17 +2428,17 @@ Don't put a '/' at the end, copy the data directly below the sour 対象のシステムコールが存在しません。作者にレポートを送付してください。 - + EA data not found. check file have EA or file system type. EAデータが見つかりませんでした。ファイルシステムがEAをサポートしているか確認してください。 - + Notice: EA has been lost. 注意:EAはコピーされません - + Notice: ACL has been lost. 注意:ACLはコピーされません @@ -2481,127 +2483,134 @@ Please refer to help for details. pushing the ? button. - + + Too large or small Main Buffer. + need %dMB or over and under 2047MB + メインバッファのサイズが小さすぎるか大きすぎます。 +最低でも%dM以上かつ2047以下の値を指定してください + + + noe noe - + dif dif - + upd upd - + for for - + syn syn - + mut mut - + mov mov - + del del - + cmd cmd - + bufsize bufsize - + error_stop error_stop - + open_window open_window - + auto_close auto_close - + force_close force_close - + no_exec no_exec - + no_confirm_del no_confirm_del - + log log - + to to - + estimate estimate - + job job - + auto_slow auto_slow - + speed speed - + ver ver - + joblist - + siz siz @@ -2610,7 +2619,7 @@ Please refer to help for details. pushing the ? button. ジョブを削除します。よろしいですか? - + Illegal option: --joblist Specified JobList can't be found @@ -2620,47 +2629,47 @@ Please refer to help for details. pushing the ? button. デフォルト - + include include - + exclude exclude - + force_start force_start - + skip_empty_dir skip_empty_dir - + disk_mode disk_mode - + same same - + diff diff - + auto auto - + acl acl @@ -2669,173 +2678,173 @@ Please refer to help for details. pushing the ? button. ea - + overwrite_del overwrite_del - + full full - + autoslow autoslow - + suspend suspend - + reparse reparse - + runas runas - + logfile logfile - + no_confirm_stop no_confirm_stop - + verify verify - + wipe_del wipe_del - + srcfile srcfile - + postproc postproc - + linkdest linkdest - + recreate recreate - + from_date from_date - + to_date to_date - + min_size min_size - + max_size max_size - + filelog filelog - + true true - + false false - + %04d%02d%02d-%02d%02d%02d-%d%s.log %04d%02d%02d-%02d%02d%02d-%d.log %04d%02d%02d-%02d%02d%02d-%d%s.log - + Log Log - + md5 md5 - + sh1 sh1 - + xxh xxh - + s22 s22 - + s25 s25 - + s32 s32 - + s35 s35 - + fnocache fnocache - + ltfs ltfs - + fal fal - + OpCode1,OpCode2,OpCode3,Destination Path,Checksum,FinishTime,FileSize(Byte),Error OpCode1,OpCode2,OpCode3,Destination Path,Digest,FinishTime,FileSize(Byte),Error @@ -2844,7 +2853,7 @@ Please refer to help for details. pushing the ? button. - + OpCode Reference: OpCode1:(A=Add R=Delete V=Verify E=Error) OpCode2:(N=Normal S=Symboliclink H=Hardlink ) @@ -2856,27 +2865,27 @@ OpCode2:(N=ノーマル S=シンボリックリンク H=ハードリンク) OpCode3:(F=ファイル D=フォルダ(ディレクトリ)) - + filecsv - + Full Speed Full Speed - + Auto Slow Auto Slow - + Suspend Suspend - + %d %d @@ -2885,7 +2894,7 @@ OpCode3:(F=ファイル D=フォルダ(ディレクトリ)) ACLエラーをログに記録する - + Nothing to use!!!!! unused @@ -3002,6 +3011,7 @@ OpCode3:(F=ファイル D=フォルダ(ディレクトリ)) + I/O Settings I/O設定 @@ -3063,23 +3073,59 @@ OpCode3:(F=ファイル D=フォルダ(ディレクトリ)) ジョブリストモードを常に表示する - + + <html><head/><body><p>Default:1MB unit and Overlap = 1</p></body></html> + <html><head/><body><p>Tips:16MB unit and OverLap = 8 normally better in 10G env.</p><p>Default:8MB unit and Overlap = 1</p></body></html> + <html><head/><body><p>デフォルト値:1MB*1</p></body></html> + + + Checksum algorithm ベリファイ方式 - + + AIO I/O num + 同時実行I/O数 + + + + I/O Unit (MB) + I/O単位(MB) + + + + MB(Total) + MB(Total) + + + + =Max I/O size + =Max I/O Size + + + Enable Readahead 先読み最適化を有効にする(Readahead) - + + Enable O_DIRECT(no use OS cache) + O_DIRECT有効(OSキャッシュ無効) + + + Don't update dst file/dir date(Note:Overwrite target in Diff mode) Don't update date(Note:Affects Diff mode. Read tech manual) コピー先の変更日を更新しない(差分コピー時、上書き対象になる) - + + If dst verify error occurs,don't save dump file (delete *.fc_verify_err) + dstでのベリファイエラー発生時、.rc_verify_errを生成しない + + + Write to detailed CSV (Log/DATE.csv) 詳細CSVデータを記録する(Log/DATE.csv) @@ -3134,16 +3180,15 @@ OpCode3:(F=ファイル D=フォルダ(ディレクトリ)) "."を無視 - Max I/O size (MB) - 最大I/O単位(MB) + 最大I/O単位(MB) Verify mode ベリファイ方式 - + Select hash algorithm. xxHash is an excellent in terms of CPU load and speed, but it is not suitable for data integrity evidence. For data integrity evidence, You should use "MD5" or others. @@ -3151,12 +3196,12 @@ For data integrity evidence, You should use "MD5" or others. xxHashが最もCPU使用率が低く高速ですが、チェックサム用にはMD5を選択する方が良いでしょう。 - + collect stat(for debug) 統計情報を取得(デバッグ用) - + Set the request size at the time of data read/write. If you are doing the ultra-high-speed network connection(such as 10G Ether). you may want to set the 4-8. Set the request size at the time of data read/write. @@ -3165,38 +3210,37 @@ If you are doing the ultra-high-speed connection(such as 10G Ether) you may want 10Gネットワーク等の超高速ネットワーク接続の場合は4-8に設定すると、速度が向上する事があります。 - Use Async I/O(for debug) - 非同期I/Oを使用(デバッグ用) + 非同期I/Oを使用(デバッグ用) - + Move one by one 移動を逐次方式に - + Change "Move(Overwrite all)" to "Move(Date/Size)" 「移動(全上書き)」を「移動(日付・サイズ)」に変更 - + Use modified name,if destdir same as src's parent. コピー元の同一フォルダへのコピーはリネームして動作継続 - + Don't create empty directory, if "Show Filter" is checked. Don't create empty directory, if ""Filter"" is checked. フィルター機能使用時、空フォルダは作成しない - + Copy Symlink as Symlink (not target) シンボリックリンクをリンクとしてコピー - + Move one by one (verify mode) 移動を逐次方式に(ベリファイ時) @@ -3205,57 +3249,57 @@ If you are doing the ultra-high-speed connection(such as 10G Ether) you may want LTFSモード - + skip "." start file or folder "."から始まるファイルやフォルダを無視する - + Use NSA method for Wipe && Delete option (very slow) 復元無効化にNSA方式を使用(非常に遅くなります) - + Try to delete directory, if "Show Filter" is checked. Try to delete directory, if "Filter" is checked. フィルタ機能指定での削除時にも、フォルダ削除を試みる - + Number of history items for Src/DestDir (need to restart) Source/Destdirの履歴数(再起動後に有効) - + Write ACL errors to Log Write ACL errors to Error Log ACL関連エラーをログに記録する - + Write to Log (RapidCopy.log) Write to Error Log (RapidCopy.log) 標準ログに記録を行う(RapidCopy.log) - + Write to detailed Log (Log/DATE.log) Write to File Log (Log/DATE.log) 詳細ファイルログを記録する(Log/DATE.log) - + Write EA(xattr) errors to Log Write xattr errors to Log EA(xattr)関連エラーをログに記録する - + Don't wait for other running RapidCopy to finish 他のRapidCopyが動作中の場合でも直ちに実行開始する - + Don't use system tray at minimizing 最小化時、システムトレイに常駐しない @@ -3264,22 +3308,22 @@ If you are doing the ultra-high-speed connection(such as 10G Ether) you may want "新しいウインドウを開く"の実行時、SrcとDestの内容をクリアする - + Info Update Span 表示更新間隔 - + 250ms 250ms - + 500ms 500ms - + 1000ms 1000ms @@ -3288,12 +3332,12 @@ If you are doing the ultra-high-speed connection(such as 10G Ether) you may want 他のRapidCopyが動作中の場合でも直ちに実行開始する - + Confirm before execute 実行前に確認ダイアログを表示する - + English UI (need to restart) 英語UI(再起動後に有効) diff --git a/cfg.cpp b/cfg.cpp index 78ee876..72c19e7 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -61,6 +61,7 @@ #define ISSAMEDIRRENAME_KEY "is_samedir_rename" #define BUFSIZE_KEY "bufsize" #define MAXTRANSSIZE_KEY "max_transize" +#define MAXAIONUM_KEY "max_aionum" #define MAXOPENFILES_KEY "max_openfiles" #define MAXATTRSIZE_KEY "max_attrsize" #define MAXDIRSIZE_KEY "max_dirsize" @@ -82,6 +83,7 @@ #define STREAM_KEY "stream" #define XATTR_KEY "xattr" #define VERIFY_KEY "verify" +#define VERIFY_ERRDEL_KEY "verifyerrdel" #define IGNORE_DOT_KEY "dotignore" #define USEMD5_KEY "using_md5" #define ISLISTING_KEY "isListing" @@ -133,7 +135,7 @@ #define SHUTDOWNTIME_KEY "shutdown_time" #define FLAGS_KEY "flags" #define LTFS_KEY "ltfs" -#define F_NOCACHE_KEY "fnocache" +#define F_ODIRECT_KEY "odirect" #define RWSTAT_KEY "rwstat" #define ASYNCIO_KEY "asyncio" #define DATA_KEY "data" @@ -151,6 +153,7 @@ #define DEFAULT_FORCESTART 0 #define DEFAULT_BUFSIZE 256 #define DEFAULT_MAXTRANSSIZE 1 +#define DEFAULT_MAXAIONUM 1 #define DEFAULT_MAXATTRSIZE (1024 * 1024 * 1024) #define DEFAULT_MAXDIRSIZE (1024 * 1024 * 1024) #define DEFAULT_MAXOPENFILES 256 @@ -291,6 +294,7 @@ BOOL Cfg::ReadIni(void *user_dir, void *virtual_dir) bufSize = ini.value(BUFSIZE_KEY,DEFAULT_BUFSIZE).toInt(); maxTransSize = ini.value(MAXTRANSSIZE_KEY, DEFAULT_MAXTRANSSIZE).toInt(); + maxAionum = ini.value(MAXAIONUM_KEY, DEFAULT_MAXAIONUM).toInt(); //enableReadahead = ini.value(READAHEAD_KEY,FALSE).toBool(); maxOpenFiles = ini.value(MAXOPENFILES_KEY, DEFAULT_MAXOPENFILES).toInt(); @@ -321,9 +325,10 @@ BOOL Cfg::ReadIni(void *user_dir, void *virtual_dir) enableAcl = ini.value(ACL_KEY, FALSE).toBool(); enableXattr = ini.value(XATTR_KEY, FALSE).toBool(); enableVerify = ini.value(VERIFY_KEY, false).toBool(); + enableVerifyErrDel = ini.value(VERIFY_ERRDEL_KEY, true).toBool(); Dotignore_mode = ini.value(IGNORE_DOT_KEY, true).toBool(); enableLTFS = ini.value(LTFS_KEY, false).toBool(); - //enableF_NOCACHE = ini.value(F_NOCACHE_KEY,false).toBool(); + enableOdirect = ini.value(F_ODIRECT_KEY,true).toBool(); usingMD5 = ini.value(USEMD5_KEY,1).toInt(); enableNSA = ini.value(NSA_KEY, FALSE).toBool(); delDirWithFilter= ini.value(DELDIR_KEY, FALSE).toBool(); @@ -540,44 +545,30 @@ BOOL Cfg::WriteIni(void) ini.setValue(BUFSIZE_KEY,bufSize); ini.setValue(MAXTRANSSIZE_KEY, maxTransSize); -// ini.setValue(MAXOPENFILES_KEY, maxOpenFiles); -//廃止 -// ini.setValue(NONBUFMINSIZENTFS_KEY, nbMinSizeNtfs); -// ini.setValue(NONBUFMINSIZEFAT_KEY, nbMinSizeFat); -// ini.setValue(ISREADOSBUF_KEY, isReadOsBuf); + ini.setValue(MAXAIONUM_KEY, maxAionum); ini.setValue(MAX_HISTORY_KEY, maxHistoryNext); ini.setValue(COPYMODE_KEY, copyMode); -// ini.setValue(COPYFLAGS_KEY, copyFlags); ini.setValue(SKIPEMPTYDIR_KEY, skipEmptyDir); ini.setValue(IGNORE_ERR_KEY, ignoreErr); ini.setValue(ESTIMATE_KEY, estimateMode); ini.setValue(DISKMODE_KEY, diskMode); ini.setValue(ISTOPLEVEL_KEY, isTopLevel); ini.setValue(ISERRLOG_KEY, isErrLog); -//ini.setValue(ISUTF8LOG_KEY, isUtf8Log); ini.setValue(FILELOGMODE_KEY, fileLogMode); ini.setValue(ACLERRLOG_KEY, aclErrLog); ini.setValue(STREAMERRLOG_KEY, streamErrLog); -// ini.setValue(ISRUNASBUTTON_KEY, isRunasButton); ini.setValue(ISSAMEDIRRENAME_KEY, isSameDirRename); -// ini.setValue(SHEXTAUTOCLOSE_KEY, shextAutoClose); -// ini.setValue(SHEXTTASKTRAY_KEY, shextTaskTray); -// ini.setValue(SHEXTNOCONFIRMDEL_KEY, shextNoConfirmDel); ini.setValue(EXECCONRIM_KEY, execConfirm); ini.setValue(FORCESTART_KEY, forceStart); ini.setValue(LCID_KEY, lcid); -// ini.setValue(WAITTICK_KEY, waitTick); -// ini.setValue(ISAUTOSLOWIO_KEY, isAutoSlowIo); ini.setValue(SPEEDLEVEL_KEY, speedLevel); -// ini.setValue(ALWAYSLOWIO_KEY, alwaysLowIo); ini.setValue(OWDEL_KEY, enableOwdel); ini.setValue(ACL_KEY, enableAcl); -// ini.setValue(STREAM_KEY, enableStream); ini.setValue(XATTR_KEY, enableXattr); ini.setValue(IGNORE_DOT_KEY,Dotignore_mode); ini.setValue(LTFS_KEY,enableLTFS); -//ini.setValue(F_NOCACHE_KEY,enableF_NOCACHE); ini.setValue(VERIFY_KEY, enableVerify); + ini.setValue(VERIFY_ERRDEL_KEY, enableVerifyErrDel); ini.setValue(USEMD5_KEY, usingMD5); ini.setValue(NSA_KEY, enableNSA); ini.setValue(DELDIR_KEY, delDirWithFilter); @@ -585,10 +576,6 @@ BOOL Cfg::WriteIni(void) ini.setValue(SERIALMOVE_KEY, serialMove); ini.setValue(SERIALVERIFYMOVE_KEY, serialVerifyMove); ini.setValue(REPARSE_KEY, isReparse); -// ini.setValue(LINKDEST_KEY, isLinkDest); -// int->setValue(MAXLINKHASH_KEY, maxLinkHash); -// int->setValue(ALLOWCONTFSIZE_KEY, allowContFsize); -// ini.setValue(RECREATE_KEY, isReCreate); ini.setValue(EXTENDFILTER_KEY, isExtendFilter); ini.setValue(TASKBARMODE_KEY, taskbarMode); ini.setValue(INFOSPAN_KEY, infoSpan); @@ -598,6 +585,7 @@ BOOL Cfg::WriteIni(void) ini.setValue(ASYNCIO_KEY,async); ini.setValue(DISABLE_UTIME_KEY,isDisableutime); // ini.setValue(READAHEAD_KEY,enableReadahead); + ini.setValue(F_ODIRECT_KEY,enableOdirect); ini.setValue(JOBLISTMODE_KEY,isJobListMode); ini.endGroup(); diff --git a/cfg.h b/cfg.h index df10ae3..c4759ed 100644 --- a/cfg.h +++ b/cfg.h @@ -310,6 +310,7 @@ class Cfg { int bufSize; int maxTransSize; + int maxAionum; //bool enableReadahead; int maxOpenFiles; int maxAttrSize; @@ -333,6 +334,7 @@ class Cfg { BOOL enableAcl; BOOL enableXattr; BOOL enableVerify; + BOOL enableVerifyErrDel; BOOL Dotignore_mode; int usingMD5; BOOL enableNSA; @@ -352,7 +354,7 @@ class Cfg { int infoSpan; // information update timing (0:250msec, 1:500msec, 2:1000msec) BOOL isTopLevel; BOOL isErrLog; - //BOOL isUtf8Log; + BOOL enableOdirect; int fileLogMode; BOOL aclErrLog; diff --git a/fastcopy.cpp b/fastcopy.cpp index bf82f81..f043026 100644 --- a/fastcopy.cpp +++ b/fastcopy.cpp @@ -14,9 +14,9 @@ #include #include #include + #include #include -#include #include const char *FMT_RENAME_V; // ".%03d" @@ -25,6 +25,7 @@ const char *FMT_PUTCSV_V; //csvデータ出力用 const char *FMT_PUTERRCSV_V; //csvエラーメッセージ出力用 const char *FMT_STRNL_V; const char *FMT_REDUCEMSG_V; +const char *FMT_REDUCEAIOMSG; const char *PLSTR_LINK_V; const char *PLSTR_REPARSE_V; const char *PLSTR_REPDIR_V; @@ -73,6 +74,7 @@ static FsTable fstable [] = { {FastCopy::FSTYPE_NFS, NFS_SUPER_MAGIC, FSLOGNAME_NFS}, {FastCopy::FSTYPE_REISERFS, REISERFS_SUPER_MAGIC,FSLOGNAME_REISERFS}, {FastCopy::FSTYPE_SMB, SMB_SUPER_MAGIC, FSLOGNAME_SMBFS}, + {FastCopy::FSTYPE_SMB2, SMB2_SUPER_MAGIC, FSLOGNAME_SMB2FS}, {FastCopy::FSTYPE_CIFS, CIFS_MAGIC_NUMBER, FSLOGNAME_CIFS}, {FastCopy::FSTYPE_FUSE, FUSE_SUPER_MAGIC, FSLOGNAME_FUSE}, {FastCopy::FSTYPE_HFS, HFS_SUPER_MAGIC, FSLOGNAME_HFS}, @@ -83,6 +85,27 @@ static FsTable fstable [] = { {-1,-1,""} }; +static inline int io_setup(unsigned nr_events, aio_context_t *ctxp) +{ + return syscall(__NR_io_setup, nr_events, ctxp); +} + +static inline int io_getevents(aio_context_t ctx, long min_nr, long nr, + struct io_event *events, + struct timespec *timeout) +{ + return syscall(__NR_io_getevents, ctx, min_nr, nr, events, timeout); +} + +static inline int io_submit(aio_context_t ctx, long nr, struct iocb **iocbpp) +{ + return syscall(__NR_io_submit, ctx, nr, iocbpp); +} + +static inline int io_cancel(aio_context_t ctx, struct iocb *iocbp, struct io_event *event) +{ + return syscall(__NR_io_cancel, ctx, iocbp, event); +} /*========================================================================= クラス : FastCopy @@ -94,7 +117,7 @@ FastCopy::FastCopy() { hReadThread_c = hWriteThread_c = hRDigestThread_c = hWDigestThread_c = NULL; - rapidcopy_semaphore = sem_open(FASTCOPY_MUTEX,O_CREAT,S_IRUSR|S_IWUSR,FASTCOPY_MUTEX_INSTANCE); + rapidcopy_semaphore = sem_open(FASTCOPY_MUTEX,O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO,FASTCOPY_MUTEX_INSTANCE); if(rapidcopy_semaphore == SEM_FAILED){ //qDebug() << "sem_open(CREATE) :" << errno; } @@ -108,7 +131,8 @@ FastCopy::FastCopy() FMT_PUTCSV_V = "%s,\"%s\",%s,%s,%s\n"; FMT_PUTERRCSV_V = "%s,\"%s\",,%s,,%s\n"; FMT_STRNL_V = "%s\n"; - FMT_REDUCEMSG_V = "Reduce MaxIO(%c) size (%dMB -> %dMB)"; + FMT_REDUCEMSG_V = "Reduce MaxIO(%s) size (%dMB -> %dMB)"; + FMT_REDUCEAIOMSG = "Reduce MaxAio(%s) size (aionum:%d -> %d)"; PLSTR_LINK_V = " =>"; PLSTR_REPARSE_V = " ->"; PLSTR_REPDIR_V = "/ ->"; @@ -181,15 +205,15 @@ FastCopy::FsType FastCopy::GetFsType(const void *root_dir,bool *isCaseSensitive, //機能:対象ファイルシステムへのread/writeサイズ要求を補正する。 //返り値:補正後のread/write単位(Byte) -int FastCopy::CompensentIO_size(int req_iosize,FastCopy::FsType src_fstype,FastCopy::FsType dst_fstype){ +int FastCopy::CompensentIO_size(int req_iosize,FastCopy::FsType fstype){ int return_io_size = req_iosize; - //コピー元 - switch(src_fstype){ + switch(fstype){ //こいつらは大きなread/write放り投げてもたぶん大丈夫 case FSTYPE_NTFS: case FSTYPE_SMB: + case FSTYPE_SMB2: case FSTYPE_HFS: case FSTYPE_NFS: case FSTYPE_UDF: @@ -217,10 +241,19 @@ int FastCopy::CompensentIO_size(int req_iosize,FastCopy::FsType src_fstype,FastC return_io_size = FASTCOPY_MINLIMITIOSIZE; break; } - //コピー先 - switch(dst_fstype){ + return return_io_size; +} + +int FastCopy::CompensentAIO_num(int req_aionum,FastCopy::FsType fstype){ + + int return_aio_num = req_aionum; + + //コピー元 + switch(fstype){ + //こいつらはaio投げても大丈夫 case FSTYPE_NTFS: case FSTYPE_SMB: + case FSTYPE_SMB2: case FSTYPE_HFS: case FSTYPE_NFS: case FSTYPE_UDF: @@ -232,23 +265,15 @@ int FastCopy::CompensentIO_size(int req_iosize,FastCopy::FsType src_fstype,FastC case FSTYPE_REISERFS: case FSTYPE_CIFS: case FSTYPE_XFS: + case FSTYPE_NONE: //LTFSとかその他、把握しようもないけどとりあえず。 break; - //1MBに強制ダウン対象 - case FSTYPE_NONE: //その他把握しようもないやつ。 - case FSTYPE_ISOFS: - case FSTYPE_FAT: //古いしなんとなく - case FSTYPE_ADFS: - case FSTYPE_AFS: - case FSTYPE_CODA: - case FSTYPE_FUSE: - case FSTYPE_JFS: + + case FSTYPE_FAT: default: //バグ - //古いのと実装が予想できないやつらは強制的に1MBにダウン - return_io_size = FASTCOPY_MINLIMITIOSIZE; + return_aio_num = FASTCOPY_LINUX_MINAIONUM; break; } - //qDebug() << "return_io_size = " << return_io_size; - return return_io_size; + return return_aio_num; } //機能:Xattrコピー機能が動作可能か判定する @@ -269,6 +294,7 @@ bool FastCopy::IsXattrSupport(FastCopy::FsType src_fstype,FastCopy::FsType dst_f //CIFSに対してのxattrは対象システムのプロトコルスタックによって? //変換されることを期待する。(だめもと) case FSTYPE_SMB: + case FSTYPE_SMB2: break; //上記以外はxattrサポートないはずなので余計なことしないよ default: @@ -311,6 +337,7 @@ bool FastCopy::IsAclSupport(FastCopy::FsType src_fstype,FastCopy::FsType dst_fst //CIFSに対してのACLはプロトコルスタックによって? //変換されることを期待する。(だめもと) case FSTYPE_SMB: + case FSTYPE_SMB2: break; //上記以外はaclサポートないはずなので余計なことしないよ default: @@ -327,6 +354,7 @@ bool FastCopy::IsAclSupport(FastCopy::FsType src_fstype,FastCopy::FsType dst_fst case FSTYPE_XFS: case FSTYPE_NFS: case FSTYPE_SMB: + case FSTYPE_SMB2: break; //上記以外はaclサポートないはずなので余計なことしないよ default: @@ -352,6 +380,33 @@ int FastCopy::GetSectorSize(const void *root_dir) return ((int)fs_t.f_bsize); } +int FastCopy::SetOptFlags(int fd,bool req_odirect,bool req_readopt,char* path,FastCopy::FsType fstype){ + int flags = 0; + int org_flags = 0; + flags = fcntl(fd, F_GETFL); + org_flags = flags; + if(flags == SYSCALL_ERR){ + //qDebug() << "F_GETFL error fd:" << fd << "path:" << path; + return SYSCALL_ERR; + } + if(req_odirect + && fstype != FSTYPE_CIFS + && fstype != FSTYPE_SMB + && fstype != FSTYPE_SMB2){ + flags |= O_DIRECT; + } + if(req_readopt){ + flags |= O_NOATIME; + if(posix_fadvise(fd,0,0,POSIX_FADV_SEQUENTIAL) != 0){ + //qDebug() << "posix_fadvise(POSIX_FADV_SEQUENTIAL) error fd:" << fd << "path:" << path << "ret:" << fadvise_ret; + } + } + if(flags != org_flags && fcntl(fd, F_SETFL, flags) == SYSCALL_ERR){ + //qDebug() << "F_SETFL() error fd:" << fd << "path:" << path << "odirect:" << req_odirect << "noatime" << req_readopt; + } + return 0; +} + //機能:同じ論理デバイスかどうかをチェックする。 //返り値: true:同一の論理デバイスである。 false:同一の論理デバイスではない。 BOOL FastCopy::IsSameDrive(const void *root1, const void *root2) @@ -438,8 +493,14 @@ BOOL FastCopy::InitDstPath(void) //各種ファイルシステム情報取得 // セクタサイズ取得 dstSectorSize = GetSectorSize(dst_root); + //qDebug() << "dstSectorSize:" << dstSectorSize; //ファイルシステムの取得 dstFsType = GetFsType(dst_root,&dstCaseSense,dstFsName); + + info.maxTransSize = CompensentIO_size(info.maxTransSize,dstFsType); + //dstがaio受け入れ不能な場合はコピー全体のaionumを強制的に落とす + info.maxAionum = CompensentAIO_num(info.maxAionum,dstFsType); + //Linuxの場合は無条件にpreallocate有効 info.flags_second |= ENABLE_PREALLOCATE; // 差分コピー用dst先ファイル確認 @@ -577,6 +638,14 @@ BOOL FastCopy::InitSrcPath(int idx) srcSectorSize = GetSectorSize(src_root_cur); srcFsType = GetFsType(src_root_cur,&srcCaseSense,srcFsName); + info.maxAionum = min(info.maxAionum,CompensentAIO_num(info.maxAionum,srcFsType)); + info.maxTransSize = min(info.maxTransSize,CompensentIO_size(info.maxTransSize,srcFsType)); + + if(info.maxAionum > FASTCOPY_LINUX_MINAIONUM){ + info.maxTransSize = min((info.defTransSize * info.defAionum), + (info.maxTransSize * info.maxAionum)); + } + sectorSize = max(srcSectorSize, dstSectorSize); // 大きいほうに合わせる sectorSize = max(sectorSize, MIN_SECTOR_SIZE); // 同一物理ドライブかどうかの調査 @@ -607,6 +676,9 @@ BOOL FastCopy::InitSrcPath(int idx) strcpyV(src_root, src_root_cur); + maxReadSize = maxWriteSize = maxDigestReadSize = info.maxTransSize; + maxReadAionum = maxWriteAionum = maxDigestReadAionum = info.maxAionum; + // 最大転送サイズ DWORD tmpSize = isSameDrv ? info.bufSize : info.bufSize / 4; maxReadSize = min(tmpSize, maxReadSize); @@ -655,7 +727,13 @@ BOOL FastCopy::InitDeletePath(int idx) if (info.flags & (OVERWRITE_DELETE|OVERWRITE_DELETE_NSA)) { dstSectorSize = GetSectorSize(dst_root); dstFsType = GetFsType(dst_root,&dstCaseSense,dstFsName); - //nbMinSize = dstFsType == FSTYPE_NTFS ? info.nbMinSizeNtfs : info.nbMinSizeFat; + info.maxAionum = min(info.maxAionum,CompensentAIO_num(info.maxAionum,dstFsType)); + info.maxTransSize = min(info.maxTransSize,CompensentIO_size(info.maxTransSize,dstFsType)); + + if(info.maxAionum > FASTCOPY_LINUX_MINAIONUM){ + info.maxTransSize = min((info.defTransSize * info.defAionum), + (info.maxTransSize * info.maxAionum)); + } } } @@ -677,8 +755,7 @@ BOOL FastCopy::InitDeletePath(int idx) strcpyV(confirmDst, dst); // for renaming before deleting // 最大転送サイズ - maxWriteSize = min((DWORD)info.bufSize, maxWriteSize); - maxWriteSize = max(MIN_BUF, maxWriteSize); + maxWriteSize = max(MIN_BUF, info.maxTransSize); } if(fullpath != NULL){ @@ -700,14 +777,34 @@ BOOL FastCopy::RegisterInfo(const PathArray *_srcArray, const PathArray *_dstArr isListingOnly = (info.flags & LISTING_ONLY) ? TRUE : FALSE; isListing = (info.flags & LISTING) || isListingOnly ? TRUE : FALSE; endTick = 0; + ssize_t neef_bufsize = info.maxTransSize; SetChar(src_root, 0, 0); //Listing時は事前予測強制OFFだが、VERIFYONLYモードでは特別に有効とする。 if (isListingOnly && info.mode != VERIFY_MODE) info.flags &= ~PRE_SEARCH; + + if(info.maxAionum > FASTCOPY_LINUX_MINAIONUM){ + //ここではバッファ確保事前計算のために測っておく + //実際にできるかどうかはInitSrcPathで決まるよ + neef_bufsize = (info.maxTransSize * info.maxAionum * BUFIO_SIZERATIO); + } + else{ + neef_bufsize = info.maxTransSize; + } + // 最大転送サイズ上限(InitSrcPath で再設定) - maxReadSize = maxWriteSize = maxDigestReadSize = info.maxTransSize; + maxReadSize = maxWriteSize = maxDigestReadSize = neef_bufsize; + + if (!isListingOnly && + (info.mode != DELETE_MODE || (info.flags & (OVERWRITE_DELETE|OVERWRITE_DELETE_NSA))) && + (info.bufSize < neef_bufsize || info.bufSize < MIN_BUF * 2 + )) { + char msgbuf[512]; + sprintfV(msgbuf, GetLoadStrV(IDS_SMALLBUF_ERR),(neef_bufsize * BUFIO_SIZERATIO) / 1024 / 1024); + return ConfirmErr(msgbuf,NULL, CEF_STOP|CEF_NOAPI); + } // filter PathArray pathArray[] = { *_includeArray, *_excludeArray }; @@ -1480,27 +1577,28 @@ BOOL FastCopy::PutStat(void* data){ return TRUE; } -BOOL FastCopy::MakeDigest(void *path, VBuf *vbuf, TDigest *digest, BYTE *val, _int64 *fsize,FileStat *stat) +BOOL FastCopy::MakeDigest(void *path, VBuf *vbuf, TDigest *digest, BYTE *val, _int64 *fsize,FileStat *stat,bool req_srcdigest) { int flg = O_RDONLY; //win32のmodeフラグをF_NOCACHE指定指示に流用 - int mode = ((info.flags & USE_OSCACHE_READVERIFY) ? 0 : F_NOCACHE); + bool is_nonbuf = (info.flags & USE_OSCACHE_READVERIFY) ? false : true; DWORD share = 0; BOOL ret = FALSE; memset(val, 0, digest->GetDigestSize()); - int hFile = CreateFileWithRetry(path, mode, share, 0, 0, flg, 0, 5); + int hFile = open((const char*)path,flg,0777); digest->Reset(); if (hFile == SYSCALL_ERR){ return FALSE; } - //読み込んだデータのキャッシュ破棄指示 - posix_fadvise(hFile,0,0,POSIX_FADV_DONTNEED); + SetOptFlags(hFile,is_nonbuf ? true:false, + true,(char*)path, + req_srcdigest ? srcFsType : dstFsType); if ((DWORD)vbuf->Size() >= maxReadSize || vbuf->Grow(maxReadSize)) { struct stat bhi; @@ -1514,7 +1612,7 @@ BOOL FastCopy::MakeDigest(void *path, VBuf *vbuf, TDigest *digest, BYTE *val, _i CheckSuspend(); while (remain_size > 0 && !isAbort) { DWORD trans_size = 0; - if (ReadFileWithReduce(hFile, vbuf->Buf(), maxReadSize, &trans_size, NULL) + if (ReadFileWithReduce(hFile, vbuf->Buf(), maxReadSize, &trans_size,true) && trans_size > 0){ digest->Update(vbuf->Buf(), trans_size); remain_size -= trans_size; @@ -1563,10 +1661,10 @@ BOOL FastCopy::IsSameContents(FileStat *srcStat,FileStat *dstStat) //ここでdstreqにpostして、WriteThreadでのdstReadとdstDigest計算を開始 DstRequest(DSTREQ_DIGEST); } - src_ret = MakeDigest(src, &srcDigestBuf, &srcDigest, srcDigestVal,NULL,srcStat); + src_ret = MakeDigest(src, &srcDigestBuf, &srcDigest, srcDigestVal,NULL,srcStat,true); //同一ドライブモードの場合はスレッド分ける意味ないのでカレントスレッドで計算。 //このWaitDstRequest()でDstRequest()でポストしたwriteスレッドMakeDigest()との待ち合わせを行ってる。 - dst_ret = isSameDrv ? MakeDigest(confirmDst, &dstDigestBuf, &dstDigest, dstDigestVal,NULL,dstStat) : WaitDstRequest(); + dst_ret = isSameDrv ? MakeDigest(confirmDst, &dstDigestBuf, &dstDigest, dstDigestVal,NULL,dstStat,false) : WaitDstRequest(); BOOL ret = src_ret && dst_ret && memcmp(srcDigestVal, dstDigestVal, srcDigest.GetDigestSize()) == 0 ? TRUE : FALSE; if(ret){ @@ -1596,7 +1694,6 @@ BOOL FastCopy::IsSameContents(FileStat *srcStat,FileStat *dstStat) case DIFFCP_MODE: case SYNCCP_MODE: case MOVE_MODE: - unlink((char*)confirmDst); //エラーは無視 break; //その他のモードの場合は削除しない。 case VERIFY_MODE: @@ -2903,22 +3000,9 @@ BOOL FastCopy::OpenFileProc(FileStat *stat, int dir_len) if(is_open){ - int mode = info.flags & USE_OSCACHE_READ ? 0 : F_NOCACHE; + bool is_nonbuf = (info.flags & USE_OSCACHE_READ) ? false : true; + int flg = 0; - //O_NOATIMEはNFSで利用しようとするとのちのread()でEPERMになってしまうので、NFSの場合はNOATIMEつけない - //SMB/CIFSでも同様みたいだし、致命的問題になりやすいから諦めるかあ - //OSX へのSMB接続でもしれっとFSTYPE_NONEになっちゃったりするし、statfsあてにならなさすぎるわあ。。 - /* - if(srcFsType == FSTYPE_NFS || srcFsType == FSTYPE_CIFS - || srcFsType == FSTYPE_SMB || srcFsType == FSTYPE_FUSE - || srcFsType == FSTYPE_NONE){ - flg |= O_RDONLY; - } - else{ - flg |= O_RDONLY; - flg |= O_NOATIME; - } - */ flg = O_RDONLY; if (is_reparse){ @@ -2932,12 +3016,9 @@ BOOL FastCopy::OpenFileProc(FileStat *stat, int dir_len) ret = FALSE; } else{ - - if(mode == F_NOCACHE){ - //ファイルシステムキャッシュ無効要求しておく - //どうせ一回しかアクセスされないのにキャッシュする理由ないでしょ - posix_fadvise(stat->hFile,0,0,POSIX_FADV_DONTNEED); - } + SetOptFlags(stat->hFile, + is_nonbuf ? true:false, + true,(char*)src,srcFsType); } } @@ -3216,93 +3297,178 @@ void *FastCopy::RestoreOpenFilePath(void *path, int idx, int dir_len) return path; } -BOOL FastCopy::ReadFileWithReduce(int hFile, void *buf, DWORD size, DWORD *reads, void *overwrap) +BOOL FastCopy::ReadFileWithReduce(int hFile, void *buf, DWORD size, DWORD *reads,bool req_digest) { - DWORD trans = 0; + off_t trans = 0; DWORD total = 0; - DWORD maxReadSizeSv = maxReadSize; - - struct aiocb readlist[4]; - DWORD aio_pnum = sizeof(readlist) / sizeof(struct aiocb); - struct aiocb *list[aio_pnum]; //実験用 + bool isaioerror = false; + DWORD maxRSizeSv = req_digest ? maxDigestReadSize : maxReadSize; + DWORD maxRAionumSv = req_digest ? maxDigestReadAionum : maxReadAionum; + DWORD *maxRSize = req_digest ? &maxDigestReadSize : &maxReadSize; + DWORD *maxRAionum = req_digest ? &maxDigestReadAionum : &maxReadAionum; + char msgbuf[512]; while ((trans = size - total) > 0) { - DWORD transed = 0; - trans = min(trans, maxReadSize); + off_t transed = 0; + trans = min(trans, *maxRSize); //時間計測処理 QElapsedTimer et; if(info.flags_second & STAT_MODE){ et.start(); } + if(*maxRAionum > FASTCOPY_MINLIMITIOSIZE && size == *maxRSize && !isaioerror){ + + QHash aiofinished_hash; + QHash ::iterator iter; + ssize_t per_read = (*maxRSize / *maxRAionum); + + aio_context_t laio; + + struct io_event evs[FASTCOPY_LINUX_MAXLIMITAIONUM]; + struct iocb *pcbpt[FASTCOPY_LINUX_MAXLIMITAIONUM]; + struct iocb read_aiolist[FASTCOPY_LINUX_MAXLIMITAIONUM]; + char aioerr_str[512]; + int aio_ret = 0; + + memset(&read_aiolist,0,(sizeof(struct iocb) * (*maxRAionum))); + memset(&laio, 0, sizeof(laio)); - //aio有効かつ要求バイトが同時io実行数以上?こっちはあくまで実験用のなごりだよ - /* - if(info.flags_second & FastCopy::ASYNCIO_MODE && (trans % aio_pnum) == 0){ - memset(&readlist,0,(sizeof(struct aiocb) * aio_pnum)); - //fdのカレントオフセット取得 off_t current = lseek(hFile,0,SEEK_CUR); - //qDebug() << "offset=" << current; - for(DWORD i=0; i < aio_pnum;i++){ - readlist[i].aio_fildes = hFile; - readlist[i].aio_lio_opcode = LIO_READ; + + if(io_setup(*maxRAionum,&laio) == SYSCALL_ERR){ + sprintf(aioerr_str,"ReadFileWithReduce:io_setup:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)src); + isaioerror = true; + break; + } + + for(DWORD i=0; i < *maxRAionum;i++){ + read_aiolist[i].aio_fildes = hFile; + read_aiolist[i].aio_lio_opcode = IOCB_CMD_PREAD; //ex:1MBで同時要求数4だったら0,256KB,512KB,768KBにオフセット設定ね - readlist[i].aio_buf = (BYTE *)buf + ((trans / aio_pnum) * i); + read_aiolist[i].aio_buf = (uint64_t)((BYTE *)buf + (per_read * i)); //ex:1MBで同時要求数4だったら256KBずつ - readlist[i].aio_nbytes = trans / aio_pnum; + read_aiolist[i].aio_nbytes = per_read; //ex:1MBで同時要求数4だったらファイル読み込み開始位置はcurrentオフセットから0,256KB,512KB,768KBの位置 - readlist[i].aio_offset = current + ((trans / aio_pnum) * i); - struct aiocb *ap = &readlist[i]; - list[i] = ap; - } - //まとめてread発行 - if(::lio_listio(LIO_WAIT,list,aio_pnum,NULL) == SYSCALL_ERR){ - ConfirmErr("ReadFileWithReduce:lio_listio()",NULL); - } - //結果をまとめて回収 - for(DWORD i=0; i < aio_pnum;i++){ - ssize_t wk_trans = ::aio_return(list[i]); - //qDebug() << "wk_trans=" << wk_trans; - if(wk_trans == SYSCALL_ERR){ - char buf[512]; - sprintf(buf,"%s %d %lu","ReadFileWithReduce:aio_return()",errno,i); - ConfirmErr(buf,NULL); - return FALSE; + read_aiolist[i].aio_offset = current + (per_read * i); + read_aiolist[i].aio_data = hFile; + aiofinished_hash.insert((uint64_t)&read_aiolist[i],i); + pcbpt[i] = &read_aiolist[i]; + } + + if(io_submit(laio,*maxRAionum,pcbpt) == SYSCALL_ERR){ + sprintf(aioerr_str,"ReadFileWithReduce:io_submit:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)src); + isaioerror = true; + continue; + } + + while(true){ + aio_ret = io_getevents(laio,1,*maxRAionum,evs,NULL); + if(aio_ret == SYSCALL_ERR){ + sprintf(aioerr_str,"ReadFileWithReduce:io_getevents:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)src); + isaioerror = true; + for(iter = aiofinished_hash.begin(); iter != aiofinished_hash.end(); iter++){ + if(io_cancel(laio,&read_aiolist[iter.value()],&evs[iter.value()]) == SYSCALL_ERR){ + sprintf(aioerr_str,"ReadFileWithReduce:io_cancel:ret=%d:no=%d)",errno,iter.value()); + ConfirmErr(aioerr_str,(char*)src); + } + } + break; } - transed = transed + wk_trans; + for(int i=0;i FASTCOPY_LINUX_MINAIONUM && size == maxReadSize){ + //非同期I/Oやめる + maxReadSize = maxReadSize / info.maxAionum; + } + else{ + //でかすぎるので1MiBずつ減 + maxReadSize -= REDUCE_SIZE; + maxReadSize = ALIGN_SIZE(maxReadSize,REDUCE_SIZE); } - maxReadSize -= REDUCE_SIZE; - maxReadSize = ALIGN_SIZE(maxReadSize,REDUCE_SIZE); continue; } + else if(transed == SYSCALL_ERR){ + return FALSE; + } + */ + if(transed == SYSCALL_ERR){ + qDebug() << errno; + return FALSE; + } total += transed; - if (transed != trans) { + if(transed != trans){ break; } } *reads = total; - if (maxReadSize != maxReadSizeSv) { - WCHAR buf[128]; - sprintfV(buf, FMT_REDUCEMSG_V, 'R', maxReadSizeSv / 1024/1024, maxReadSize / 1024/1024); - WriteErrLog(buf); + if (*maxRSize != maxRSizeSv) { + sprintfV(msgbuf, FMT_REDUCEMSG_V, + req_digest ? "RD" : "R", + maxRSizeSv / 1024/1024, *maxRSize / 1024/1024); + WriteErrLog(msgbuf); + } + if (*maxRAionum != maxRAionumSv){ + sprintfV(msgbuf, FMT_REDUCEAIOMSG, + req_digest ? "RD" : "R", + maxRAionumSv, *maxRAionum); + WriteErrLog(msgbuf); } return TRUE; } @@ -3489,13 +3655,15 @@ BOOL FastCopy::ReadFileProc(int start_idx, int *end_idx, int dir_len) prepare_ret = FALSE; break; } + //qDebug() << "maxReadSize:" << maxReadSize; + //qDebug() << "req_buf.bufSize" << req_buf.bufSize; //xattrデータ読み込み要求じゃない? if(stat->dwFileAttributes != 0){ ret = ReadFileWithReduce(stat->hFile, req_buf.buf, req_buf.bufSize, &trans_size, - NULL); + false); } //xattrデータ読み込み要求 else{ @@ -3535,7 +3703,7 @@ BOOL FastCopy::ReadFileProc(int start_idx, int *end_idx, int dir_len) stat->SetFileSize(0); req_buf.bufSize = 0; if((info.flags & CREATE_OPENERR_FILE) || is_send_request){ - SendRequest(is_send_request ? WRITE_ABORT : command, &req_buf, + SendRequest(is_send_request ? WRITE_ABORT : command, NULL, is_send_request && !is_digest ? 0 : stat); is_send_request = TRUE; } @@ -3628,7 +3796,7 @@ BOOL FastCopy::CheckDstRequest(void) break; case DSTREQ_DIGEST: - dstRequestResult = MakeDigest(confirmDst, &dstDigestBuf, &dstDigest, dstDigestVal); + dstRequestResult = MakeDigest(confirmDst, &dstDigestBuf, &dstDigest, dstDigestVal,NULL,NULL,false); break; } @@ -4303,11 +4471,7 @@ BOOL FastCopy::RenameRandomFname(void *org_path, void *rename_path, int dir_len, BOOL FastCopy::WriteRandomData(void *path, FileStat *stat, BOOL skip_hardlink) { - BOOL is_nonbuf = (stat->FileSize() >= PAGE_SIZE - || (stat->FileSize() % dstSectorSize) == 0) - && (info.flags & USE_OSCACHE_WRITE) == 0 ? TRUE : FALSE; - - DWORD flg = (is_nonbuf ? F_NOCACHE : 0); + BOOL is_nonbuf = info.flags & USE_OSCACHE_WRITE ? false : true; DWORD trans_size; BOOL ret = TRUE; @@ -4317,6 +4481,9 @@ BOOL FastCopy::WriteRandomData(void *path, FileStat *stat, BOOL skip_hardlink) return ConfirmErr("Write by Random Data(open)", MakeAddr(path, dstPrefixLen),CEF_NORMAL), FALSE; } + SetOptFlags(hFile,is_nonbuf ? true:false, + false,(char*)path,dstFsType); + if (waitTick) Wait((waitTick + 9) / 10); struct stat bhi; @@ -4338,7 +4505,7 @@ BOOL FastCopy::WriteRandomData(void *path, FileStat *stat, BOOL skip_hardlink) max_trans : (int)ALIGN_SIZE(remain_size, dstSectorSize); if (!(ret = WriteFileWithReduce(hFile, data->buf[i], io_size, - &trans_size, NULL))) { + &trans_size))) { break; } total.writeTrans += trans_size; @@ -5000,7 +5167,8 @@ BOOL FastCopy::WDigestThreadCore(void) if(memcmp(calc->digest, digest, dstDigest.GetDigestSize()) == 0){ // compare OK } - else{ + else { + char wk_path[2048]; QString str; QByteArray srcdigest((char*)calc->digest,dstDigest.GetDigestSize()); QByteArray dstdigest((char*)digest,dstDigest.GetDigestSize()); @@ -5009,26 +5177,27 @@ BOOL FastCopy::WDigestThreadCore(void) str.append((char*)GetLoadStrV(IDS_VERIFY_ERROR_WARN_2)); str.append(dstdigest.toHex()); str.append((char*)GetLoadStrV(IDS_VERIFY_ERROR_WARN_3)); - ConfirmErr(str.toLocal8Bit().data(), MakeAddr(calc->path, dstPrefixLen),CEF_NOAPI); - //debug このまま使うとバッファオーバフローになるぞ。buf[512]を増やして確認しろよ! - //strcat (buf," compare NG "); - //strcat (buf,(char*)calc->path); - //qDebug("%s",buf); - //debug - //ベリファイエラー検出した場合、dstのファイルを強制削除する。 - //再度のコピーでスキップされないようにすることで事故防止。 switch(info.mode){ - case DIFFCP_MODE: - case SYNCCP_MODE: - case MOVE_MODE: - unlink((char*)calc->path); //エラーは無視 - break; - //その他のモードの場合は削除しない。そもそもこないけど。。 - case VERIFY_MODE: - case DELETE_MODE: - case MUTUAL_MODE: - default: - break; + case DIFFCP_MODE: + case SYNCCP_MODE: + if(info.flags_second & VERIFYERR_DELETE){ + unlink((char*)calc->path); + ConfirmErr(str.toLocal8Bit().data(), MakeAddr((char*)calc->path, dstPrefixLen),CEF_NOAPI); + } + else{ + strncpy(wk_path,(char*)calc->path,sizeof(wk_path)); + strcat(wk_path,".rc_verify_err"); + rename((char*)calc->path,wk_path); + ConfirmErr(str.toLocal8Bit().data(), MakeAddr(wk_path, dstPrefixLen),CEF_NOAPI); + } + break; + //その他のモードの場合は削除しない。そもそもこないけど。。 + case MOVE_MODE: + case VERIFY_MODE: + case DELETE_MODE: + case MUTUAL_MODE: + default: + break; } calc->status = DigestCalc::ERR; } @@ -5139,8 +5308,8 @@ BOOL FastCopy::PutDigestCalc(DigestCalc *obj, DigestCalc::Status status) BOOL FastCopy::MakeDigestAsync(DigestObj *obj) { - int mode = ((info.flags & USE_OSCACHE_READVERIFY) ? 0 : F_NOCACHE); - int flg = O_RDWR; + bool is_nonbuf = (info.flags & USE_OSCACHE_READVERIFY) ? false : true; + int flg = O_RDONLY; int hFile = SYSCALL_ERR; _int64 remain_size = 0; @@ -5157,12 +5326,16 @@ BOOL FastCopy::MakeDigestAsync(DigestObj *obj) //ファイル実体同士での比較をしていたが、SANDBOX時はリンク先ファイルopenがブロックされるので、open諦める if(obj->fileSize){ struct stat bhi; - if((hFile = CreateFileWithRetry(obj->path, mode, 0, 0, 0, flg, - 0, 5)) == SYSCALL_ERR){ + if((hFile = open((char*)obj->path,flg,0777)) == SYSCALL_ERR){ ConfirmErr("MakeDigestAsync:open", MakeAddr(obj->path, dstPrefixLen)); ret = FALSE; } - posix_fadvise(hFile,0,0,POSIX_FADV_DONTNEED); + else{ + SetOptFlags(hFile,is_nonbuf ? true : false, + true, + (char*)obj->path, + dstFsType); + } if(ret && (fstat(hFile,&bhi) == 0)){ remain_size = bhi.st_size; } @@ -5193,7 +5366,7 @@ BOOL FastCopy::MakeDigestAsync(DigestObj *obj) if(calc){ DWORD trans_size = 0; if (isAbort || io_size && (!ReadFileWithReduce(hFile, calc->data, io_size, - &trans_size, NULL) || trans_size <= 0)) { + &trans_size,true) || trans_size <= 0)) { ConfirmErr("MakeDigestAsync:ReadFileWithReduce", MakeAddr(obj->path, dstPrefixLen)); ret = FALSE; break; @@ -5260,32 +5433,11 @@ BOOL FastCopy::CheckDigests(CheckDigestMode mode) return ret && !isAbort; } -int FastCopy::CreateFileWithRetry(void *path, DWORD mode, DWORD share, - int sa, DWORD cr_mode, DWORD flg, void* hTempl, int retry_max) -{ - - int fh = 0; - - - fh = open((const char*)path,flg,0777); - //エラー処理は上位任せ - if(mode == F_NOCACHE){ - //読み込んだデータのキャッシュ破棄指示 - posix_fadvise(fh,0,0,POSIX_FADV_DONTNEED); - } - - return fh; -} - -BOOL FastCopy::WriteFileWithReduce(int hFile, void *buf, DWORD size, DWORD *written,void* overwrap) +BOOL FastCopy::WriteFileWithReduce(int hFile, void *buf, DWORD size, DWORD *written) { DWORD trans = 0; DWORD total = 0; - DWORD maxWriteSizeSv = maxWriteSize; - - struct aiocb writelist[4]; - int aio_pnum = sizeof(writelist) / sizeof(struct aiocb); - struct aiocb *list[aio_pnum]; //aio実験用 + bool isaioerror = false; while ((trans = size - total) > 0) { DWORD transed = 0; @@ -5295,49 +5447,91 @@ BOOL FastCopy::WriteFileWithReduce(int hFile, void *buf, DWORD size, DWORD *writ if(info.flags_second & STAT_MODE){ et.start(); } - //aio有効かつ要求バイトが同時io実行数以上? - /* - if(info.flags_second & FastCopy::ASYNCIO_MODE && (trans % aio_pnum) == 0){ - memset(&writelist,0,(sizeof(struct aiocb) * aio_pnum)); - //fdのカレントオフセット取得 + if(info.maxAionum > FASTCOPY_LINUX_MINAIONUM && trans == maxWriteSize && !isaioerror){ + QHash aiofinished_hash; + QHash ::iterator iter; + ssize_t per_write = (maxWriteSize / info.maxAionum); + + aio_context_t laio; + + struct io_event evs[FASTCOPY_LINUX_MAXLIMITAIONUM]; + struct iocb *pcbpt[FASTCOPY_LINUX_MAXLIMITAIONUM]; + struct iocb write_aiolist[FASTCOPY_LINUX_MAXLIMITAIONUM]; + char aioerr_str[512]; + int aio_ret = 0; + + memset(&write_aiolist,0,(sizeof(struct iocb) * info.maxAionum)); + memset(&laio, 0, sizeof(laio)); + off_t current = lseek(hFile,0,SEEK_CUR); - //qDebug() << "offset=" << current; - for(int i=0; i < aio_pnum;i++){ - writelist[i].aio_fildes = hFile; - writelist[i].aio_lio_opcode = LIO_WRITE; + + if(io_setup(info.maxAionum,&laio) == SYSCALL_ERR){ + sprintf(aioerr_str,"WriteFileWithReduce:io_setup:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)dst); + isaioerror = true; + break; + } + + for(DWORD i=0; i < info.maxAionum;i++){ + write_aiolist[i].aio_fildes = hFile; + write_aiolist[i].aio_lio_opcode = IOCB_CMD_PWRITE; //ex:1MBで同時要求数4だったら0,256KB,512KB,768KBにオフセット設定ね - writelist[i].aio_buf = (BYTE *)buf + ((trans / aio_pnum) * i); + write_aiolist[i].aio_buf = (uint64_t)((BYTE *)buf + (per_write * i)); //ex:1MBで同時要求数4だったら256KBずつ - writelist[i].aio_nbytes = trans / aio_pnum; + write_aiolist[i].aio_nbytes = per_write; //ex:1MBで同時要求数4だったらファイル読み込み開始位置はcurrentオフセットから0,256KB,512KB,768KBの位置 - writelist[i].aio_offset = current + ((trans / aio_pnum) * i); - struct aiocb *ap = &writelist[i]; - list[i] = ap; - } - //まとめてread発行 - if(::lio_listio(LIO_WAIT,list,aio_pnum,NULL) == SYSCALL_ERR){ - ConfirmErr("WriteFileWithReduce:lio_listio()",NULL); - } - //結果をまとめて回収 - for(int i=0; i < aio_pnum;i++){ - ssize_t wk_trans = ::aio_return(list[i]); - //qDebug() << "wk_trans=" << wk_trans; - if(wk_trans == SYSCALL_ERR){ - char buf[512]; - sprintf(buf,"%s %d %d","WriteFileWithReduce:aio_return():",errno,i); - ConfirmErr(buf,NULL); - return FALSE; + write_aiolist[i].aio_offset = current + (per_write * i); + write_aiolist[i].aio_data = hFile; + aiofinished_hash.insert((uint64_t)&write_aiolist[i],i); + pcbpt[i] = &write_aiolist[i]; + } + + if(io_submit(laio,info.maxAionum,pcbpt) == SYSCALL_ERR){ + sprintf(aioerr_str,"WriteFileWithReduce:io_submit:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)dst); + isaioerror = true; + continue; + } + + while(true){ + aio_ret = io_getevents(laio,1,info.maxAionum,evs,NULL); + if(aio_ret == SYSCALL_ERR){ + sprintf(aioerr_str,"WriteFileWithReduce:io_getevents:ret=%d)",errno); + ConfirmErr(aioerr_str,(char*)dst); + isaioerror = true; + for(iter = aiofinished_hash.begin(); iter != aiofinished_hash.end(); iter++){ + if(io_cancel(laio,&write_aiolist[iter.value()],&evs[iter.value()]) == SYSCALL_ERR){ + sprintf(aioerr_str,"WriteFileWithReduce:io_cancel:ret=%d:no=%d)",errno,iter.value()); + ConfirmErr(aioerr_str,(char*)dst); + } + } + break; + } + for(int i=0;idwFileAttributes) && (info.flags & FILE_REPARSE) == 0; BOOL is_hardlink = command == CREATE_HARDLINK; - // is_nonbuf = true = fastcopyで確保した自バッファをコピーに使う - // is_nonbuf = false = OSキャッシュを利用する - BOOL is_nonbuf = //dstFsType != FSTYPE_SMB && - //指定ファイルサイズ未満の場合はOSキャッシュ利用して書き込みを廃止 - //(file_size >= nbMinSize || (file_size % dstSectorSize) == 0) - ((file_size % dstSectorSize) == 0) - && (info.flags & USE_OSCACHE_WRITE) == 0 && !is_reparse ? TRUE : FALSE; - //fh2によるreopen不要のためコメントアウト。 - //BOOL is_reopen = is_nonbuf && (file_size % dstSectorSize) && !is_reparse ? TRUE : FALSE; + // is_nonbuf = true = OSキャッシュを利用する + // is_nonbuf = false = fastcopyで確保した自バッファをコピーに使う(O_DIRECT) + BOOL is_nonbuf = !(info.flags & USE_OSCACHE_WRITE) && (!is_reparse ? true : false); BOOL is_stream = command == WRITE_BACKUP_ALTSTREAM; int &totalFiles = is_hardlink ? total.linkFiles : is_stream ? total.writeAclStream : total.writeFiles; @@ -5489,7 +5676,6 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) goto END2; } rc = link((char*)hardLinkDst,(char*)dst); - qDebug() << "src=" << (char*)hardLinkDst << "dst=" << (char*)dst; if(rc == SYSCALL_ERR){ ConfirmErr("link()", MakeAddr(dst, dstPrefixLen)); ret = false; @@ -5555,7 +5741,7 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) strcpy((char*)dst,dst_wk.toLocal8Bit().data()); } } - fh = open((const char*)dst,O_CREAT | O_WRONLY | O_TRUNC,0777); + fh = open((const char*)dst,O_CREAT | O_WRONLY,0777); if (fh == SYSCALL_ERR) { SetErrFileID(stat->fileID); totalErrFiles++; @@ -5568,10 +5754,15 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) ret = FALSE; goto END; } + SetOptFlags(fh, + is_nonbuf ? true:false, + false,(char*)dst,dstFsType); + //open成功してたらpreallocateで断片化阻止 if(info.flags_second & FastCopy::ENABLE_PREALLOCATE){ #ifdef _CENTOS7 //posix_fallocate(fh,0,file_size); //エラー発生時の処理はのちのWriteFileWithReduceに任せる 0fill write嫌なので無発行 + fallocate(fh,0,0,file_size); #else fallocate(fh,FALLOC_FL_ZERO_RANGE,0,file_size); #endif @@ -5582,10 +5773,18 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) //(DWORD)(is_nonbuf ? ALIGN_SIZE(remain, dstSectorSize) : remain); (DWORD)((is_nonbuf && stat->dwFileAttributes) ? ALIGN_SIZE(remain, dstSectorSize) : remain); //xattr付与の場合は書き込み長のアライン不要 + + //qDebug() << "remain:" << remain << "write_size:" << write_size; + + if(write_size != writeReq->bufSize){ + //qDebug() << "write_size:" << write_size; + //fcntl(fh, F_SETFL, O_DIRECT); + } + //xattrデータ書き込みじゃない? if(stat->dwFileAttributes != 0){ //通常ファイル書き込み - ret = WriteFileWithReduce(fh, writeReq->buf, write_size, &trans_size, NULL); + ret = WriteFileWithReduce(fh, writeReq->buf, write_size, &trans_size); } //xattrデータ書き込み要求 else{ @@ -5679,7 +5878,7 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) //ftruncateによりファイル日付等のメタデータ情報が非同期に更新される。 //のちのfutimesまたはlutimesと日付更新操作が前後しないように、一度フラッシュする。 if(fsync(fh) == SYSCALL_ERR){ - ERRNO_OUT(errno,"WriteFileProc:fsync"); + ConfirmErr("WriteFileProc:fsync()",MakeAddr(dst, dstPrefixLen)); } } } @@ -5687,6 +5886,7 @@ BOOL FastCopy::WriteFileProc(int dst_len,int parent_fh) END2: CheckSuspend(); + if (ret && is_digest && !isAbort) { int path_size = (dst_len + 1) * CHAR_LEN_V; DataList::Head *head = digestList.Alloc(NULL, 0, sizeof(DigestObj) + path_size); diff --git a/fastcopy.h b/fastcopy.h index f2cef8e..3a415a1 100644 --- a/fastcopy.h +++ b/fastcopy.h @@ -22,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include "tlib.h" @@ -43,7 +45,8 @@ #define MAX_IOSIZE_MB (1024) #define MAX_IOSIZE (1024 * 1024 * MAX_IOSIZE_MB) #define BIGTRANS_ALIGN (32 * 1024) -#define APP_MEMSIZE (6 * 1024 * 1024) + +#define BUFIO_SIZERATIO 2 //v130 //LTFS禁則文字 #define LTFS_PROHIBIT_SLASH "/" @@ -86,7 +89,7 @@ #define CV_WAIT_TICK 1000 -#define FASTCOPY_MUTEX "/RapidCopyRunMutex" //コピー実行を別RapidCopyプロセスとの間で排他するときのセマフォ名 +#define FASTCOPY_MUTEX "/RapidCopyRunMutex_S" //コピー実行を別RapidCopyプロセスとの間で排他するときのセマフォ名 #define FASTCOPY_ELOG_MUTEX "/RapidCopyELogMutex" //標準エラーログへの書き込みを排他するときのセマフォ名 #define FASTCOPYLOG_MUTEX_INSTANCE 1 // QSystemSemaphore指定、同時実行を許可するインスタンス数 #define FASTCOPY_MUTEX_INSTANCE 1 // FastCopy同時実行インスタンス数 @@ -98,6 +101,11 @@ #define FASTCOPY_LTFS_MAXTRANSSIZE FASTCOPY_MINLIMITIOSIZE //LTFSモード時のread/write単位。 //1MB以上を指定すると原因不明のSIGBUSになるよ //Linuxでどうなるかはしらぬ + +#define FASTCOPY_LINUX_MAXLIMITAIONUM (16) +#define FASTCOPY_LINUX_MINAIONUM (1) +#define FASTCOPY_LTFS_MAXAIONUM FASTCOPY_LINUX_MINAIONUM + #define FASTCOPY_STACKSIZE (1024 * 1024 * 8) //各スレッドのスタックサイズ #define FASTCOPY_FILTER_FLAGS_DIRENT 0 //FilterCheck時判断構造体はdirent @@ -297,7 +305,7 @@ class FastCopy: public QObject{ enum FsType { FSTYPE_NONE, FSTYPE_ADFS, FSTYPE_AFS, FSTYPE_CODA, FSTYPE_EXT2,FSTYPE_EXT3,FSTYPE_EXT4,FSTYPE_BTRFS, FSTYPE_F2FS,FSTYPE_ISOFS,FSTYPE_FAT,FSTYPE_NFS, - FSTYPE_REISERFS,FSTYPE_SMB,FSTYPE_CIFS,FSTYPE_FUSE, + FSTYPE_REISERFS,FSTYPE_SMB,FSTYPE_SMB2,FSTYPE_CIFS,FSTYPE_FUSE, FSTYPE_HFS,FSTYPE_JFS,FSTYPE_NTFS,FSTYPE_UDF, FSTYPE_XFS}; enum Flags { @@ -321,7 +329,6 @@ class FastCopy: public QObject{ COMPARE_CREATETIME = 0x00008000, SERIAL_MOVE = 0x00010000, SERIAL_VERIFY_MOVE = 0x00020000, - //USE_OSCACHE_READVERIFYは未使用 USE_OSCACHE_READVERIFY= 0x00040000, RESTORE_HARDLINK = 0x00080000, DISABLE_COMPARE_LIST= 0x00100000, @@ -347,6 +354,7 @@ class FastCopy: public QObject{ //ENABLE_READAHEAD = 0x00000020, read時先読み最適化有効 ENABLE_PREALLOCATE = 0x00000040, //write時フラグメント抑止有効 CSV_FILEOUT = 0x00000100, //CSVファイル出力要求 + VERIFYERR_DELETE = 0x00001000, //dstベリファイエラー時にdumpデータ削除 VERIFY_SHA1 = 0x01000000, //SHA-1 VERIFY_MD5 = 0x02000000, //MD5 VERIFY_XX = 0x04000000, //xxHash @@ -366,6 +374,7 @@ class FastCopy: public QObject{ unsigned int bufSize; // (I/ ) int maxOpenFiles; // (I/ ) int maxTransSize; // (I/ ) + int maxAionum; // (I/ ) int maxAttrSize; // (I/ ) int maxDirSize; // (I/ ) int maxLinkHash; // (I/ ) Dest Hardlink 用 hash table サイズ @@ -379,6 +388,8 @@ class FastCopy: public QObject{ BOOL isRenameMode; // (/O) ...「複製します」ダイアログタイトル用情報(暫定) // 将来的に、情報が増えれば、メンバから切り離し int flags_second; // (I/ ) 動作モード第二フラグ + int defTransSize; // + int defAionum; // }; enum Notify { END_NOTIFY, LISTING_NOTIFY,STAT_NOTIFY,CLI_JOBLISTNOTIFY}; @@ -413,7 +424,8 @@ class FastCopy: public QObject{ DWORD GetWaitTick() { return waitTick; } BOOL GetTransInfo(TransInfo *ti, BOOL fullInfo=TRUE); BOOL GetPhaseInfo(TransInfo *ti); - int CompensentIO_size(int req_iosize,FastCopy::FsType src_fstype,FastCopy::FsType dst_fstype); + int CompensentIO_size(int req_iosize,FastCopy::FsType fstype); + int CompensentAIO_num(int req_aionum,FastCopy::FsType fstype); void signal_handler(int signum); static bool ReadThread(void *fastCopyObj); static bool WriteThread(void *fastCopyObj); @@ -524,6 +536,10 @@ class FastCopy: public QObject{ DWORD maxReadSize; DWORD maxDigestReadSize; DWORD maxWriteSize; + + DWORD maxReadAionum; + DWORD maxDigestReadAionum; + DWORD maxWriteAionum; //大文字小文字分けて存在することを許すか? bool srcCaseSense; //true=大文字小文字を区別する false=大文字小文字を区別しない bool dstCaseSense; @@ -659,8 +675,6 @@ class FastCopy: public QObject{ BOOL FilterCheck(const void *path, const void *fname, DWORD attr, _int64 write_time, _int64 file_size,int flags); BOOL ReadDirEntry(int dir_len, BOOL confirm_dir); - int CreateFileWithRetry(void *path, DWORD mode, DWORD share, int sa, - DWORD cr_mode, DWORD flg, void* hTempl, int retry_max=10); BOOL OpenFileProc(FileStat *stat, int dir_len); BOOL OpenFileBackupProc(FileStat *stat, int src_len); BOOL OpenFileBackupStreamLocal(FileStat *stat,VBuf *buf,int *in_len); @@ -668,8 +682,7 @@ class FastCopy: public QObject{ BOOL ReadMultiFilesProc(int dir_len); BOOL CloseMultiFilesProc(int maxCnt=0); void *RestoreOpenFilePath(void *path, int idx, int dir_len); - BOOL ReadFileWithReduce(int hFile, void *buf, DWORD size, DWORD *reads, - void *overwrap); + BOOL ReadFileWithReduce(int hFile, void *buf, DWORD size, DWORD *reads, bool req_digest); BOOL ReadFileXattr(int hFile,char *xattrname, void *buf, DWORD size,DWORD *reads); BOOL ReadFileXattrWithReduce(int hFile,char *xattrname, void *buf, DWORD size,DWORD *reads,off_t file_size,_int64 remain_size); BOOL ReadFileProc(int start_idx, int *end_idx, int dir_len); @@ -683,7 +696,7 @@ class FastCopy: public QObject{ BOOL WriteRandomData(void *path, FileStat *stat, BOOL skip_hardlink); BOOL IsSameContents(FileStat *srcStat,FileStat *dstStat); - BOOL MakeDigest(void *path, VBuf *vbuf, TDigest *digest, BYTE *val, _int64 *fsize=NULL,FileStat *stat=NULL); + BOOL MakeDigest(void *path, VBuf *vbuf, TDigest *digest, BYTE *val, _int64 *fsize=NULL,FileStat *stat=NULL,bool req_srcdigest=true); void DstRequest(DstReqKind kind); BOOL WaitDstRequest(void); @@ -701,8 +714,7 @@ class FastCopy: public QObject{ BOOL PutDigestCalc(DigestCalc *obj, DigestCalc::Status status); BOOL MakeDigestAsync(DigestObj *obj); BOOL CheckDigests(CheckDigestMode mode); - BOOL WriteFileWithReduce(int hFile, void *buf, DWORD size, DWORD *written, - void* overwrap); + BOOL WriteFileWithReduce(int hFile, void *buf, DWORD size,DWORD *written); BOOL WriteFileXattr(int hFile,char* xattr_name, void*buf,DWORD size,DWORD *written); BOOL WriteFileXattrWithReduce(int hFile,char* xattr_name, void*buf,DWORD size,DWORD *written,void *wk_xattrbuf,_int64 file_size,_int64 remain_size); BOOL WriteFileProc(int dst_len,int parent_fh=SYSCALL_ERR); @@ -729,6 +741,7 @@ class FastCopy: public QObject{ } int GetSectorSize(const void *root_dir); + int SetOptFlags(int fd,bool req_odirect, bool req_readopt,char* path=NULL,FsType fstype=FSTYPE_NONE); BOOL IsSameDrive(const void *root1, const void *root2); BOOL PutList(void *path, DWORD opt, DWORD lastErr=0, BYTE *digest=NULL,qint64 file_size=SYSCALL_ERR,void* org_path=NULL); BOOL PutStat(void *info); diff --git a/mainsettingdialog.cpp b/mainsettingdialog.cpp index 029286e..54fe8bb 100644 --- a/mainsettingdialog.cpp +++ b/mainsettingdialog.cpp @@ -33,11 +33,8 @@ mainsettingDialog::mainsettingDialog(QWidget *parent,Cfg *cfg_pt) : ui->comboBox_VerifyMode->addItem((char*)GetLoadStrV(VERIFYINFO_LIST[i].resId)); } - //test ui->checkBox_rwstat->setEnabled(false); ui->checkBox_rwstat->setVisible(false); - ui->checkBox_aio->setEnabled(false); - ui->checkBox_aio->setVisible(false); GetData(); ui->general_optionlist->setCurrentRow(0); @@ -71,7 +68,8 @@ BOOL mainsettingDialog::GetData() //I/O settings ui->lineEdit_Iomax->setText(QString::number(cfg->maxTransSize)); - //ui->checkBox_Rdahead->setChecked(cfg->enableReadahead); + ui->lineEdit_aionum->setText(QString::number(cfg->maxAionum)); + ui->checkBox_O_DIRECT->setChecked(cfg->enableOdirect); //Copy/Move Options ui->checkBox_Samedir->setChecked(cfg->isSameDirRename); @@ -81,6 +79,7 @@ BOOL mainsettingDialog::GetData() ui->checkBox_Moveone->setChecked(cfg->serialMove); ui->checkBox_Moveone_verify->setChecked(cfg->serialVerifyMove); ui->checkBox_Noutime->setChecked(cfg->isDisableutime); + ui->checkBox_Dumpdel->setChecked(cfg->enableVerifyErrDel); //Delete Options ui->checkBox_NSA->setChecked(cfg->enableNSA); @@ -120,7 +119,6 @@ BOOL mainsettingDialog::GetData() ui->checkBox_EnglishUI->setChecked(cfg->lcid == QLocale::Japanese ? false : true); ui->comboBox_VerifyMode->setCurrentIndex(cfg->usingMD5); ui->checkBox_rwstat->setChecked(cfg->rwstat); - ui->checkBox_aio->setChecked(cfg->async); return TRUE; } @@ -162,7 +160,8 @@ BOOL mainsettingDialog::SetData() //I/O settings cfg->maxTransSize = ui->lineEdit_Iomax->text().toInt(); - //cfg->enableReadahead = ui->checkBox_Rdahead->checkState(); + cfg->maxAionum = ui->lineEdit_aionum->text().toInt(); + cfg->enableOdirect = ui->checkBox_O_DIRECT->checkState(); //Copy/Move Options cfg->isSameDirRename = ui->checkBox_Samedir->checkState(); @@ -174,6 +173,7 @@ BOOL mainsettingDialog::SetData() cfg->enableLTFS = ui->checkBox_LTFS->checkState(); cfg->Dotignore_mode = ui->checkBox_Dotignore->checkState(); cfg->isDisableutime = ui->checkBox_Noutime->checkState(); + cfg->enableVerifyErrDel = ui->checkBox_Dumpdel->checkState(); //Delete Options cfg->enableNSA = ui->checkBox_NSA->checkState(); @@ -206,7 +206,6 @@ BOOL mainsettingDialog::SetData() cfg->lcid = ui->checkBox_EnglishUI->checkState() ? QLocale::English : QLocale::Japanese; cfg->usingMD5 = ui->comboBox_VerifyMode->currentIndex(); cfg->rwstat = ui->checkBox_rwstat->checkState(); - cfg->async = ui->checkBox_aio->checkState(); return TRUE; } @@ -250,3 +249,17 @@ void mainsettingDialog::on_checkBox_Filelog_stateChanged(int arg1) break; } } + +void mainsettingDialog::on_lineEdit_Iomax_textChanged(const QString &arg1) +{ + int iosize = arg1.toInt(); + int olap = ui->lineEdit_aionum->text().toInt(); + ui->lineEdit_totaliosize->setText(QString::number(iosize*olap)); +} + +void mainsettingDialog::on_lineEdit_aionum_textChanged(const QString &arg1) +{ + int olap = arg1.toInt(); + int iosize = ui->lineEdit_Iomax->text().toInt(); + ui->lineEdit_totaliosize->setText(QString::number(iosize*olap)); +} diff --git a/mainsettingdialog.h b/mainsettingdialog.h index 0ffa012..5ad87fa 100644 --- a/mainsettingdialog.h +++ b/mainsettingdialog.h @@ -48,6 +48,8 @@ private slots: void on_slider_Speed_valueChanged(int value); void on_checkBox_Filelog_stateChanged(int arg1); + void on_lineEdit_Iomax_textChanged(const QString &arg1); + void on_lineEdit_aionum_textChanged(const QString &arg1); }; #endif // MAINSETTINGDIALOG_H diff --git a/mainsettingdialog.ui b/mainsettingdialog.ui index fa653b2..fb611b4 100644 --- a/mainsettingdialog.ui +++ b/mainsettingdialog.ui @@ -6,8 +6,8 @@ 0 0 - 634 - 208 + 656 + 351 @@ -24,8 +24,8 @@ - 634 - 208 + 800 + 400 @@ -145,7 +145,7 @@ - 5 + 1 @@ -450,10 +450,10 @@ - - + + - + 0 0 @@ -464,88 +464,185 @@ - Max I/O size (MB) - - - - - - - Select hash algorithm. -xxHash is an excellent in terms of CPU load and speed, but it is not suitable for data integrity evidence. -For data integrity evidence, You should use "MD5" or others. - - - - - - - - 11 - - - - Use Async I/O(for debug) + Checksum algorithm - - + + - + 0 0 - - - 50 - 0 - - - - - 50 - 16777215 - - - - Set the request size at the time of data read/write. + + I/O Settings + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + true + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 50 + 16777215 + + + + Set the request size at the time of data read/write. If you are doing the ultra-high-speed network connection(such as 10G Ether). you may want to set the 4-8. - - - Qt::ImhDigitsOnly - - - 4 - + + + Qt::ImhDigitsOnly + + + 4 + + + + + + + + 14 + true + + + + AIO I/O num + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 120 + 16777215 + + + + + 12 + + + + I/O Unit (MB) + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + Qt::ImhDigitsOnly + + + 2 + + + + + + + MB(Total) + + + + + + + + 100 + 16777215 + + + + + 12 + + + + =Max I/O size + + + + + + + <html><head/><body><p>Default:1MB unit and Overlap = 1</p></body></html> + + + + - - + + - 12 + 11 - Checksum algorithm + Enable Readahead - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -558,28 +655,30 @@ If you are doing the ultra-high-speed network connection(such as 10G Ether). you - - - - Qt::Horizontal + + + + + 0 + 0 + - - - 40 - 20 - + + Select hash algorithm. +xxHash is an excellent in terms of CPU load and speed, but it is not suitable for data integrity evidence. +For data integrity evidence, You should use "MD5" or others. - + - - + + 11 - Enable Readahead + Enable O_DIRECT(no use OS cache) @@ -649,6 +748,19 @@ If you are doing the ultra-high-speed network connection(such as 10G Ether). you + + + + + 0 + 0 + + + + If dst verify error occurs,don't save dump file (delete *.fc_verify_err) + + + @@ -1044,10 +1156,8 @@ If you are doing the ultra-high-speed network connection(such as 10G Ether). you slider_Speed checkBox_Owdel checkBox_ShowExtend - lineEdit_Iomax comboBox_VerifyMode checkBox_rwstat - checkBox_aio checkBox_Samedir checkBox_Nocreate checkBox_Symlink diff --git a/mainwindow.cpp b/mainwindow.cpp index 4e34910..09a3828 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1192,7 +1192,7 @@ BOOL MainWindow::EvClicked() bool ctrl_pressed; src_dialog.setFileMode(QFileDialog::Directory); - src_dialog.setOption(QFileDialog::DontUseNativeDialog,true); + //src_dialog.setOption(QFileDialog::DontUseNativeDialog,true); //ファイルダイアログでフォルダとファイルを同時選択するためのおまじない。 QListView *l = src_dialog.findChild("listView"); @@ -1743,6 +1743,12 @@ BOOL MainWindow::ExecCopy(DWORD exec_flags) | (diskMode == 0 ? 0 : diskMode == 1 ? FastCopy::FIX_SAMEDISK : FastCopy::FIX_DIFFDISK) | (is_verifyonlylisting ? FastCopy::LISTING_ONLY_VERIFY : 0); + if(!cfg.enableOdirect){ + info.flags |= FastCopy::USE_OSCACHE_READ; + info.flags |= FastCopy::USE_OSCACHE_WRITE; + info.flags |= FastCopy::USE_OSCACHE_READVERIFY; + } + //第二フラグ info.flags_second = cfg.copyFlags | (ui->checkBox_LTFS->isChecked() ? FastCopy::LTFS_MODE : 0) | (cfg.rwstat ? FastCopy::STAT_MODE : 0) @@ -1750,7 +1756,10 @@ BOOL MainWindow::ExecCopy(DWORD exec_flags) | (isCommandStart ? FastCopy::LAUNCH_CLI : 0) | (cfg.isDisableutime ? FastCopy::DISABLE_UTIME : 0) // | (cfg.enableReadahead ? FastCopy::ENABLE_READAHEAD : 0) - | (fileLogMode & Cfg::ADD_CSVFILELOG ? FastCopy::CSV_FILEOUT : 0); + | (fileLogMode & Cfg::ADD_CSVFILELOG ? FastCopy::CSV_FILEOUT : 0) + | (cfg.enableVerifyErrDel ? FastCopy::VERIFYERR_DELETE : 0); + + switch(cfg.usingMD5){ @@ -1798,13 +1807,16 @@ BOOL MainWindow::ExecCopy(DWORD exec_flags) else{ info.maxTransSize = cfg.maxTransSize * 1024 * 1024; } + info.defTransSize = info.maxTransSize; - // 対象ファイルシステムごとにI/Oサイズをなんとなく制限する - info.maxTransSize = fastCopy.CompensentIO_size(info.maxTransSize,fastCopy.srcFsType,fastCopy.dstFsType); + //aioは8以上設定するとresource不足になるので8以上なら強制的に8にする + info.maxAionum = cfg.maxAionum > FASTCOPY_LINUX_MAXLIMITAIONUM ? FASTCOPY_LINUX_MAXLIMITAIONUM : cfg.maxAionum; + info.defAionum = info.maxAionum; if(info.flags_second & FastCopy::LTFS_MODE){ //LTFSモード時はread/write単位は1MB固定に変更 info.maxTransSize = FASTCOPY_LTFS_MAXTRANSSIZE; + info.maxAionum = FASTCOPY_LTFS_MAXAIONUM; //xattr付与されてたらオフる。(LTFSではxattrは1エントリしか保存できない) info.flags = info.flags &~ FastCopy::WITH_XATTR; //ACLも保存できないので強制オフ @@ -2662,16 +2674,16 @@ BOOL MainWindow::EnableErrLogFile(BOOL on) // ErrLogFileの生成と書き込みは他プロセスで同時起動しているFastCopyと同時に行っちゃう可能性がある。 // そのため、OSの名前空間に印とって排他かける。 - hErrLogMutex = sem_open(FASTCOPYLOG_MUTEX,O_CREAT,S_IRUSR|S_IWUSR,FASTCOPYLOG_MUTEX_INSTANCE); + hErrLogMutex = sem_open(FASTCOPYLOG_MUTEX,O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO,FASTCOPYLOG_MUTEX_INSTANCE); if(hErrLogMutex == SEM_FAILED){ - qDebug() << "sem_open(CREATE FASTCOPYLOG_MUTEX) :" << errno; + //qDebug() << "sem_open(CREATE FASTCOPYLOG_MUTEX) :" << errno; } //排他取れるかなー?先に開いてるやついたら無限待ち if(sem_wait((sem_t*)hErrLogMutex) == 0){ hErrLog = open(errLogPathV,O_RDWR | O_CREAT,0777); } else{ - qDebug() << "sem_wait() failed. errno=" << errno; + //qDebug() << "sem_wait() failed. errno=" << errno; } } else if(!on && hErrLog != SYSCALL_ERR){ @@ -3443,10 +3455,14 @@ void MainWindow::castPath(QPlainTextEdit *target,QString append_path,int append_ int RowHeightpx = ((m.height() * (rowcount + 1)) + 30); //1は最終行の;ないやつぶん。 //10はfont以外のQplainTextEditの端っこ部分のなんとなく - //横幅を動的に調節・・・・しなくてもいいかもなーとりあえず残してるけど //最大高をいい感じに設定 ui->plainTextEdit_Src->setMaximumHeight(RowHeightpx); + //src領域末尾にスクロール + ui->plainTextEdit_Src->textCursor().movePosition(QTextCursor::End); + ui->plainTextEdit_Src->verticalScrollBar()->setValue(ui->plainTextEdit_Src->verticalScrollBar()->maximum()); + ui->plainTextEdit_Src->horizontalScrollBar()->setValue(ui->plainTextEdit_Src->horizontalScrollBar()->maximum()); + //パス追加要求? if(append_req){ //追加する場合、スクロールバーで隠れるとなにを追加したのかがわかりにくい。 @@ -5197,6 +5213,7 @@ void MainWindow::dropEvent(QDropEvent *event){ QFileInfo dstdir(drop_str_list[0].toLocalFile()); if(dstdir.exists() && dstdir.isDir()){ ui->plainTextEdit_Dst->setPlainText(drop_str_list[0].toLocalFile() + "/"); + ui->plainTextEdit_Dst->horizontalScrollBar()->setValue(ui->plainTextEdit_Dst->horizontalScrollBar()->maximum()); CheckJobListmodified(); } } diff --git a/mainwindow.h b/mainwindow.h index c0dae3e..8959514 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -20,7 +20,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/osl.h b/osl.h index dad6600..46cda4c 100644 --- a/osl.h +++ b/osl.h @@ -62,6 +62,7 @@ bool IsDir2(int d); //nanosleep用定数 #define NANO_SECOND_MULTIPLIER 1000000 // 1 millisecond = 1,000,000 Nanoseconds const long INTERVAL_MS = 250 * NANO_SECOND_MULTIPLIER; +const long INTERVAL_MS_AIO = 500 * NANO_SECOND_MULTIPLIER; //statfsのf_typeで取得できるファイルシステムタイプdefine //usr/include/linux/magic.h以外で認識したいファイルシステムをdefineする。 @@ -73,6 +74,7 @@ const long INTERVAL_MS = 250 * NANO_SECOND_MULTIPLIER; #define NTFS_SB_MAGIC 0x5346544e #define UDF_SUPER_MAGIC 0x15013346 #define XFS_SUPER_MAGIC 0x58465342 +#define SMB2_SUPER_MAGIC 0xFE534D42 //Log出力時の文字列 //RapidCopyが独自に決めてるだけだよ @@ -91,6 +93,7 @@ const long INTERVAL_MS = 250 * NANO_SECOND_MULTIPLIER; #define FSLOGNAME_NFS "NFS" #define FSLOGNAME_REISERFS "REISERFS" #define FSLOGNAME_SMBFS "SMB" +#define FSLOGNAME_SMB2FS "SMB2" #define FSLOGNAME_CIFS "CIFS" #define FSLOGNAME_FUSE "FUSE" #define FSLOGNAME_HFS "HFS" diff --git a/resource.h b/resource.h index b47074f..9a51003 100644 --- a/resource.h +++ b/resource.h @@ -121,6 +121,7 @@ #define IDS_VERIFY_ERROR_WARN_3 129 #define IDS_MOVEDIR_FAILED 130 #define IDS_NEWWINDOW_FAILED 131 +#define IDS_SMALLBUF_ERR 132 #define IDS_FASTCOPY 1000 #define IDS_USAGE 1001 diff --git a/static_bin/CentOS72/RapidCopy.gz b/static_bin/CentOS72/RapidCopy.gz index a076fbe..77b0ed8 100644 Binary files a/static_bin/CentOS72/RapidCopy.gz and b/static_bin/CentOS72/RapidCopy.gz differ diff --git a/static_bin/ubuntu1604/RapidCopy.gz b/static_bin/ubuntu1604/RapidCopy.gz index 02f0d40..4dd72bd 100644 Binary files a/static_bin/ubuntu1604/RapidCopy.gz and b/static_bin/ubuntu1604/RapidCopy.gz differ diff --git a/tmisc.cpp b/tmisc.cpp index b212020..d663ca4 100644 --- a/tmisc.cpp +++ b/tmisc.cpp @@ -127,6 +127,7 @@ static StringTable msgtxt [] = { {IDS_VERIFY_ERROR_WARN_3, QObject::tr("\nIt might have also destruction occurred in other files.\nCheck the file contents of dst, Recommend ""overwrite"" re-run.\nPlease make sure there is no problem in following.\nDisk devices,FileSystems,drivers,cables....")}, {IDS_MOVEDIR_FAILED, QObject::tr("rmdir(move)failed:Check write failed file or hidden file exists.")}, {IDS_NEWWINDOW_FAILED, QObject::tr("""Open New Window"" is not possible during the operation of the RapidCopy.")}, + {IDS_SMALLBUF_ERR, QObject::tr("Too large or small Main Buffer.\n need %dMB or over and under 2047MB")}, // blank132<->999 {IDS_FASTCOPY, QObject::tr("RapidCopy")}, {IDS_HIST_CLEAR, QObject::tr("Clear path")}, diff --git a/version.cpp b/version.cpp index 309ca72..eabbe72 100644 --- a/version.cpp +++ b/version.cpp @@ -24,7 +24,7 @@ static char admin_str[32]; void SetVersionStr(BOOL is_admin) { - char *versionstr = "1.2.7"; + char *versionstr = "1.3.0"; sprintf(version_str,"v%s",versionstr); }