In an Intel white paper, it says:
MD RAID in linux is a block driver that filters data between the Linux File System driver, such as ext2 file system, and the low level hard disk drivers, such as the AHCI driver and SAS driver.
In kernel code drivers/md/md.c
, I only find this file_operations
:
static const struct file_operations md_seq_fops = {
.owner = THIS_MODULE,
.open = md_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
.poll = mdstat_poll,
};
md_fops has neither read nor write:
static const struct block_device_operations md_fops =
{
.owner = THIS_MODULE,
.open = md_open,
.release = md_release,
.ioctl = md_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = md_compat_ioctl,
#endif
.getgeo = md_getgeo,
.media_changed = md_media_changed,
.revalidate_disk= md_revalidate,
};
Is this the file_operations that MD driver performs open, read...? How does MD driver writes data? Use AHCI driver?
When a write syscall is called, what is the steps to write data?
sys_write -> vfs_write -> file->f_op->write or do_sync_write? The md_seq_fops has neither write nor aio_write