linux/block/blk-integrity.c

// SPDX-License-Identifier: GPL-2.0
/*
 * blk-integrity.c - Block layer data integrity extensions
 *
 * Copyright (C) 2007, 2008 Oracle Corporation
 * Written by: Martin K. Petersen <[email protected]>
 */

#include <linux/blk-integrity.h>
#include <linux/backing-dev.h>
#include <linux/mempool.h>
#include <linux/bio.h>
#include <linux/scatterlist.h>
#include <linux/export.h>
#include <linux/slab.h>

#include "blk.h"

/**
 * blk_rq_count_integrity_sg - Count number of integrity scatterlist elements
 * @q:		request queue
 * @bio:	bio with integrity metadata attached
 *
 * Description: Returns the number of elements required in a
 * scatterlist corresponding to the integrity metadata in a bio.
 */
int blk_rq_count_integrity_sg(struct request_queue *q, struct bio *bio)
{}

/**
 * blk_rq_map_integrity_sg - Map integrity metadata into a scatterlist
 * @rq:		request to map
 * @sglist:	target scatterlist
 *
 * Description: Map the integrity vectors in request into a
 * scatterlist.  The scatterlist must be big enough to hold all
 * elements.  I.e. sized using blk_rq_count_integrity_sg() or
 * rq->nr_integrity_segments.
 */
int blk_rq_map_integrity_sg(struct request *rq, struct scatterlist *sglist)
{}
EXPORT_SYMBOL();

int blk_rq_integrity_map_user(struct request *rq, void __user *ubuf,
			      ssize_t bytes, u32 seed)
{}
EXPORT_SYMBOL_GPL();

bool blk_integrity_merge_rq(struct request_queue *q, struct request *req,
			    struct request *next)
{}

bool blk_integrity_merge_bio(struct request_queue *q, struct request *req,
			     struct bio *bio)
{}

static inline struct blk_integrity *dev_to_bi(struct device *dev)
{}

const char *blk_integrity_profile_name(struct blk_integrity *bi)
{}
EXPORT_SYMBOL_GPL();

static ssize_t flag_store(struct device *dev, const char *page, size_t count,
		unsigned char flag)
{}

static ssize_t flag_show(struct device *dev, char *page, unsigned char flag)
{}

static ssize_t format_show(struct device *dev, struct device_attribute *attr,
			   char *page)
{}

static ssize_t tag_size_show(struct device *dev, struct device_attribute *attr,
			     char *page)
{}

static ssize_t protection_interval_bytes_show(struct device *dev,
					      struct device_attribute *attr,
					      char *page)
{}

static ssize_t read_verify_store(struct device *dev,
				 struct device_attribute *attr,
				 const char *page, size_t count)
{}

static ssize_t read_verify_show(struct device *dev,
				struct device_attribute *attr, char *page)
{}

static ssize_t write_generate_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *page, size_t count)
{}

static ssize_t write_generate_show(struct device *dev,
				   struct device_attribute *attr, char *page)
{}

static ssize_t device_is_integrity_capable_show(struct device *dev,
						struct device_attribute *attr,
						char *page)
{}

static DEVICE_ATTR_RO(format);
static DEVICE_ATTR_RO(tag_size);
static DEVICE_ATTR_RO(protection_interval_bytes);
static DEVICE_ATTR_RW(read_verify);
static DEVICE_ATTR_RW(write_generate);
static DEVICE_ATTR_RO(device_is_integrity_capable);

static struct attribute *integrity_attrs[] =;

const struct attribute_group blk_integrity_attr_group =;