Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/block/drbd/drbd_debugfs.c |
static int drbd_version_open(struct inode *inode, struct file *file) {
return single_open(file, drbd_version_show, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_debugfs.c | void drbd_debugfs_cleanup(void) {
drbd_debugfs_remove(&drbd_debugfs_resources);
drbd_debugfs_remove(&drbd_debugfs_minors);
drbd_debugfs_remove(&drbd_debugfs_version);
drbd_debugfs_remove(&drbd_debugfs_root);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline int drbd_insert_fault(struct drbd_device *device,
unsigned int type) {
#ifdef CONFIG_DRBD_FAULT_INJECTION
return drbd_fault_rate && (drbd_enable_faults & (1 << type)) &&
_drbd_insert_fault(device, type);
#else
return 0;
#endif
}
#define div_ceil(A, B) ((A)... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h |
static inline struct drbd_peer_device *
first_peer_device(struct drbd_device *device) {
return list_first_entry_or_null(&device->peer_devices,
struct drbd_peer_device, peer_devices);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline struct page *page_chain_next(struct page *page) {
return (struct page *)page_private(page);
}
#define page_chain_for_each(page) \
for (; page && ({ \
prefetch(page_chain_next(page)); ... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h |
static inline int
drbd_peer_req_has_active_page(struct drbd_peer_request *peer_req) {
struct page *page = peer_req->pages;
page_chain_for_each(page) {
if (page_count(page) > 1)
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline sector_t drbd_get_capacity(struct block_device *bdev) {
return bdev ? bdev_nr_sectors(bdev) : 0;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline sector_t drbd_md_ss(struct drbd_backing_dev *bdev) {
const int meta_dev_idx = bdev->md.meta_dev_idx;
if (meta_dev_idx == DRBD_MD_INDEX_FLEX_EXT)
return 0;
if (meta_dev_idx == DRBD_MD_INDEX_INTERNAL ||
meta_dev_idx == DRBD_MD_INDEX_FLEX_INT)
return (drbd_get_capacity(bdev->backing_bde... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h |
static inline void drbd_thread_restart_nowait(struct drbd_thread *thi) {
_drbd_thread_stop(thi, true, false);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline bool is_sync_state(enum drbd_conns connection_state) {
return is_sync_source_state(connection_state) ||
is_sync_target_state(connection_state);
}
#define get_ldev_if_state(_device, _min_state) \
(_get_ldev_if_state((_device), (_min_state)) ? ({ ... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline void put_ldev(struct drbd_device *device) {
enum drbd_disk_state disk_state = device->state.disk;
int i = atomic_dec_return(&device->local_cnt);
/* This may be called from some endio handler,
* so we must not sleep here. */
__release(local);
D_ASSERT(device, i >= 0);
if (i == 0) {
if... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline int _get_ldev_if_state(struct drbd_device *device,
enum drbd_disk_state mins) {
int io_allowed;
if (device->state.disk == D_DISKLESS)
return 0;
atomic_inc(&device->local_cnt);
io_allowed = (device->state.disk >= mins);
if (!io_allowed)
put_ldev(devi... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline int drbd_state_is_stable(struct drbd_device *device) {
union drbd_dev_state s = device->state;
switch ((enum drbd_conns)s.conn) {
/* new io only accepted when there is no connection, ... */
case C_STANDALONE:
case C_WF_CONNECTION:
/* ... or there is a well established connection. */
case C_... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h |
static inline bool inc_ap_bio_cond(struct drbd_device *device) {
bool rv = false;
spin_lock_irq(&device->resource->req_lock);
rv = may_inc_ap_bio(device);
if (rv)
atomic_inc(&device->ap_bio_cnt);
spin_unlock_irq(&device->resource->req_lock);
return rv;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_int.h | static inline void inc_ap_bio(struct drbd_device *device) {
wait_event(device->misc_wait, inc_ap_bio_cond(device));
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_interval.c | bool drbd_insert_interval(struct rb_root *root, struct drbd_interval *this) {
struct rb_node **new = &root->rb_node, *parent = NULL;
sector_t this_end = this->sector + (this->size >> 9);
BUG_ON(!IS_ALIGNED(this->size, 512));
while (*new) {
struct drbd_interval *here = rb_entry(*new, struct drbd_interval, ... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_interval.c |
struct drbd_interval *drbd_next_overlap(struct drbd_interval *i,
sector_t sector, unsigned int size) {
sector_t end = sector + (size >> 9);
struct rb_node *node;
for (;;) {
node = rb_next(&i->rb);
if (!node)
return NULL;
i = rb_entry(node, struct drbd_in... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | void tl_clear(struct drbd_connection *connection) {
tl_restart(connection, CONNECTION_LOST_WHILE_PENDING);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait) {
unsigned long flags;
enum drbd_thread_state ns = restart ? RESTARTING : EXITING;
spin_lock_irqsave(&thi->t_lock, flags);
if (thi->t_state == NONE) {
spin_unlock_irqrestore(&thi->t_lock, flags);
if (restart)
drbd_thread_sta... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
int conn_lowest_minor(struct drbd_connection *connection) {
struct drbd_peer_device *peer_device;
int vnr = 0, minor = -1;
rcu_read_lock();
peer_device = idr_get_next(&connection->peer_devices, &vnr);
if (peer_device)
minor = device_to_minor(peer_device->device);
rcu_read_unlock();
return minor;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static unsigned int prepare_header80(struct p_header80 *h, enum drbd_packet cmd,
int size) {
h->magic = cpu_to_be32(DRBD_MAGIC);
h->command = cpu_to_be16(cmd);
h->length = cpu_to_be16(size);
return sizeof(struct p_header80);
} | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static unsigned int prepare_header(struct drbd_connection *connection, int vnr,
void *buffer, enum drbd_packet cmd,
int size) {
if (connection->agreed_pro_version >= 100)
return prepare_header100(buffer, cmd, size, vnr);
else if (connection-... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static void *__conn_prepare_command(struct drbd_connection *connection,
struct drbd_socket *sock) {
if (!sock->socket)
return NULL;
return sock->sbuf + drbd_header_size(connection);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void *conn_prepare_command(struct drbd_connection *connection,
struct drbd_socket *sock) {
void *p;
mutex_lock(&sock->mutex);
p = __conn_prepare_command(connection, sock);
if (!p)
mutex_unlock(&sock->mutex);
return p;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void *drbd_prepare_command(struct drbd_peer_device *peer_device,
struct drbd_socket *sock) {
return conn_prepare_command(peer_device->connection, sock);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
int drbd_send_ping_ack(struct drbd_connection *connection) {
struct drbd_socket *sock;
sock = &connection->meta;
if (!conn_prepare_command(connection, sock))
return -EIO;
return conn_send_command(connection, sock, P_PING_ACK, 0, NULL, 0);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
int drbd_send_uuids_skip_initial_sync(struct drbd_peer_device *peer_device) {
return _drbd_send_uuids(peer_device, 8);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device) {
struct drbd_device *device = peer_device->device;
struct drbd_socket *sock;
struct p_rs_uuid *p;
u64 uuid;
D_ASSERT(device, device->state.disk == D_UP_TO_DATE);
uuid = device->ldev->md.uuid[UI_BITMAP];
if (uuid && uuid != UUID_JUS... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static void dcbp_set_start(struct p_compressed_bm *p, int set) {
p->encoding = (p->encoding & ~0x80) | (set ? 0x80 : 0);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void drbd_send_b_ack(struct drbd_connection *connection, u32 barrier_nr,
u32 set_size) {
struct drbd_socket *sock;
struct p_barrier_ack *p;
if (connection->cstate < C_WF_REPORT_PARAMS)
return;
sock = &connection->meta;
p = conn_prepare_command(connection, sock);
if (!p)
retur... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | int drbd_send_ov_request(struct drbd_peer_device *peer_device, sector_t sector,
int size) {
struct drbd_socket *sock;
struct p_block_req *p;
sock = &peer_device->connection->data;
p = drbd_prepare_command(peer_device, sock);
if (!p)
return -EIO;
p->sector = cpu_to_be64(sector);... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | static int _drbd_send_page(struct drbd_peer_device *peer_device,
struct page *page, int offset, size_t size,
unsigned msg_flags) {
struct socket *socket = peer_device->connection->data.socket;
int len = size;
int err = -EIO;
if (drbd_disable_sendpage || !se... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static u32 bio_flags_to_wire(struct drbd_connection *connection,
struct bio *bio) {
if (connection->agreed_pro_version >= 95)
return (bio->bi_opf & REQ_SYNC ? DP_RW_SYNC : 0) |
(bio->bi_opf & REQ_FUA ? DP_FUA : 0) |
(bio->bi_opf & REQ_PREFLUSH ? DP_FLUSH : 0) |
... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
int drbd_send_out_of_sync(struct drbd_peer_device *peer_device,
struct drbd_request *req) {
struct drbd_socket *sock;
struct p_block_desc *p;
sock = &peer_device->connection->data;
p = drbd_prepare_command(peer_device, sock);
if (!p)
return -EIO;
p->sector = cpu_to_be64(req->... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | static int drbd_open(struct block_device *bdev, fmode_t mode) {
struct drbd_device *device = bdev->bd_disk->private_data;
unsigned long flags;
int rv = 0;
mutex_lock(&drbd_main_mutex);
spin_lock_irqsave(&device->resource->req_lock, flags);
if (device->state.role != R_PRIMARY) {
if (mode & FMODE_WRITE)... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
static void drbd_release(struct gendisk *gd, fmode_t mode) {
struct drbd_device *device = gd->private_data;
mutex_lock(&drbd_main_mutex);
device->open_cnt--;
mutex_unlock(&drbd_main_mutex);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | void drbd_destroy_device(struct kref *kref) {
struct drbd_device *device = container_of(kref, struct drbd_device, kref);
struct drbd_resource *resource = device->resource;
struct drbd_peer_device *peer_device, *tmp_peer_device;
del_timer_sync(&device->request_timer);
D_ASSERT(device, device->open_cnt == 0);... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | static void do_retry(struct work_struct *ws) {
struct retry_worker *retry = container_of(ws, struct retry_worker, worker);
LIST_HEAD(writes);
struct drbd_request *req, *tmp;
spin_lock_irq(&retry->lock);
list_splice_init(&retry->writes, &writes);
spin_unlock_irq(&retry->lock);
list_for_each_entry_safe(re... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | void drbd_restart_request(struct drbd_request *req) {
unsigned long flags;
spin_lock_irqsave(&retry.lock, flags);
list_move_tail(&req->tl_requests, &retry.writes);
spin_unlock_irqrestore(&retry.lock, flags);
dec_ap_bio(req->device);
queue_work(retry.wq, &retry.worker);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | static void drbd_cleanup(void) {
unsigned int i;
struct drbd_device *device;
struct drbd_resource *resource, *tmp;
if (drbd_proc)
remove_proc_entry("drbd", NULL);
if (retry.wq)
destroy_workqueue(retry.wq);
drbd_genl_unregister();
idr_for_each_entry(&drbd_devices, device, i) drbd_delete_device(... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
struct drbd_resource *drbd_find_resource(const char *name) {
struct drbd_resource *resource;
if (!name || !name[0])
return NULL;
rcu_read_lock();
for_each_resource_rcu(resource, &drbd_resources) {
if (!strcmp(resource->name, name)) {
kref_get(&resource->kref);
goto found;
}
}
reso... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | int set_resource_options(struct drbd_resource *resource,
struct res_opts *res_opts) {
struct drbd_connection *connection;
cpumask_var_t new_cpu_mask;
int err;
if (!zalloc_cpumask_var(&new_cpu_mask, GFP_KERNEL))
return -ENOMEM;
if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) {
... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | static void drbd_free_one_sock(struct drbd_socket *ds) {
struct socket *s;
mutex_lock(&ds->mutex);
s = ds->socket;
ds->socket = NULL;
mutex_unlock(&ds->mutex);
if (s) {
synchronize_rcu();
kernel_sock_shutdown(s, SHUT_RDWR);
sock_release(s);
}
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void drbd_free_sock(struct drbd_connection *connection) {
if (connection->data.socket)
drbd_free_one_sock(&connection->data);
if (connection->meta.socket)
drbd_free_one_sock(&connection->meta);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void drbd_uuid_set(struct drbd_device *device, int idx, u64 val)
__must_hold(local) {
unsigned long flags;
spin_lock_irqsave(&device->ldev->md.uuid_lock, flags);
if (device->ldev->md.uuid[idx]) {
drbd_uuid_move_history(device);
device->ldev->md.uuid[UI_HISTORY_START] = device->ldev->md.uuid[idx];
}... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c | int drbd_bmio_set_n_write(struct drbd_device *device) __must_hold(local) {
int rv = -EIO;
drbd_md_set_flag(device, MDF_FULL_SYNC);
drbd_md_sync(device);
drbd_bm_set_all(device);
rv = drbd_bm_write(device);
if (!rv) {
drbd_md_clear_flag(device, MDF_FULL_SYNC);
drbd_md_sync(device);
}
return r... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void drbd_md_clear_flag(struct drbd_device *device, int flag)
__must_hold(local) {
if ((device->ldev->md.flags & flag) != 0) {
drbd_md_mark_dirty(device);
device->ldev->md.flags &= ~flag;
}
} | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
void lock_all_resources(void) {
struct drbd_resource *resource;
int __maybe_unused i = 0;
mutex_lock(&resources_mutex);
local_irq_disable();
for_each_resource(resource, &drbd_resources)
spin_lock_nested(&resource->req_lock, i++);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_main.c |
unsigned int _drbd_insert_fault(struct drbd_device *device, unsigned int type) {
static struct fault_random_state rrs = {0, 0};
unsigned int ret =
((drbd_fault_devs == 0 ||
((1 << device_to_minor(device)) & drbd_fault_devs) != 0) &&
(((_drbd_fault_random(&rrs) % 100) + 1) <= drbd_fault_rate))... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static void setup_khelper_env(struct drbd_connection *connection, char **envp) {
char *afs;
/* FIXME: A future version will not allow this case. */
if (connection->my_addr_len == 0 || connection->peer_addr_len == 0)
return;
switch (((struct sockaddr *)&connection->peer_addr)->sa_family) {
case AF_INET6:... | [
1,
1
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | enum drbd_peer_state conn_khelper(struct drbd_connection *connection,
char *cmd) {
char *envp[] = {
"HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
(char[20]){}, (char[60]){}, /* address */
NULL};
char *resource_name = connection->resource->name;... | [
1,
1
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | void conn_try_outdate_peer_async(struct drbd_connection *connection) {
struct task_struct *opa;
kref_get(&connection->kref);
flush_signals(current);
opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h");
if (IS_ERR(opa)) {
drbd_err(connection, "out of mem, failed to invoke fence-peer he... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info) {
struct drbd_config_context adm_ctx;
struct set_role_parms parms;
int err;
enum drbd_ret_code retcode;
enum drbd_state_rv rv;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retco... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static void drbd_md_set_sector_offsets(struct drbd_device *device,
struct drbd_backing_dev *bdev) {
sector_t md_size_sect = 0;
unsigned int al_size_sect = bdev->md.al_size_4k * 8;
bdev->md.md_offset = drbd_md_ss(bdev);
switch (bdev->md.meta_dev_idx) {
default:
bde... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static void fixup_discard_support(struct drbd_device *device,
struct request_queue *q) {
unsigned int max_discard = device->rq_queue->limits.max_discard_sectors;
unsigned int discard_granularity =
device->rq_queue->limits.discard_granularity >> SECTOR_SHIFT;
if (discard_g... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static void drbd_setup_queue_param(struct drbd_device *device,
struct drbd_backing_dev *bdev,
unsigned int max_bio_size,
struct o_qlim *o) {
struct request_queue *const q = device->rq_queue;
unsigned int max_hw_... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static bool write_ordering_changed(struct disk_conf *a, struct disk_conf *b) {
return a->disk_barrier != b->disk_barrier ||
a->disk_flushes != b->disk_flushes || a->disk_drain != b->disk_drain;
} | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static void sanitize_disk_conf(struct drbd_device *device,
struct disk_conf *disk_conf,
struct drbd_backing_dev *nbc) {
struct block_device *bdev = nbc->backing_bdev;
if (disk_conf->al_extents < DRBD_AL_EXTENTS_MIN)
disk_conf->al_extents = DRBD_AL_E... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static int open_backing_devices(struct drbd_device *device,
struct disk_conf *new_disk_conf,
struct drbd_backing_dev *nbc) {
struct block_device *bdev;
bdev = open_backing_dev(device, new_disk_conf->backing_dev, device, true);
if (IS_ERR(bdev))
... | [
1,
1
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
void drbd_backing_dev_free(struct drbd_device *device,
struct drbd_backing_dev *ldev) {
if (ldev == NULL)
return;
close_backing_dev(device, ldev->md_bdev, ldev->md_bdev != ldev->backing_bdev);
close_backing_dev(device, ldev->backing_bdev, true);
kfree(ldev->disk_conf);
kfree(... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static int adm_detach(struct drbd_device *device, int force) {
if (force) {
set_bit(FORCE_DETACH, &device->flags);
drbd_force_state(device, NS(disk, D_FAILED));
return SS_SUCCESS;
}
return drbd_request_detach_interruptible(device);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static bool conn_resync_running(struct drbd_connection *connection) {
struct drbd_peer_device *peer_device;
bool rv = false;
int vnr;
rcu_read_lock();
idr_for_each_entry(&connection->peer_devices, peer_device, vnr) {
struct drbd_device *device = peer_device->device;
if (device->state.conn == C_SYNC_... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static int alloc_shash(struct crypto_shash **tfm, char *tfm_name, int err_alg) {
if (!tfm_name[0])
return NO_ERROR;
*tfm = crypto_alloc_shash(tfm_name, 0, 0);
if (IS_ERR(*tfm)) {
*tfm = NULL;
return err_alg;
}
return NO_ERROR;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static enum drbd_ret_code alloc_crypto(struct crypto *crypto,
struct net_conf *new_net_conf) {
char hmac_name[CRYPTO_MAX_ALG_NAME];
enum drbd_ret_code rv;
rv = alloc_shash(&crypto->csums_tfm, new_net_conf->csums_alg, ERR_CSUMS_ALG);
if (rv != NO_ERROR)
return rv;
r... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static void free_crypto(struct crypto *crypto) {
crypto_free_shash(crypto->cram_hmac_tfm);
crypto_free_shash(crypto->integrity_tfm);
crypto_free_shash(crypto->csums_tfm);
crypto_free_shash(crypto->verify_tfm);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static void connection_to_info(struct connection_info *info,
struct drbd_connection *connection) {
info->conn_connection_state = connection->cstate;
info->conn_role = conn_highest_peer(connection);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | void resync_after_online_grow(struct drbd_device *device) {
int iass;
drbd_info(device, "Resync of new storage after online grow\n");
if (device->state.role != device->state.peer)
iass = (device->state.role == R_PRIMARY);
else
iass = test_bit(RESOLVE_CONFLICTS,
&first_peer_device(de... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
int drbd_adm_pause_sync(struct sk_buff *skb, struct genl_info *info) {
struct drbd_config_context adm_ctx;
enum drbd_ret_code retcode;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retcode;
if (retcode != NO_ERROR)
goto out;
mutex_lock(&adm_c... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
int drbd_adm_resume_sync(struct sk_buff *skb, struct genl_info *info) {
struct drbd_config_context adm_ctx;
union drbd_dev_state s;
enum drbd_ret_code retcode;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retcode;
if (retcode != NO_ERROR)
got... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | int drbd_adm_start_ov(struct sk_buff *skb, struct genl_info *info) {
struct drbd_config_context adm_ctx;
struct drbd_device *device;
enum drbd_ret_code retcode;
struct start_ov_parms parms;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retcode;
i... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
int drbd_adm_del_minor(struct sk_buff *skb, struct genl_info *info) {
struct drbd_config_context adm_ctx;
enum drbd_ret_code retcode;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retcode;
if (retcode != NO_ERROR)
goto out;
mutex_lock(&adm_ct... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static int notify_initial_state_done(struct sk_buff *skb, unsigned int seq) {
struct drbd_genlmsghdr *dh;
int err;
err = -EMSGSIZE;
dh = genlmsg_put(skb, 0, seq, &drbd_genl_family, 0, DRBD_INITIAL_STATE_DONE);
if (!dh)
goto nla_put_failure;
dh->minor = -1U;
dh->ret_code = NO_ERROR;
if (nla_put_not... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c |
static unsigned int
notifications_for_state_change(struct drbd_state_change *state_change) {
return 1 + state_change->n_connections + state_change->n_devices +
state_change->n_devices * state_change->n_connections;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nl.c | static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb) {
struct drbd_state_change *state_change =
(struct drbd_state_change *)cb->args[0];
unsigned int seq = cb->args[2];
unsigned int n;
enum drbd_notification_type flags = 0;
int err = 0;
cb->args[5]--;
if (cb->args[5] == 1)... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_nla.c | static int drbd_nla_check_mandatory(int maxtype, struct nlattr *nla) {
struct nlattr *head = nla_data(nla);
int len = nla_len(nla);
int rem;
nla_for_each_attr(nla, head, len, rem) {
if (nla->nla_type & DRBD_GENLA_F_MANDATORY) {
nla->nla_type &= ~DRBD_GENLA_F_MANDATORY;
if (nla_type(nla) > maxty... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static struct page *page_chain_del(struct page **head, int n) {
struct page *page;
struct page *tmp;
BUG_ON(!n);
BUG_ON(!head);
page = *head;
if (!page)
return NULL;
while (page) {
tmp = page_chain_next(page);
if (--n == 0)
break;
if (tmp == NULL)
/* insufficient pages, don... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static struct page *page_chain_tail(struct page *page, int *len) {
struct page *tmp;
int i = 1;
while ((tmp = page_chain_next(page))) {
++i;
page = tmp;
}
if (len)
*len = i;
return page;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static void conn_reclaim_net_peer_reqs(struct drbd_connection *connection) {
struct drbd_peer_device *peer_device;
int vnr;
rcu_read_lock();
idr_for_each_entry(&connection->peer_devices, peer_device, vnr) {
struct drbd_device *device = peer_device->device;
if (!atomic_read(&device->pp_in_use_by_net))
... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | struct drbd_peer_request *
drbd_alloc_peer_req(struct drbd_peer_device *peer_device, u64 id,
sector_t sector, unsigned int request_size,
unsigned int payload_size, gfp_t gfp_mask)
__must_hold(local) {
struct drbd_device *device = peer_device->device;
struct drbd_peer_requ... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static void drbd_wait_ee_list_empty(struct drbd_device *device,
struct list_head *head) {
spin_lock_irq(&device->resource->req_lock);
_drbd_wait_ee_list_empty(device, head);
spin_unlock_irq(&device->resource->req_lock);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int drbd_recv(struct drbd_connection *connection, void *buf,
size_t size) {
int rv;
rv = drbd_recv_short(connection->data.socket, buf, size, 0);
if (rv < 0) {
if (rv == -ECONNRESET)
drbd_info(connection, "sock was reset by peer\n");
else if (rv != -ERESTARTSYS)
d... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static struct socket *drbd_wait_for_connect(struct drbd_connection *connection,
struct accept_wait_data *ad) {
int timeo, connect_int, err = 0;
struct socket *s_estab = NULL;
struct net_conf *nc;
rcu_read_lock();
nc = rcu_dereference(connection->net_conf);
if (!n... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int send_first_packet(struct drbd_connection *connection,
struct drbd_socket *sock, enum drbd_packet cmd) {
if (!conn_prepare_command(connection, sock))
return -EIO;
return conn_send_command(connection, sock, cmd, 0, NULL, 0);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int drbd_recv_header(struct drbd_connection *connection,
struct packet_info *pi) {
void *buffer = connection->data.rbuf;
int err;
err = drbd_recv_all_warn(connection, buffer, drbd_header_size(connection));
if (err)
return err;
err = decode_header(connection, buffer, p... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static enum finish_epoch
drbd_may_finish_epoch(struct drbd_connection *connection,
struct drbd_epoch *epoch, enum epoch_event ev) {
int epoch_size;
struct drbd_epoch *next_epoch;
enum finish_epoch rv = FE_STILL_LIVE;
spin_lock(&connection->epoch_lock);
do {
next_epoch = NULL;
e... | [
1,
1
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int peer_request_fault_type(struct drbd_peer_request *peer_req) {
if (peer_req_op(peer_req) == REQ_OP_READ) {
return peer_req->flags & EE_APPLICATION ? DRBD_FAULT_DT_RD
: DRBD_FAULT_RS_RD;
} else {
return peer_req->flags & EE_APPLICATION ? DRBD_FAULT_DT_WR... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static void drbd_csum_ee_size(struct crypto_shash *h,
struct drbd_peer_request *r, void *d,
unsigned int payload_size) {
unsigned int tmp = r->i.size;
r->i.size = payload_size;
drbd_csum_ee(h, r, d);
r->i.size = tmp;
} | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int drbd_drain_block(struct drbd_peer_device *peer_device,
int data_size) {
struct page *page;
int err = 0;
void *data;
if (!data_size)
return 0;
page = drbd_alloc_pages(peer_device, 1, 1);
data = kmap(page);
while (data_size) {
unsigned int len = min_t(int, d... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int recv_dless_read(struct drbd_peer_device *peer_device,
struct drbd_request *req, sector_t sector,
int data_size) {
struct bio_vec bvec;
struct bvec_iter iter;
struct bio *bio;
int digest_size, err, expect;
void *dig_in = peer_device->connection->... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static struct drbd_request *find_request(struct drbd_device *device,
struct rb_root *root, u64 id,
sector_t sector, bool missing_ok,
const char *func) {
struct drbd_request *req;
req = (struct... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int receive_DataReply(struct drbd_connection *connection,
struct packet_info *pi) {
struct drbd_peer_device *peer_device;
struct drbd_device *device;
struct drbd_request *req;
sector_t sector;
int err;
struct p_data *p = pi->data;
peer_device = conn_peer_device(connect... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int receive_RSDataReply(struct drbd_connection *connection,
struct packet_info *pi) {
struct drbd_peer_device *peer_device;
struct drbd_device *device;
sector_t sector;
int err;
struct p_data *p = pi->data;
peer_device = conn_peer_device(connection, pi->vnr);
if (!pe... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int e_send_superseded(struct drbd_work *w, int unused) {
return e_send_ack(w, P_SUPERSEDED);
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int wait_for_and_update_peer_seq(struct drbd_peer_device *peer_device,
const u32 peer_seq) {
struct drbd_device *device = peer_device->device;
DEFINE_WAIT(wait);
long timeout;
int ret = 0, tp;
if (!test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags))
... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static enum req_op wire_flags_to_bio_op(u32 dpf) {
if (dpf & DP_ZEROES)
return REQ_OP_WRITE_ZEROES;
if (dpf & DP_DISCARD)
return REQ_OP_DISCARD;
else
return REQ_OP_WRITE;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int drbd_asb_recover_2p(struct drbd_peer_device *peer_device)
__must_hold(local) {
struct drbd_device *device = peer_device->device;
int hg, rv = -100;
enum drbd_after_sb_p after_sb_2p;
rcu_read_lock();
after_sb_2p = rcu_dereference(peer_device->connection->net_conf)->after_sb_2p;
rcu_read_unloc... | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int receive_req_state(struct drbd_connection *connection,
struct packet_info *pi) {
struct drbd_peer_device *peer_device;
struct drbd_device *device;
struct p_req_state *p = pi->data;
union drbd_state mask, val;
enum drbd_state_rv rv;
peer_device = conn_peer_device(conn... | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c |
static int dcbp_get_start(struct p_compressed_bm *p) {
return (p->encoding & 0x80) != 0;
} | [
1,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int receive_UnplugRemote(struct drbd_connection *connection,
struct packet_info *pi) {
tcp_sock_set_quickack(connection->data.socket->sk, 2);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/block/drbd/drbd_receiver.c | static int got_conn_RqSReply(struct drbd_connection *connection,
struct packet_info *pi) {
struct p_req_state_reply *p = pi->data;
int retcode = be32_to_cpu(p->retcode);
if (retcode >= SS_SUCCESS) {
set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags);
} else {
set_bit(CONN_WD_... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.