block: move block from drivers to kernel
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
7c8b46eeda
commit
474468ef04
2 changed files with 1 additions and 2 deletions
24
include/kernel/block.h
Normal file
24
include/kernel/block.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _BLOCK_H_
|
||||
#define _BLOCK_H_
|
||||
|
||||
#include <kernel/device.h>
|
||||
|
||||
struct block_device;
|
||||
struct block_ops {
|
||||
ssize_t (*read)(struct block_device *dev, char *buf, size_t offset, size_t n);
|
||||
ssize_t (*write)(struct block_device *dev, char *buf, size_t offset, size_t n);
|
||||
};
|
||||
|
||||
struct block_device {
|
||||
char *name;
|
||||
dev_t dev;
|
||||
size_t size;
|
||||
size_t block_size;
|
||||
struct block_ops ops;
|
||||
};
|
||||
|
||||
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n);
|
||||
ssize_t block_write(struct block_device *dev, char *buf, size_t offset, size_t n);
|
||||
|
||||
#endif /* _BLOCK_H_ */
|
||||
Loading…
Reference in a new issue