Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
blk-integrity.c File Reference
#include <linux/blkdev.h>
#include <linux/mempool.h>
#include <linux/bio.h>
#include <linux/scatterlist.h>
#include <linux/export.h>
#include <linux/slab.h>
#include "blk.h"

Go to the source code of this file.

Data Structures

struct  integrity_sysfs_entry
 

Functions

int blk_rq_count_integrity_sg (struct request_queue *q, struct bio *bio)
 
 EXPORT_SYMBOL (blk_rq_count_integrity_sg)
 
int blk_rq_map_integrity_sg (struct request_queue *q, struct bio *bio, struct scatterlist *sglist)
 
 EXPORT_SYMBOL (blk_rq_map_integrity_sg)
 
int blk_integrity_compare (struct gendisk *gd1, struct gendisk *gd2)
 
 EXPORT_SYMBOL (blk_integrity_compare)
 
int blk_integrity_merge_rq (struct request_queue *q, struct request *req, struct request *next)
 
 EXPORT_SYMBOL (blk_integrity_merge_rq)
 
int blk_integrity_merge_bio (struct request_queue *q, struct request *req, struct bio *bio)
 
 EXPORT_SYMBOL (blk_integrity_merge_bio)
 
 subsys_initcall (blk_dev_integrity_init)
 
bool blk_integrity_is_initialized (struct gendisk *disk)
 
 EXPORT_SYMBOL (blk_integrity_is_initialized)
 
int blk_integrity_register (struct gendisk *disk, struct blk_integrity *template)
 
 EXPORT_SYMBOL (blk_integrity_register)
 
void blk_integrity_unregister (struct gendisk *disk)
 
 EXPORT_SYMBOL (blk_integrity_unregister)
 

Function Documentation

int blk_integrity_compare ( struct gendisk *  gd1,
struct gendisk *  gd2 
)

blk_integrity_compare - Compare integrity profile of two disks : Disk to compare : Disk to compare

Description: Meta-devices like DM and MD need to verify that all sub-devices use the same integrity format before advertising to upper layers that they can send/receive integrity metadata. This function can be used to check whether two gendisk devices have compatible integrity formats.

Definition at line 142 of file blk-integrity.c.

bool blk_integrity_is_initialized ( struct gendisk *  disk)

Definition at line 364 of file blk-integrity.c.

int blk_integrity_merge_bio ( struct request_queue q,
struct request req,
struct bio *  bio 
)

Definition at line 199 of file blk-integrity.c.

int blk_integrity_merge_rq ( struct request_queue q,
struct request req,
struct request next 
)

Definition at line 185 of file blk-integrity.c.

int blk_integrity_register ( struct gendisk *  disk,
struct blk_integrity *  template 
)

blk_integrity_register - Register a gendisk as being integrity-capable : struct gendisk pointer to make integrity-aware : optional integrity profile to register

Description: When a device needs to advertise itself as being able to send/receive integrity metadata it must use this function to register the capability with the block layer. The template is a blk_integrity struct with values appropriate for the underlying hardware. If template is NULL the new profile is allocated but not filled out. See Documentation/block/data-integrity.txt.

Definition at line 384 of file blk-integrity.c.

void blk_integrity_unregister ( struct gendisk *  disk)

blk_integrity_unregister - Remove block integrity profile : disk whose integrity profile to deallocate

Description: This function frees all memory used by the block integrity profile. To be called at device teardown.

Definition at line 434 of file blk-integrity.c.

int blk_rq_count_integrity_sg ( struct request_queue q,
struct bio *  bio 
)

blk_rq_count_integrity_sg - Count number of integrity scatterlist elements : request queue : bio with integrity metadata attached

Description: Returns the number of elements required in a scatterlist corresponding to the integrity metadata in a bio.

Definition at line 44 of file blk-integrity.c.

int blk_rq_map_integrity_sg ( struct request_queue q,
struct bio *  bio,
struct scatterlist sglist 
)

blk_rq_map_integrity_sg - Map integrity metadata into a scatterlist : request queue : bio with integrity metadata attached : 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().

Definition at line 87 of file blk-integrity.c.

EXPORT_SYMBOL ( blk_rq_count_integrity_sg  )
EXPORT_SYMBOL ( blk_rq_map_integrity_sg  )
EXPORT_SYMBOL ( blk_integrity_compare  )
EXPORT_SYMBOL ( blk_integrity_merge_rq  )
EXPORT_SYMBOL ( blk_integrity_merge_bio  )
EXPORT_SYMBOL ( blk_integrity_is_initialized  )
EXPORT_SYMBOL ( blk_integrity_register  )
EXPORT_SYMBOL ( blk_integrity_unregister  )
subsys_initcall ( blk_dev_integrity_init  )