Search is not available for this dataset
repo
stringlengths
2
152
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/simple/centos7/bluestore/dmcrypt-plain/host_vars/osd0.yml
--- devices: - '/dev/sdb' dedicated_devices: - '/dev/sdc' osd_scenario: "non-collocated"
94
10.875
30
yml
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/simple/centos7/bluestore/dmcrypt-plain/host_vars/osd1.yml
--- devices: - '/dev/sdb' - '/dev/sdc' osd_scenario: "collocated"
71
9.285714
26
yml
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/tests/__init__.py
0
0
0
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/tests/conftest.py
import pytest import os @pytest.fixture() def node(host, request): """ This fixture represents a single node in the ceph cluster. Using the host.ansible fixture provided by testinfra it can access all the ansible variables provided to it by the specific test scenario being ran. You must include this ...
3,983
37.307692
88
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/tests/osd/__init__.py
0
0
0
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/functional/tests/osd/test_osds.py
import json class TestOSDs(object): def test_ceph_osd_package_is_installed(self, node, host): assert host.package("ceph-osd").is_installed def test_osds_listen_on_public_network(self, node, host): # TODO: figure out way to paramaterize this test nb_port = (node["num_osds"] * node["nu...
2,609
41.786885
183
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/systemd/test_main.py
import pytest from ceph_volume import exceptions, conf from ceph_volume.systemd.main import parse_subcommand, main, process class TestParseSubcommand(object): def test_no_subcommand_found(self): with pytest.raises(exceptions.SuffixParsingError): parse_subcommand('') def test_sub_command_...
1,377
25.5
89
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py
import pytest from ceph_volume.systemd import systemctl class TestSystemctl(object): @pytest.mark.parametrize("stdout,expected", [ (['Id=ceph-osd@1.service', '', 'Id=ceph-osd@2.service'], ['1','2']), (['Id=ceph-osd1.service',], []), (['Id=ceph-osd@1'], ['1']), ([], []), ]) ...
765
33.818182
76
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_arg_validators.py
import argparse import pytest import os from ceph_volume import exceptions, process from ceph_volume.util import arg_validators from mock.mock import patch, MagicMock class TestOSDPath(object): def setup_method(self): self.validator = arg_validators.OSDPath() def test_is_not_root(self, monkeypatch):...
14,940
39.490515
133
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_device.py
import os import pytest from copy import deepcopy from ceph_volume.util import device from ceph_volume.api import lvm as api from mock.mock import patch, mock_open class TestDevice(object): def test_sys_api(self, monkeypatch, device_info): volume = api.Volume(lv_name='lv', lv_uuid='y', vg_name='vg', ...
32,368
44.913475
126
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_disk.py
import os import pytest from ceph_volume.util import disk from mock.mock import patch class TestLsblkParser(object): def test_parses_whitespace_values(self): output = 'NAME="sdaa5" PARTLABEL="ceph data" RM="0" SIZE="10M" RO="0" TYPE="part"' result = disk._lsblk_parser(output) assert resul...
19,396
35.32397
203
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_encryption.py
from ceph_volume.util import encryption from mock.mock import patch import base64 class TestGetKeySize(object): def test_get_size_from_conf_default(self, conf_ceph_stub): conf_ceph_stub(''' [global] fsid=asdf ''') assert encryption.get_key_size_from_conf() == '512' def ...
4,386
30.561151
81
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_prepare.py
import pytest from textwrap import dedent import json from ceph_volume.util import prepare from ceph_volume.util.prepare import system from ceph_volume import conf from ceph_volume.tests.conftest import Factory class TestOSDIDAvailable(object): def test_false_if_id_is_none(self): assert not prepare.osd_i...
11,024
36.627986
98
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_system.py
import os import pwd import getpass import pytest from textwrap import dedent from ceph_volume.util import system from mock.mock import patch from ceph_volume.tests.conftest import Factory @pytest.fixture def mock_find_executable_on_host(monkeypatch): """ Monkeypatches util.system.find_executable_on_host, so ...
12,909
40.645161
156
py
null
ceph-main/src/ceph-volume/ceph_volume/tests/util/test_util.py
import pytest from ceph_volume import util class TestAsBytes(object): def test_bytes_just_gets_returned(self): bytes_string = "contents".encode('utf-8') assert util.as_bytes(bytes_string) == bytes_string def test_string_gets_converted_to_bytes(self): result = util.as_bytes('contents'...
3,642
30.136752
74
py
null
ceph-main/src/ceph-volume/ceph_volume/util/__init__.py
import logging from math import floor from ceph_volume import terminal try: input = raw_input # pylint: disable=redefined-builtin except NameError: pass logger = logging.getLogger(__name__) def as_string(string): """ Ensure that whatever type of string is incoming, it is returned as an actual s...
3,072
27.453704
78
py
null
ceph-main/src/ceph-volume/ceph_volume/util/arg_validators.py
import argparse import os import math from ceph_volume import terminal, decorators, process from ceph_volume.util.device import Device from ceph_volume.util import disk def valid_osd_id(val): return str(int(val)) class ValidDevice(object): def __init__(self, as_string=False, gpt_ok=False): self.as_s...
9,462
39.268085
117
py
null
ceph-main/src/ceph-volume/ceph_volume/util/constants.py
# mount flags mount = dict( xfs=['rw', 'noatime' , 'inode64'] ) # format flags mkfs = dict( xfs=[ # force overwriting previous fs '-f', # set the inode size to 2kb '-i', 'size=2048', ], ) # The fantastical world of ceph-disk labels, they should give you the # collywobbles...
2,743
57.382979
113
py
null
ceph-main/src/ceph-volume/ceph_volume/util/device.py
# -*- coding: utf-8 -*- import logging import os from functools import total_ordering from ceph_volume import sys_info from ceph_volume.api import lvm from ceph_volume.util import disk, system from ceph_volume.util.lsmdisk import LSMDisk from ceph_volume.util.constants import ceph_disk_guids from ceph_volume.util.disk...
25,464
34.765449
208
py
null
ceph-main/src/ceph-volume/ceph_volume/util/disk.py
import logging import os import re import stat import time from ceph_volume import process from ceph_volume.api import lvm from ceph_volume.util.system import get_file_contents logger = logging.getLogger(__name__) # The blkid CLI tool has some oddities which prevents having one common call # to extract the informat...
30,556
31.542066
133
py
null
ceph-main/src/ceph-volume/ceph_volume/util/encryption.py
import base64 import os import logging from ceph_volume import process, conf, terminal from ceph_volume.util import constants, system from ceph_volume.util.device import Device from .prepare import write_keyring from .disk import lsblk, device_family, get_part_entry_type logger = logging.getLogger(__name__) mlogger = ...
9,497
33.413043
101
py
null
ceph-main/src/ceph-volume/ceph_volume/util/lsmdisk.py
""" This module handles the interaction with libstoragemgmt for local disk devices. Interaction may fail with LSM for a number of issues, but the intent here is to make this a soft fail, since LSM related data is not a critical component of ceph-volume. """ import logging try: from lsm import LocalDisk, LsmError ...
6,866
33.857868
102
py
null
ceph-main/src/ceph-volume/ceph_volume/util/prepare.py
""" These utilities for prepare provide all the pieces needed to prepare a device but also a compounded ("single call") helper to do them in order. Some plugins may want to change some part of the process, while others might want to consume the single-call helper """ import errno import os import logging import json im...
15,676
33.006508
140
py
null
ceph-main/src/ceph-volume/ceph_volume/util/system.py
import errno import logging import os import pwd import platform import tempfile import uuid import subprocess import threading from ceph_volume import process, terminal from . import as_string # python2 has no FileNotFoundError try: FileNotFoundError except NameError: FileNotFoundError = OSError logger = log...
13,375
30.847619
128
py
null
ceph-main/src/ceph-volume/ceph_volume/util/templates.py
osd_header = """ {:-^100}""".format('') osd_component_titles = """ Type Path LV Size % of device""" osd_reused_id = """ OSD id {id_: <55}""" osd_component = """ {_type: <15} {path: <55} {size: <15} {percent:.2%}""" osd_encrypt...
881
16.64
104
py
null
ceph-main/src/ceph-volume/plugin/zfs/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages requirements = [ ] setup_requirements = [ ] setup( author="Willem Jan Withagen", author_email='wjw@digiware.nl', classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Enviro...
1,330
28.577778
66
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/__init__.py
# -*- coding: utf-8 -*- """Top-level package for Ceph volume on ZFS.""" __author__ = """Willem Jan Withagen""" __email__ = 'wjw@digiware.nl' import ceph_volume_zfs.zfs from collections import namedtuple sys_info = namedtuple('sys_info', ['devices']) sys_info.devices = dict()
281
19.142857
47
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/zfs.py
# -*- coding: utf-8 -*- from __future__ import print_function import argparse import os import sys import logging from textwrap import dedent from ceph_volume import log, conf, configuration from ceph_volume import exceptions from ceph_volume import terminal # The ceph-volume-zfs specific code import ceph_volume_zfs...
5,044
31.973856
79
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/api/__init__.py
""" Device API that can be shared among other implementations. """
67
16
58
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/__init__.py
# -*- coding: utf-8 -*- from . import zfs
42
13.333333
23
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/__init__.py
# -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__)
77
14.6
36
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/inventory.py
import argparse import json from textwrap import dedent # import ceph_volume.process from ceph_volume_zfs.util.disk import Disks class Inventory(object): help = 'Generate a list of available devices' def __init__(self, argv): self.argv = argv def format_report(self, inventory): if self...
1,363
25.745098
80
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/main.py
# vim: expandtab smarttab shiftwidth=4 softtabstop=4 import argparse from textwrap import dedent from ceph_volume import terminal from . import inventory from . import prepare from . import zap class ZFSDEV(object): help = 'Use ZFS to deploy OSDs' _help = dedent(""" Use ZFS to deploy OSDs ...
890
23.081081
71
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/prepare.py
import argparse from textwrap import dedent # from ceph_volume.util import arg_validators class Prepare(object): help = 'Prepare a device' def __init__(self, argv): self.argv = argv def main(self): sub_command_help = dedent(""" Prepare a device """) parser = argparse.Ar...
581
21.384615
53
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/zap.py
import argparse from textwrap import dedent # from ceph_volume.util import arg_validators class Zap(object): help = 'Zap a device' def __init__(self, argv): self.argv = argv def main(self): sub_command_help = dedent(""" Zap a device """) parser = argparse.ArgumentParser...
871
23.914286
102
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/util/__init__.py
# -*- coding: utf-8 -*-
24
11.5
23
py
null
ceph-main/src/ceph-volume/plugin/zfs/ceph_volume_zfs/util/disk.py
import re from ceph_volume.util.disk import human_readable_size from ceph_volume import process from ceph_volume import sys_info report_template = """ /dev/{geomname:<16} {mediasize:<16} {rotational!s:<7} {descr}""" # {geomname:<25} {mediasize:<12} {rotational!s:<7} {mode!s:<9} {descr}""" def geom_disk_parser(block)...
3,995
25.818792
78
py
null
ceph-main/src/cephadm/build.py
#!/usr/bin/python3 """Build cephadm from one or more files into a standalone executable. """ # TODO: If cephadm is being built and packaged within a format such as RPM # do we have to do anything special wrt passing in the version # of python to build with? Even with the intermediate cmake layer? import argparse impor...
5,958
28.068293
78
py
null
ceph-main/src/cephadm/build.sh
#!/bin/bash -ex SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" exec python3 $SCRIPT_DIR/build.py "$@"
120
19.166667
62
sh
null
ceph-main/src/cephadm/cephadm.py
#!/usr/bin/python3 import asyncio import asyncio.subprocess import argparse import datetime import fcntl import ipaddress import io import json import logging from logging.config import dictConfig import os import platform import pwd import random import shlex import shutil import socket import string import subproces...
395,702
37.04105
305
py
null
ceph-main/src/cephadm/vstart-cleanup.sh
#!/bin/sh -ex bin/ceph mon rm `hostname` for f in `bin/ceph orch ls | grep -v NAME | awk '{print $1}'` ; do bin/ceph orch rm $f --force done
146
20
66
sh
null
ceph-main/src/cephadm/vstart-smoke.sh
#!/bin/bash -ex # this is a smoke test, meant to be run against vstart.sh. host="$(hostname)" bin/init-ceph stop || true MON=1 OSD=1 MDS=0 MGR=1 ../src/vstart.sh -d -n -x -l --cephadm export CEPH_DEV=1 bin/ceph orch ls bin/ceph orch apply mds foo 1 bin/ceph orch ls | grep foo while ! bin/ceph orch ps | grep mds.fo...
2,331
25.804598
79
sh
null
ceph-main/src/cephadm/box/__init__.py
0
0
0
py
null
ceph-main/src/cephadm/box/box.py
#!/bin/python3 import argparse import os import stat import json import sys import host import osd from multiprocessing import Process, Pool from util import ( BoxType, Config, Target, ensure_inside_container, ensure_outside_container, get_boxes_container_info, run_cephadm_shell_command, ...
14,100
32.978313
111
py
null
ceph-main/src/cephadm/box/docker-compose-docker.yml
version: "2.4" services: cephadm-host-base: build: context: . environment: - CEPH_BRANCH=master image: cephadm-box privileged: true stop_signal: RTMIN+3 volumes: - ../../../:/ceph - ..:/cephadm - ./daemon.json:/etc/docker/daemon.json # dangerous, maybe just ...
792
18.825
117
yml
null
ceph-main/src/cephadm/box/docker-compose.cgroup1.yml
version: "2.4" # If cgroups v2 is disabled then add cgroup fs services: seed: volumes: - "/sys/fs/cgroup:/sys/fs/cgroup:ro" hosts: volumes: - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
250
21.818182
52
yml
null
ceph-main/src/cephadm/box/host.py
import os from typing import List, Union from util import ( Config, HostContainer, Target, get_boxes_container_info, get_container_engine, inside_container, run_cephadm_shell_command, run_dc_shell_command, run_shell_command, engine, BoxType ) def _setup_ssh(container: Host...
4,095
32.85124
132
py
null
ceph-main/src/cephadm/box/osd.py
import json import os import time import re from typing import Dict from util import ( BoxType, Config, Target, ensure_inside_container, ensure_outside_container, get_orch_hosts, run_cephadm_shell_command, run_dc_shell_command, get_container_engine, run_shell_command, ) DEVICES...
5,262
32.310127
99
py
null
ceph-main/src/cephadm/box/util.py
import json import os import subprocess import sys import copy from abc import ABCMeta, abstractmethod from enum import Enum from typing import Any, Callable, Dict, List class Colors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\...
13,334
30.599526
182
py
null
ceph-main/src/cephadm/containers/keepalived/README.md
# quay.io/ceph/keepalived A small [ubi8-minimal](https://catalog.redhat.com/software/containers/registry/registry.access.redhat.com/repository/ubi8/ubi-minimal) based Docker container that provides a method of IP high availability via [keepalived](http://www.keepalived.org/) (VRRP failover), and optional Kubernetes AP...
11,431
47.854701
657
md
null
ceph-main/src/cephadm/containers/keepalived/skel/init.sh
#!/bin/bash set -e set -o pipefail KEEPALIVED_DEBUG=${KEEPALIVED_DEBUG:-false} KEEPALIVED_KUBE_APISERVER_CHECK=${KEEPALIVED_KUBE_APISERVER_CHECK:-false} KEEPALIVED_CONF=${KEEPALIVED_CONF:-/etc/keepalived/keepalived.conf} KEEPALIVED_VAR_RUN=${KEEPALIVED_VAR_RUN:-/var/run/keepalived} if [[ ${KEEPALIVED_DEBUG,,} == 't...
557
24.363636
73
sh
null
ceph-main/src/cephadm/tests/__init__.py
0
0
0
py
null
ceph-main/src/cephadm/tests/fixtures.py
import mock import os import pytest import time from contextlib import contextmanager from pyfakefs import fake_filesystem from typing import Dict, List, Optional def import_cephadm(): """Import cephadm as a module.""" import cephadm as _cephadm return _cephadm def mock_docker(): _cephadm = impor...
5,143
30.558282
94
py
null
ceph-main/src/cephadm/tests/test_agent.py
from unittest import mock import copy, datetime, json, os, socket, threading import pytest from tests.fixtures import with_cephadm_ctx, cephadm_fs, import_cephadm from typing import Optional _cephadm = import_cephadm() FSID = "beefbeef-beef-beef-1234-beefbeefbeef" AGENT_ID = 'host1' AGENT_DIR = f'/var/lib/ceph/{F...
30,479
37.052434
154
py
null
ceph-main/src/cephadm/tests/test_cephadm.py
# type: ignore import errno import json import mock import os import pytest import socket import unittest from textwrap import dedent from .fixtures import ( cephadm_fs, mock_docker, mock_podman, with_cephadm_ctx, mock_bad_firewalld, import_cephadm, ) from pyfakefs import fake_filesystem from...
108,029
39.59752
870
py
null
ceph-main/src/cephadm/tests/test_container_engine.py
from unittest import mock import pytest from tests.fixtures import with_cephadm_ctx, import_cephadm _cephadm = import_cephadm() def test_container_engine(): with pytest.raises(NotImplementedError): _cephadm.ContainerEngine() class PhonyContainerEngine(_cephadm.ContainerEngine): EXE = "true...
1,810
31.927273
66
py
null
ceph-main/src/cephadm/tests/test_enclosure.py
import pytest from unittest import mock from tests.fixtures import host_sysfs, import_cephadm _cephadm = import_cephadm() @pytest.fixture def enclosure(host_sysfs): e = _cephadm.Enclosure( enc_id='1', enc_path='/sys/class/scsi_generic/sg2/device/enclosure/0:0:1:0', dev_path='/sys/class/s...
2,318
30.767123
87
py
null
ceph-main/src/cephadm/tests/test_ingress.py
from unittest import mock import json import pytest from tests.fixtures import with_cephadm_ctx, cephadm_fs, import_cephadm _cephadm = import_cephadm() SAMPLE_UUID = "2d018a3f-8a8f-4cb9-a7cf-48bebb2cbaae" SAMPLE_HAPROXY_IMAGE = "registry.example.net/haproxy/haproxy:latest" SAMPLE_KEEPALIVED_IMAGE = "registry.exampl...
9,840
27.037037
91
py
null
ceph-main/src/cephadm/tests/test_networks.py
import json from textwrap import dedent from unittest import mock import pytest from tests.fixtures import with_cephadm_ctx, cephadm_fs, import_cephadm _cephadm = import_cephadm() class TestCommandListNetworks: @pytest.mark.parametrize("test_input, expected", [ ( dedent(""" defa...
12,884
54.064103
140
py
null
ceph-main/src/cephadm/tests/test_nfs.py
from unittest import mock import json import pytest from tests.fixtures import with_cephadm_ctx, cephadm_fs, import_cephadm _cephadm = import_cephadm() SAMPLE_UUID = "2d018a3f-8a8f-4cb9-a7cf-48bebb2cbaae" def good_nfs_json(): return nfs_json( pool=True, files=True, ) def nfs_json(**kwar...
6,620
26.5875
79
py
null
ceph-main/src/cephadm/tests/test_util_funcs.py
# Tests for various assorted utility functions found within cephadm # from unittest import mock import functools import io import os import sys import pytest from tests.fixtures import with_cephadm_ctx, import_cephadm _cephadm = import_cephadm() class TestCopyTree: def _copy_tree(self, *args, **kwargs): ...
24,599
29.407911
90
py
null
ceph-main/src/client/Client.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General P...
468,914
27.441499
146
cc
null
ceph-main/src/client/Client.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
60,652
35.781686
130
h
null
ceph-main/src/client/ClientSnapRealm.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "ClientSnapRealm.h" #include "common/Formatter.h" using std::set; using std::vector; void SnapRealm::build_snap_context() { set<snapid_t> snaps; snapid_t max_seq = seq; // start with prior_parents? for...
1,923
29.0625
107
cc
null
ceph-main/src/client/ClientSnapRealm.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_CLIENT_SNAPREALM_H #define CEPH_CLIENT_SNAPREALM_H #include "include/types.h" #include "common/snap_types.h" #include "include/xlist.h" struct Inode; struct SnapRealm { inodeno_t ino; int nref; snapi...
1,649
24.384615
101
h
null
ceph-main/src/client/Delegation.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "common/Clock.h" #include "common/Timer.h" #include "Client.h" #include "Inode.h" #include "Fh.h" #include "Delegation.h" class C_Deleg_Timeout : public Context { Delegation *deleg; public: explicit C_Deleg_...
3,545
25.863636
81
cc
null
ceph-main/src/client/Delegation.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef _CEPH_CLIENT_DELEGATION_H #define _CEPH_CLIENT_DELEGATION_H #include "common/Clock.h" #include "common/Timer.h" #include "include/cephfs/ceph_ll_client.h" /* Commands for manipulating delegation state */ #ifndef ...
1,493
24.758621
74
h
null
ceph-main/src/client/Dentry.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "include/types.h" #include "include/utime.h" #include "Dentry.h" #include "Dir.h" #include "Inode.h" #include "common/Formatter.h" void Dentry::dump(Formatter *f) const { f->dump_string("name", name); f->d...
879
24.882353
74
cc
null
ceph-main/src/client/Dentry.h
#ifndef CEPH_CLIENT_DENTRY_H #define CEPH_CLIENT_DENTRY_H #include "include/lru.h" #include "include/xlist.h" #include "mds/mdstypes.h" #include "Inode.h" #include "InodeRef.h" #include "Dir.h" class Dentry : public LRUObject { public: explicit Dentry(Dir *_dir, const std::string &_name) : dir(_dir), name(_nam...
2,430
23.069307
85
h
null
ceph-main/src/client/Dir.h
#ifndef CEPH_CLIENT_DIR_H #define CEPH_CLIENT_DIR_H #include <string> #include <vector> class Dentry; struct Inode; class Dir { public: Inode *parent_inode; // my inode ceph::unordered_map<std::string, Dentry*> dentries; unsigned num_null_dentries = 0; std::vector<Dentry*> readdir_cache; explicit Di...
416
16.375
53
h
null
ceph-main/src/client/Fh.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2017 Red Hat Inc * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License versi...
678
19.575758
81
cc
null
ceph-main/src/client/Fh.h
#ifndef CEPH_CLIENT_FH_H #define CEPH_CLIENT_FH_H #include "common/Readahead.h" #include "include/types.h" #include "InodeRef.h" #include "UserPerm.h" #include "mds/flock.h" class Inode; // file handle for any open file state struct Fh { InodeRef inode; int flags; uint64_t gen; UserPerm actor_perms...
1,539
22.333333
77
h
null
ceph-main/src/client/Inode.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "Client.h" #include "Inode.h" #include "Dentry.h" #include "Dir.h" #include "Fh.h" #include "MetaSession.h" #include "ClientSnapRealm.h" #include "Delegation.h" #include "mds/flock.h" using std::dec; using std:...
21,956
25.941104
126
cc
null
ceph-main/src/client/Inode.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_CLIENT_INODE_H #define CEPH_CLIENT_INODE_H #include <numeric> #include "include/compat.h" #include "include/ceph_assert.h" #include "include/types.h" #include "include/xlist.h" #include "mds/flock.h" #incl...
9,590
25.133515
95
h
null
ceph-main/src/client/InodeRef.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_CLIENT_INODEREF_H #define CEPH_CLIENT_INODEREF_H #include <boost/intrusive_ptr.hpp> class Inode; void intrusive_ptr_add_ref(Inode *in); void intrusive_ptr_release(Inode *in); typedef boost::intrusive_ptr<Ino...
341
25.307692
70
h
null
ceph-main/src/client/MetaRequest.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "include/types.h" #include "client/MetaRequest.h" #include "client/Dentry.h" #include "client/Inode.h" #include "messages/MClientReply.h" #include "common/Formatter.h" void MetaRequest::dump(Formatter *f) const ...
2,238
26.641975
72
cc
null
ceph-main/src/client/MetaRequest.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_CLIENT_METAREQUEST_H #define CEPH_CLIENT_METAREQUEST_H #include "include/types.h" #include "include/xlist.h" #include "include/filepath.h" #include "mds/mdstypes.h" #include "InodeRef.h" #include "UserPerm....
6,922
28.088235
95
h
null
ceph-main/src/client/MetaSession.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "include/types.h" #include "messages/MClientCapRelease.h" #include "MetaSession.h" #include "Inode.h" #include "common/Formatter.h" const char *MetaSession::get_state_name() const { switch (state) { case S...
1,613
24.619048
86
cc
null
ceph-main/src/client/MetaSession.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_CLIENT_METASESSION_H #define CEPH_CLIENT_METASESSION_H #include "include/types.h" #include "include/utime.h" #include "include/xlist.h" #include "mds/MDSMap.h" #include "mds/mdstypes.h" #include "messages/MC...
1,861
22.871795
83
h
null
ceph-main/src/client/ObjecterWriteback.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef CEPH_OSDC_OBJECTERWRITEBACKHANDLER_H #define CEPH_OSDC_OBJECTERWRITEBACKHANDLER_H #include "osdc/Objecter.h" #include "osdc/WritebackHandler.h" class ObjecterWriteback : public WritebackHandler { public: Objec...
2,406
32.901408
81
h
null
ceph-main/src/client/RWRef.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2020 Red Hat, Inc. * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License vers...
7,286
28.742857
87
h
null
ceph-main/src/client/SyntheticClient.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
95,004
26.625763
132
cc
null
ceph-main/src/client/SyntheticClient.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
7,239
24.673759
101
h
null
ceph-main/src/client/Trace.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
1,702
20.2875
87
cc
null
ceph-main/src/client/Trace.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
1,348
18.838235
71
h
null
ceph-main/src/client/UserPerm.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2016 Red Hat * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2...
2,311
23.595745
78
h
null
ceph-main/src/client/barrier.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * * Copyright (C) 2012 CohortFS, LLC. * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software...
4,594
22.443878
70
cc
null
ceph-main/src/client/barrier.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * * Copyright (C) 2012 CohortFS, LLC. * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software...
2,273
21.74
70
h
null
ceph-main/src/client/fuse_ll.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General P...
49,980
26.537741
95
cc
null
ceph-main/src/client/fuse_ll.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General ...
701
23.206897
71
h
null
ceph-main/src/client/ioctl.h
#ifndef FS_CEPH_IOCTL_H #define FS_CEPH_IOCTL_H #include "include/int_types.h" #if defined(__linux__) #include <linux/ioctl.h> #include <linux/types.h> #elif defined(__APPLE__) || defined(__FreeBSD__) #include <sys/ioctl.h> #include <sys/types.h> #endif #define CEPH_IOCTL_MAGIC 0x97 /* just use u64 to align sanely ...
1,482
27.519231
66
h
null
ceph-main/src/client/posix_acl.cc
#include "include/compat.h" #include "include/types.h" #include "include/fs_types.h" #include <sys/stat.h> #include "posix_acl.h" #include "UserPerm.h" int posix_acl_check(const void *xattr, size_t size) { const acl_ea_header *header; if (size < sizeof(*header)) return -1; header = reinterpret_cast<const acl...
6,553
21.678201
84
cc
null
ceph-main/src/client/posix_acl.h
#ifndef CEPH_POSIX_ACL #define CEPH_POSIX_ACL #define ACL_EA_VERSION 0x0002 #define ACL_USER_OBJ 0x01 #define ACL_USER 0x02 #define ACL_GROUP_OBJ 0x04 #define ACL_GROUP 0x08 #define ACL_MASK 0x10 #define ACL_OTHER 0x20 #define AC...
1,001
26.833333
73
h
null
ceph-main/src/client/test_ioctls.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <limits.h> #include <sys/ioctl.h> #include <netinet/in.h> #include <sys/socket.h> #include <netdb.h> #include "ioctl.h" char new_file_name[PATH_MAX]; int main(int argc, char **argv) {...
3,691
29.01626
118
c
null
ceph-main/src/client/hypertable/CephBroker.cc
/** -*- C++ -*- * Copyright (C) 2009-2011 New Dream Network * * This file is part of Hypertable. * * Hypertable is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any...
14,707
26.908918
107
cc
null
ceph-main/src/client/hypertable/CephBroker.h
/** -*- C++ -*- * Copyright (C) 2009-2011 New Dream Network * * This file is part of Hypertable. * * Hypertable is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any...
3,854
31.669492
91
h
null
ceph-main/src/cls/2pc_queue/cls_2pc_queue.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "include/types.h" #include "cls/2pc_queue/cls_2pc_queue_types.h" #include "cls/2pc_queue/cls_2pc_queue_ops.h" #include "cls/2pc_queue/cls_2pc_queue_const.h" #include "cls/queue/cls_queue_ops.h" #include "cls/que...
22,789
34.833333
166
cc
null
ceph-main/src/cls/2pc_queue/cls_2pc_queue_client.cc
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "cls/2pc_queue/cls_2pc_queue_client.h" #include "cls/2pc_queue/cls_2pc_queue_ops.h" #include "cls/2pc_queue/cls_2pc_queue_const.h" #include "cls/queue/cls_queue_ops.h" #include "cls/queue/cls_queue_const.h" usin...
7,287
28.746939
128
cc
null
ceph-main/src/cls/2pc_queue/cls_2pc_queue_client.h
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #pragma once #include <string> #include <vector> #include "include/rados/librados.hpp" #include "cls/queue/cls_queue_types.h" #include "cls/2pc_queue/cls_2pc_queue_types.h" // initialize the queue with maximum size (byt...
5,223
55.782609
137
h
null
ceph-main/src/cls/2pc_queue/cls_2pc_queue_const.h
#pragma once #define TPC_QUEUE_CLASS "2pc_queue" #define TPC_QUEUE_INIT "2pc_queue_init" #define TPC_QUEUE_GET_CAPACITY "2pc_queue_get_capacity" #define TPC_QUEUE_GET_TOPIC_STATS "2pc_queue_get_topic_stats" #define TPC_QUEUE_RESERVE "2pc_queue_reserve" #define TPC_QUEUE_COMMIT "2pc_queue_commit" #define TPC_QUEUE_ABO...
594
36.1875
69
h