const struct file_operations generic_ro_fops = {
.llseek = generic_file_llseek,
.read = do_sync_read,
.aio_read = generic_file_aio_read,
.mmap = generic_file_readonly_mmap,
.splice_read = generic_file_splice_read,
};
What do those “. ” mean in this code?
This is from linux kernel fs/read_write.c
They’re called “designated initializers”. It’s a feature introduced in C99 and provided as an extension by GNU C (of course you know, the Linux kernel isn’t written in C but in GNU C).
This is really syntactic sugar and provides a convenient way to initialize the members of that struct without worrying about their order.