[FileBackend] Reduced code duplication with new getPathsToLockForOpsInternal() function.