Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ext3 code understanding

struct inode_operations ext3_dir_inode_operations = {
        .create         = ext3_create,
        .lookup         = ext3_lookup,
}

This struct is assign to inode structure and further to file system operation structure. My question is what is this flag .create? Do we do the assignment in the structure itself? Or is it some other version of C (C99, C89?) that allows this kind of operation?

I hope my question is clear.

like image 715
Arpit Avatar asked Feb 05 '26 18:02

Arpit


1 Answers

It's a C99 designated initialiser. It's equivalent to, in C89:

struct inode_operations ext3_dir_inode_operations = { 0 };
ext3_dir_inode_operations.create = ext3_create;
ext3_dir_inode_operations.lookup = ext3_lookup;
like image 102
caf Avatar answered Feb 07 '26 08:02

caf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!