Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | block/blk-cgroup.h |
static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css) {
return css ? container_of(css, struct blkcg, css) : NULL;
} | [
0,
0
] |
Linux Kernel | block/blk-cgroup.h | static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
struct request_queue *q) {
struct blkcg_gq *blkg;
WARN_ON_ONCE(!rcu_read_lock_held());
if (blkcg == &blkcg_root)
return q->root_blkg;
blkg = rcu_dereference(blkcg->blkg_hint);
if (blkg && blkg->q ... | [
1,
0
] |
Linux Kernel | block/blk-cgroup.h | static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) {
return cgroup_path(blkg->blkcg->css.cgroup, buf, buflen);
} | [
0,
0
] |
Linux Kernel | block/blk-cgroup.h | static inline bool blkg_tryget(struct blkcg_gq *blkg) {
return blkg && percpu_ref_tryget(&blkg->refcnt);
} | [
0,
0
] |
Linux Kernel | block/blk-cgroup.h | static inline void blkcg_exit_disk(struct gendisk *disk) {} | [
0,
0
] |
Linux Kernel | block/blk-core.c | bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q) {
return test_and_set_bit(flag, &q->queue_flags);
} | [
0,
0
] |
Linux Kernel | block/blk-core.c | void blk_put_queue(struct request_queue *q) {
might_sleep();
if (refcount_dec_and_test(&q->refs))
blk_free_queue(q);
} | [
0,
0
] |
Linux Kernel | block/blk-core.c | void blk_queue_start_drain(struct request_queue *q) {
blk_freeze_queue_start(q);
if (queue_is_mq(q))
blk_mq_wake_waiters(q);
/* Make blk_queue_enter() reexamine the DYING flag. */
wake_up_all(&q->mq_freeze_wq);
} | [
0,
0
] |
Linux Kernel | block/blk-core.c | int __bio_queue_enter(struct request_queue *q, struct bio *bio) {
while (!blk_try_enter_queue(q, false)) {
struct gendisk *disk = bio->bi_bdev->bd_disk;
if (bio->bi_opf & REQ_NOWAIT) {
if (test_bit(GD_DEAD, &disk->state))
goto dead;
bio_wouldblock_error(bio);
return -EAGAIN;
}
... | [
1,
0
] |
Linux Kernel | block/blk-core.c | static inline int bio_check_eod(struct bio *bio) {
sector_t maxsector = bdev_nr_sectors(bio->bi_bdev);
unsigned int nr_sectors = bio_sectors(bio);
if (nr_sectors && maxsector &&
(nr_sectors > maxsector ||
bio->bi_iter.bi_sector > maxsector - nr_sectors)) {
pr_info_ratelimited("%s: attempt to acc... | [
1,
0
] |
Linux Kernel | block/blk-core.c | static int blk_partition_remap(struct bio *bio) {
struct block_device *p = bio->bi_bdev;
if (unlikely(should_fail_request(p, bio->bi_iter.bi_size)))
return -EIO;
if (bio_sectors(bio)) {
bio->bi_iter.bi_sector += p->bd_start_sect;
trace_block_bio_remap(bio, p->bd_dev,
bio->bi... | [
0,
0
] |
Linux Kernel | block/blk-core.c |
void update_io_ticks(struct block_device *part, unsigned long now, bool end) {
unsigned long stamp;
again:
stamp = READ_ONCE(part->bd_stamp);
if (unlikely(time_after(now, stamp))) {
if (likely(try_cmpxchg(&part->bd_stamp, &stamp, now)))
__part_stat_add(part, io_ticks, end ? now - stamp : 1);
}
if (... | [
0,
0
] |
Linux Kernel | block/blk-core.c | void blk_start_plug(struct blk_plug *plug) { blk_start_plug_nr_ios(plug, 1); } | [
0,
0
] |
Linux Kernel | block/blk-crypto-fallback.c |
static int
blk_crypto_fallback_keyslot_program(struct blk_crypto_profile *profile,
const struct blk_crypto_key *key,
unsigned int slot) {
struct blk_crypto_fallback_keyslot *slotp = &blk_crypto_keyslots[slot];
const enum blk_crypto_mode_num cr... | [
1,
0
] |
Linux Kernel | block/blk-crypto-fallback.c | static void blk_crypto_fallback_decrypt_endio(struct bio *bio) {
struct bio_fallback_crypt_ctx *f_ctx = bio->bi_private;
bio->bi_private = f_ctx->bi_private_orig;
bio->bi_end_io = f_ctx->bi_end_io_orig;
if (bio->bi_status) {
mempool_free(f_ctx, bio_fallback_crypt_ctx_pool);
bio_endio(bio);
return;... | [
0,
0
] |
Linux Kernel | block/blk-crypto-internal.h |
static inline void blk_crypto_sysfs_unregister(struct gendisk *disk) {} | [
0,
0
] |
Linux Kernel | block/blk-crypto-internal.h |
static inline bool bio_crypt_rq_ctx_compatible(struct request *rq,
struct bio *bio) {
return true;
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-internal.h |
static inline void blk_crypto_rq_set_defaults(struct request *rq) {} | [
0,
0
] |
Linux Kernel | block/blk-crypto-internal.h | static inline bool blk_crypto_bio_prep(struct bio **bio_ptr) {
if (bio_has_crypt_ctx(*bio_ptr))
return __blk_crypto_bio_prep(bio_ptr);
return true;
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-internal.h |
static inline int
blk_crypto_fallback_evict_key(const struct blk_crypto_key *key) {
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-profile.c | int blk_crypto_profile_init(struct blk_crypto_profile *profile,
unsigned int num_slots) {
unsigned int slot;
unsigned int i;
unsigned int slot_hashtable_size;
memset(profile, 0, sizeof(*profile));
init_rwsem(&profile->lock);
if (num_slots == 0)
return 0;
profile->slots =... | [
1,
0
] |
Linux Kernel | block/blk-crypto-profile.c |
static void blk_crypto_profile_destroy_callback(void *profile) {
blk_crypto_profile_destroy(profile);
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-profile.c | static struct blk_crypto_keyslot *
blk_crypto_find_and_grab_keyslot(struct blk_crypto_profile *profile,
const struct blk_crypto_key *key) {
struct blk_crypto_keyslot *slot;
slot = blk_crypto_find_keyslot(profile, key);
if (!slot)
return NULL;
if (atomic_inc_return(&slot->sl... | [
0,
0
] |
Linux Kernel | block/blk-crypto-profile.c | unsigned int blk_crypto_keyslot_index(struct blk_crypto_keyslot *slot) {
return slot - slot->profile->slots;
} | [
1,
0
] |
Linux Kernel | block/blk-crypto-profile.c | bool blk_crypto_has_capabilities(const struct blk_crypto_profile *target,
const struct blk_crypto_profile *reference) {
int i;
if (!reference)
return true;
if (!target)
return false;
for (i = 0; i < ARRAY_SIZE(target->modes_supported); i++) {
if (reference->modes_... | [
0,
0
] |
Linux Kernel | block/blk-crypto-profile.c | void blk_crypto_update_capabilities(struct blk_crypto_profile *dst,
const struct blk_crypto_profile *src) {
memcpy(dst->modes_supported, src->modes_supported,
sizeof(dst->modes_supported));
dst->max_dun_bytes_supported = src->max_dun_bytes_supported;
} | [
1,
0
] |
Linux Kernel | block/blk-crypto-sysfs.c |
static struct blk_crypto_profile *kobj_to_crypto_profile(struct kobject *kobj) {
return container_of(kobj, struct blk_crypto_kobj, kobj)->profile;
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-sysfs.c |
static ssize_t blk_crypto_attr_show(struct kobject *kobj,
struct attribute *attr, char *page) {
struct blk_crypto_profile *profile = kobj_to_crypto_profile(kobj);
struct blk_crypto_attr *a = attr_to_crypto_attr(attr);
return a->show(profile, a, page);
} | [
0,
0
] |
Linux Kernel | block/blk-crypto-sysfs.c | int blk_crypto_sysfs_register(struct gendisk *disk) {
struct request_queue *q = disk->queue;
struct blk_crypto_kobj *obj;
int err;
if (!q->crypto_profile)
return 0;
obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (!obj)
return -ENOMEM;
obj->profile = q->crypto_profile;
err = kobject_init_and_add(... | [
0,
0
] |
Linux Kernel | block/blk-crypto-sysfs.c |
void blk_crypto_sysfs_unregister(struct gendisk *disk) {
kobject_put(disk->queue->crypto_kobject);
} | [
0,
0
] |
Linux Kernel | block/blk-crypto.c | static int __init bio_crypt_ctx_init(void) {
size_t i;
bio_crypt_ctx_cache = KMEM_CACHE(bio_crypt_ctx, 0);
if (!bio_crypt_ctx_cache)
goto out_no_mem;
bio_crypt_ctx_pool =
mempool_create_slab_pool(num_prealloc_crypt_ctxs, bio_crypt_ctx_cache);
if (!bio_crypt_ctx_pool)
goto out_no_mem;
BUILD_... | [
0,
0
] |
Linux Kernel | block/blk-crypto.c |
int __bio_crypt_clone(struct bio *dst, struct bio *src, gfp_t gfp_mask) {
dst->bi_crypt_context = mempool_alloc(bio_crypt_ctx_pool, gfp_mask);
if (!dst->bi_crypt_context)
return -ENOMEM;
*dst->bi_crypt_context = *src->bi_crypt_context;
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-crypto.c |
void __bio_crypt_advance(struct bio *bio, unsigned int bytes) {
struct bio_crypt_ctx *bc = bio->bi_crypt_context;
bio_crypt_dun_increment(bc->bc_dun, bytes >> bc->bc_key->data_unit_size_bits);
} | [
1,
0
] |
Linux Kernel | block/blk-crypto.c | bool __blk_crypto_bio_prep(struct bio **bio_ptr) {
struct bio *bio = *bio_ptr;
const struct blk_crypto_key *bc_key = bio->bi_crypt_context->bc_key;
if (WARN_ON_ONCE(!bio_has_data(bio))) {
bio->bi_status = BLK_STS_IOERR;
goto fail;
}
if (!bio_crypt_check_alignment(bio)) {
bio->bi_status = BLK_STS... | [
1,
0
] |
Linux Kernel | block/blk-crypto.c | int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
enum blk_crypto_mode_num crypto_mode,
unsigned int dun_bytes, unsigned int data_unit_size) {
const struct blk_crypto_mode *mode;
memset(blk_key, 0, sizeof(*blk_key));
if (crypto_mode >= ARR... | [
1,
0
] |
Linux Kernel | block/blk-flush.c |
static unsigned int blk_flush_policy(unsigned long fflags, struct request *rq) {
unsigned int policy = 0;
if (blk_rq_sectors(rq))
policy |= REQ_FSEQ_DATA;
if (fflags & (1UL << QUEUE_FLAG_WC)) {
if (rq->cmd_flags & REQ_PREFLUSH)
policy |= REQ_FSEQ_PREFLUSH;
if (!(fflags & (1UL << QUEUE_FLAG_FU... | [
1,
0
] |
Linux Kernel | block/blk-flush.c | static void blk_flush_restore_request(struct request *rq) {
rq->bio = rq->biotail;
/* make @rq a normal request */
rq->rq_flags &= ~RQF_FLUSH_SEQ;
rq->end_io = rq->flush.saved_end_io;
} | [
0,
0
] |
Linux Kernel | block/blk-flush.c | static enum rq_end_io_ret flush_end_io(struct request *flush_rq,
blk_status_t error) {
struct request_queue *q = flush_rq->q;
struct list_head *running;
struct request *rq, *n;
unsigned long flags = 0;
struct blk_flush_queue *fq = blk_get_flush_queue(q, flush_rq->mq_ctx)... | [
1,
0
] |
Linux Kernel | block/blk-flush.c | int blkdev_issue_flush(struct block_device *bdev) {
struct bio bio;
bio_init(&bio, bdev, NULL, 0, REQ_OP_WRITE | REQ_PREFLUSH);
return submit_bio_wait(&bio);
} | [
0,
0
] |
Linux Kernel | block/blk-flush.c |
struct blk_flush_queue *blk_alloc_flush_queue(int node, int cmd_size,
gfp_t flags) {
struct blk_flush_queue *fq;
int rq_sz = sizeof(struct request);
fq = kzalloc_node(sizeof(*fq), flags, node);
if (!fq)
goto fail;
spin_lock_init(&fq->mq_flush_lock);
rq_s... | [
1,
0
] |
Linux Kernel | block/blk-flush.c | void blk_free_flush_queue(struct blk_flush_queue *fq) {
if (!fq)
return;
kfree(fq->flush_rq);
kfree(fq);
} | [
0,
0
] |
Linux Kernel | block/blk-ia-ranges.c | int disk_register_independent_access_ranges(struct gendisk *disk) {
struct blk_independent_access_ranges *iars = disk->ia_ranges;
struct request_queue *q = disk->queue;
int i, ret;
lockdep_assert_held(&q->sysfs_dir_lock);
lockdep_assert_held(&q->sysfs_lock);
if (!iars)
return 0;
WARN_ON(iars->sysfs... | [
0,
0
] |
Linux Kernel | block/blk-ia-ranges.c |
static struct blk_independent_access_range *
disk_find_ia_range(struct blk_independent_access_ranges *iars,
sector_t sector) {
struct blk_independent_access_range *iar;
int i;
for (i = 0; i < iars->nr_ia_ranges; i++) {
iar = &iars->ia_range[i];
if (sector >= iar->sector && sector < ia... | [
0,
0
] |
Linux Kernel | block/blk-ia-ranges.c | void disk_set_independent_access_ranges(
struct gendisk *disk, struct blk_independent_access_ranges *iars) {
struct request_queue *q = disk->queue;
mutex_lock(&q->sysfs_dir_lock);
mutex_lock(&q->sysfs_lock);
if (iars && !disk_check_ia_ranges(disk, iars)) {
kfree(iars);
iars = NULL;
}
if (iars &... | [
0,
0
] |
Linux Kernel | block/blk-integrity.c |
bool blk_integrity_merge_bio(struct request_queue *q, struct request *req,
struct bio *bio) {
int nr_integrity_segs;
struct bio *next = bio->bi_next;
if (blk_integrity_rq(req) == 0 && bio_integrity(bio) == NULL)
return true;
if (blk_integrity_rq(req) == 0 || bio_integrity(bio... | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_format_show(struct blk_integrity *bi, char *page) {
if (bi->profile && bi->profile->name)
return sprintf(page, "%s\n", bi->profile->name);
else
return sprintf(page, "none\n");
} | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_tag_size_show(struct blk_integrity *bi, char *page) {
return sprintf(page, "%u\n", bi->tag_size);
} | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_interval_show(struct blk_integrity *bi, char *page) {
return sprintf(page, "%u\n", bi->interval_exp ? 1 << bi->interval_exp : 0);
} | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_verify_store(struct blk_integrity *bi,
const char *page, size_t count) {
char *p = (char *)page;
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
bi->flags |= BLK_INTEGRITY_VERIFY;
else
bi->flags &= ~BLK_INTEGRITY_VERIFY;
return ... | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_generate_store(struct blk_integrity *bi,
const char *page, size_t count) {
char *p = (char *)page;
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
bi->flags |= BLK_INTEGRITY_GENERATE;
else
bi->flags &= ~BLK_INTEGRITY_GENERATE;
... | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static ssize_t integrity_generate_show(struct blk_integrity *bi, char *page) {
return sprintf(page, "%d\n", (bi->flags & BLK_INTEGRITY_GENERATE) != 0);
} | [
1,
0
] |
Linux Kernel | block/blk-integrity.c |
static blk_status_t blk_integrity_nop_fn(struct blk_integrity_iter *iter) {
return BLK_STS_OK;
} | [
0,
0
] |
Linux Kernel | block/blk-ioc.c |
static void icq_free_icq_rcu(struct rcu_head *head) {
struct io_cq *icq = container_of(head, struct io_cq, __rcu_head);
kmem_cache_free(icq->__rcu_icq_cache, icq);
} | [
0,
0
] |
Linux Kernel | block/blk-ioc.c |
static void ioc_exit_icqs(struct io_context *ioc) {
struct io_cq *icq;
spin_lock_irq(&ioc->lock);
hlist_for_each_entry(icq, &ioc->icq_list, ioc_node) ioc_exit_icq(icq);
spin_unlock_irq(&ioc->lock);
} | [
0,
0
] |
Linux Kernel | block/blk-ioc.c | static void ioc_release_fn(struct work_struct *work) {
struct io_context *ioc = container_of(work, struct io_context, release_work);
spin_lock_irq(&ioc->lock);
while (!hlist_empty(&ioc->icq_list)) {
struct io_cq *icq =
hlist_entry(ioc->icq_list.first, struct io_cq, ioc_node);
struct request_queue... | [
0,
0
] |
Linux Kernel | block/blk-ioc.c | struct io_cq *ioc_lookup_icq(struct request_queue *q) {
struct io_context *ioc = current->io_context;
struct io_cq *icq;
lockdep_assert_held(&q->queue_lock);
rcu_read_lock();
icq = rcu_dereference(ioc->icq_hint);
if (icq && icq->q == q)
goto out;
icq = radix_tree_lookup(&ioc->icq_tree, q->id);
if... | [
1,
0
] |
Linux Kernel | block/blk-ioc.c |
static int __init blk_ioc_init(void) {
iocontext_cachep = kmem_cache_create("blkdev_ioc", sizeof(struct io_context),
0, SLAB_PANIC, NULL);
return 0;
} | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static struct blkcg_gq *iocg_to_blkg(struct ioc_gq *iocg) {
return pd_to_blkg(&iocg->pd);
} | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static void ioc_refresh_margins(struct ioc *ioc) {
struct ioc_margins *margins = &ioc->margins;
u32 period_us = ioc->period_us;
u64 vrate = ioc->vtime_base_rate;
margins->min = (period_us * MARGIN_MIN_PCT / 100) * vrate;
margins->low = (period_us * MARGIN_LOW_PCT / 100) * vrate;
margins->target = (period_... | [
0,
0
] |
Linux Kernel | block/blk-iocost.c | static void ioc_refresh_period_us(struct ioc *ioc) {
u32 ppm, lat, multi, period_us;
lockdep_assert_held(&ioc->lock);
if (ioc->params.qos[QOS_RLAT] >= ioc->params.qos[QOS_WLAT]) {
ppm = ioc->params.qos[QOS_RPPM];
lat = ioc->params.qos[QOS_RLAT];
} else {
ppm = ioc->params.qos[QOS_WPPM];
lat = ... | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static bool ioc_refresh_params(struct ioc *ioc, bool force) {
const struct ioc_params *p;
int idx;
lockdep_assert_held(&ioc->lock);
idx = ioc_autop_idx(ioc);
p = &autop[idx];
if (idx == ioc->autop_idx && !force)
return false;
if (idx != ioc->autop_idx) {
atomic64_set(&ioc->vtime_rate, VTIME_P... | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static void ioc_start_period(struct ioc *ioc, struct ioc_now *now) {
WARN_ON_ONCE(ioc->running != IOC_RUNNING);
write_seqcount_begin(&ioc->period_seqcount);
ioc->period_at = now->now;
ioc->period_at_vtime = now->vnow;
write_seqcount_end(&ioc->period_seqcount);
ioc->timer.expires = jiffies + usecs_to_jiff... | [
0,
0
] |
Linux Kernel | block/blk-iocost.c | static void commit_weights(struct ioc *ioc) {
lockdep_assert_held(&ioc->lock);
if (ioc->weights_updated) {
smp_wmb();
atomic_inc(&ioc->hweight_gen);
ioc->weights_updated = false;
}
} | [
0,
0
] |
Linux Kernel | block/blk-iocost.c | static u32 current_hweight_max(struct ioc_gq *iocg) {
u32 hwm = WEIGHT_ONE;
u32 inuse = iocg->active;
u64 child_inuse_sum;
int lvl;
lockdep_assert_held(&iocg->ioc->lock);
for (lvl = iocg->level - 1; lvl >= 0; lvl--) {
struct ioc_gq *parent = iocg->ancestors[lvl];
struct ioc_gq *child = iocg->ances... | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static void weight_updated(struct ioc_gq *iocg, struct ioc_now *now) {
struct ioc *ioc = iocg->ioc;
struct blkcg_gq *blkg = iocg_to_blkg(iocg);
struct ioc_cgrp *iocc = blkcg_to_iocc(blkg->blkcg);
u32 weight;
lockdep_assert_held(&ioc->lock);
weight = iocg->cfg_weight ?: iocc->dfl_weight;
if (weight != i... | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static void calc_size_vtime_cost_builtin(struct request *rq, struct ioc *ioc,
u64 *costp) {
unsigned int pages = blk_rq_stats_sectors(rq) >> IOC_SECT_TO_PAGE_SHIFT;
switch (req_op(rq)) {
case REQ_OP_READ:
*costp = pages * ioc->params.lcoefs[LCOEF_RPAGE];
break;
... | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static void ioc_cpd_free(struct blkcg_policy_data *cpd) {
kfree(container_of(cpd, struct ioc_cgrp, cpd));
} | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static void ioc_pd_free(struct blkg_policy_data *pd) {
struct ioc_gq *iocg = pd_to_iocg(pd);
struct ioc *ioc = iocg->ioc;
unsigned long flags;
if (ioc) {
spin_lock_irqsave(&ioc->lock, flags);
if (!list_empty(&iocg->active_list)) {
struct ioc_now now;
ioc_now(ioc, &now);
propagate_w... | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static void ioc_pd_stat(struct blkg_policy_data *pd, struct seq_file *s) {
struct ioc_gq *iocg = pd_to_iocg(pd);
struct ioc *ioc = iocg->ioc;
if (!ioc->enabled)
return;
if (iocg->level == 0) {
unsigned vp10k =
DIV64_U64_ROUND_CLOSEST(ioc->vtime_base_rate * 10000, VTIME_PER_USEC);
seq_prin... | [
1,
0
] |
Linux Kernel | block/blk-iocost.c |
static int ioc_weight_show(struct seq_file *sf, void *v) {
struct blkcg *blkcg = css_to_blkcg(seq_css(sf));
struct ioc_cgrp *iocc = blkcg_to_iocc(blkcg);
seq_printf(sf, "default %u\n", iocc->dfl_weight / WEIGHT_ONE);
blkcg_print_blkgs(sf, blkcg, ioc_weight_prfill, &blkcg_policy_iocost,
se... | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static int ioc_qos_show(struct seq_file *sf, void *v) {
struct blkcg *blkcg = css_to_blkcg(seq_css(sf));
blkcg_print_blkgs(sf, blkcg, ioc_qos_prfill, &blkcg_policy_iocost,
seq_cft(sf)->private, false);
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-iocost.c |
static u64 ioc_cost_model_prfill(struct seq_file *sf,
struct blkg_policy_data *pd, int off) {
const char *dname = blkg_dev_name(pd->blkg);
struct ioc *ioc = pd_to_iocg(pd)->ioc;
u64 *u = ioc->params.i_lcoefs;
if (!dname)
return 0;
seq_printf(sf,
"%s ctrl=%s... | [
0,
0
] |
Linux Kernel | block/blk-iolatency.c |
static inline struct iolatency_grp *pd_to_lat(struct blkg_policy_data *pd) {
return pd ? container_of(pd, struct iolatency_grp, pd) : NULL;
} | [
0,
0
] |
Linux Kernel | block/blk-iolatency.c | static void __blkcg_iolatency_throttle(struct rq_qos *rqos,
struct iolatency_grp *iolat,
bool issue_as_root, bool use_memdelay) {
struct rq_wait *rqw = &iolat->rq_wait;
unsigned use_delay = atomic_read(&lat_to_blkg(iolat)->use_delay);
... | [
1,
0
] |
Linux Kernel | block/blk-iolatency.c |
static inline unsigned long scale_amount(unsigned long qd, bool up) {
return max(up ? qd >> SCALE_UP_FACTOR : qd >> SCALE_DOWN_FACTOR, 1UL);
} | [
0,
0
] |
Linux Kernel | block/blk-iolatency.c |
static void blkcg_iolatency_exit(struct rq_qos *rqos) {
struct blk_iolatency *blkiolat = BLKIOLATENCY(rqos);
del_timer_sync(&blkiolat->timer);
flush_work(&blkiolat->enable_work);
blkcg_deactivate_policy(rqos->q, &blkcg_policy_iolatency);
kfree(blkiolat);
} | [
0,
0
] |
Linux Kernel | block/blk-iolatency.c |
int blk_iolatency_init(struct gendisk *disk) {
struct request_queue *q = disk->queue;
struct blk_iolatency *blkiolat;
struct rq_qos *rqos;
int ret;
blkiolat = kzalloc(sizeof(*blkiolat), GFP_KERNEL);
if (!blkiolat)
return -ENOMEM;
rqos = &blkiolat->rqos;
rqos->id = RQ_QOS_LATENCY;
rqos->ops = &b... | [
0,
0
] |
Linux Kernel | block/blk-iolatency.c |
static void iolatency_pd_stat(struct blkg_policy_data *pd, struct seq_file *s) {
struct iolatency_grp *iolat = pd_to_lat(pd);
unsigned long long avg_lat;
unsigned long long cur_win;
if (!blkcg_debug_stats)
return;
if (iolat->ssd)
return iolatency_ssd_stat(iolat, s);
avg_lat = div64_u64(iolat->la... | [
0,
0
] |
Linux Kernel | block/blk-ioprio.c |
static int ioprio_show_prio_policy(struct seq_file *sf, void *v) {
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_css(seq_css(sf));
seq_printf(sf, "%s\n", policy_name[blkcg->prio_policy]);
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-ioprio.c |
static void ioprio_free_pd(struct blkg_policy_data *pd) {
struct ioprio_blkg *ioprio_blkg = pd_to_ioprio(pd);
kfree(ioprio_blkg);
} | [
0,
0
] |
Linux Kernel | block/blk-ioprio.c | void blkcg_set_ioprio(struct bio *bio) {
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_bio(bio);
u16 prio;
if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE)
return;
prio = max_t(u16, bio->bi_ioprio, IOPRIO_PRIO_VALUE(blkcg->prio_policy, 0));
if (prio > bio->bi_ioprio)
bio->bi_ioprio = prio;
} | [
1,
0
] |
Linux Kernel | block/blk-ioprio.c |
static void __exit ioprio_exit(void) {
blkcg_policy_unregister(&ioprio_policy);
} | [
0,
0
] |
Linux Kernel | block/blk-ioprio.h | static inline int blk_ioprio_init(struct gendisk *disk) { return 0; } | [
0,
0
] |
Linux Kernel | block/blk-lib.c | static sector_t bio_discard_limit(struct block_device *bdev, sector_t sector) {
unsigned int discard_granularity = bdev_discard_granularity(bdev);
sector_t granularity_aligned_sector;
if (bdev_is_partition(bdev))
sector += bdev->bd_start_sect;
granularity_aligned_sector =
round_up(sector, discard_gr... | [
1,
0
] |
Linux Kernel | block/blk-lib.c | int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask) {
struct bio *bio = NULL;
struct blk_plug plug;
int ret;
blk_start_plug(&plug);
ret = __blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, &bio);
if (!ret && bio) {
ret =... | [
0,
0
] |
Linux Kernel | block/blk-lib.c |
static int __blkdev_issue_zero_pages(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask,
struct bio **biop) {
struct bio *bio = *biop;
int bi_size = 0;
unsigned int sz;
if (bdev_read_only(bdev))
return -EP... | [
0,
0
] |
Linux Kernel | block/blk-lib.c | int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, struct bio **biop,
unsigned flags) {
int ret;
sector_t bs_mask;
bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1;
if ((sector | nr_sects) & bs_mask)
... | [
1,
0
] |
Linux Kernel | block/blk-lib.c | int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, unsigned flags) {
int ret = 0;
sector_t bs_mask;
struct bio *bio;
struct blk_plug plug;
bool try_write_zeroes = !!bdev_write_zeroes_sectors(bdev);
bs_mask = (bdev_logical_block_s... | [
0,
0
] |
Linux Kernel | block/blk-map.c |
static struct bio *blk_rq_map_bio_alloc(struct request *rq,
unsigned int nr_vecs, gfp_t gfp_mask) {
struct bio *bio;
if (rq->cmd_flags & REQ_POLLED) {
blk_opf_t opf = rq->cmd_flags | REQ_ALLOC_CACHE;
bio = bio_alloc_bioset(NULL, nr_vecs, opf, gfp_mask, &fs_bio_set)... | [
0,
0
] |
Linux Kernel | block/blk-map.c |
int blk_rq_map_user(struct request_queue *q, struct request *rq,
struct rq_map_data *map_data, void __user *ubuf,
unsigned long len, gfp_t gfp_mask) {
struct iovec iov;
struct iov_iter i;
int ret = import_single_range(rq_data_dir(rq), ubuf, len, &iov, &i);
if (unlikely(... | [
0,
0
] |
Linux Kernel | block/blk-merge.c | struct bio *__bio_split_to_limits(struct bio *bio,
const struct queue_limits *lim,
unsigned int *nr_segs) {
struct bio_set *bs = &bio->bi_bdev->bd_disk->bio_split;
struct bio *split;
switch (bio_op(bio)) {
case REQ_OP_DISCARD:
case REQ_OP_SE... | [
0,
0
] |
Linux Kernel | block/blk-merge.c |
static inline int __blk_bvec_map_sg(struct bio_vec bv,
struct scatterlist *sglist,
struct scatterlist **sg) {
*sg = blk_next_sg(sg, sglist);
sg_set_page(*sg, bv.bv_page, bv.bv_len, bv.bv_offset);
return 1;
} | [
0,
0
] |
Linux Kernel | block/blk-merge.c |
static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
sector_t offset) {
struct request_queue *q = rq->q;
unsigned int max_sectors;
if (blk_rq_is_passthrough(rq))
return q->limits.max_hw_sectors;
max_sectors = blk_queue_get_max_sectors(q, ... | [
0,
0
] |
Linux Kernel | block/blk-merge.c | static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
struct request *next) {
int total_phys_segments;
if (req_gap_back_merge(req, next->bio))
return 0;
if ((blk_rq_sectors(req) + blk_rq_sectors(next)) >
blk_rq_get_max_sectors(req, blk_rq_pos(req... | [
0,
0
] |
Linux Kernel | block/blk-merge.c | void blk_rq_set_mixed_merge(struct request *rq) {
blk_opf_t ff = rq->cmd_flags & REQ_FAILFAST_MASK;
struct bio *bio;
if (rq->rq_flags & RQF_MIXED_MERGE)
return;
for (bio = rq->bio; bio; bio = bio->bi_next) {
WARN_ON_ONCE((bio->bi_opf & REQ_FAILFAST_MASK) &&
(bio->bi_opf & REQ_FAILFAST... | [
1,
0
] |
Linux Kernel | block/blk-merge.c |
static enum elv_merge blk_try_req_merge(struct request *req,
struct request *next) {
if (blk_discard_mergable(req))
return ELEVATOR_DISCARD_MERGE;
else if (blk_rq_pos(req) + blk_rq_sectors(req) == blk_rq_pos(next))
return ELEVATOR_BACK_MERGE;
return ELEVATOR_NO_ME... | [
0,
0
] |
Linux Kernel | block/blk-merge.c |
static struct request *attempt_front_merge(struct request_queue *q,
struct request *rq) {
struct request *prev = elv_former_request(q, rq);
if (prev)
return attempt_merge(q, prev, rq);
return NULL;
} | [
0,
0
] |
Linux Kernel | block/blk-merge.c | bool blk_attempt_req_merge(struct request_queue *q, struct request *rq,
struct request *next) {
return attempt_merge(q, rq, next);
} | [
0,
0
] |
Linux Kernel | block/blk-merge.c |
enum elv_merge blk_try_merge(struct request *rq, struct bio *bio) {
if (blk_discard_mergable(rq))
return ELEVATOR_DISCARD_MERGE;
else if (blk_rq_pos(rq) + blk_rq_sectors(rq) == bio->bi_iter.bi_sector)
return ELEVATOR_BACK_MERGE;
else if (blk_rq_pos(rq) - bio_sectors(bio) == bio->bi_iter.bi_sector)
re... | [
0,
0
] |
Linux Kernel | block/blk-merge.c |
static void blk_account_io_merge_bio(struct request *req) {
if (!blk_do_io_stat(req))
return;
part_stat_lock();
part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
part_stat_unlock();
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.