Skip to contentSkip to conversation

generic I/O

DISCUSSION Kai Meyer 1 participant 1 message Oct 31, 2011

lore
Share & tools
lore

Kai Meyer

author
#0 lore raw

Are there existing generic block device I/O operations available already? I am familiar with constructing and submitting 'struct bio's, but what I'd like to do would be greatly simplified if there was an existing I/O interface similar to the posix 'read' and 'write' functions. If they don't exist, I would probably end up writing functions like:
int blk_read(struct block_device *bdev, void *buffer, off_t length); int blk_write(struct block_device *bdev, void *buffer, off_t length);

Pros and cons to this sort of approach?

-Kai Meyer