On 29 July 2013 17:56, lx <lxlenovostar@xxxxxxxxx> wrote: > hi all: > why use the struct in this way by "." > > for example, .owner instead of owner , why? > Thank you. > > 1203 static struct file_system_type ext2_fs_type = { > 1204 .owner = THIS_MODULE, > 1205 .name = "ext2", > 1206 .get_sb = ext2_get_sb, > 1207 .kill_sb = kill_block_super, > 1208 .fs_flags = FS_REQUIRES_DEV, > 1209 }; > 1210 If you notice the definition of struct file_system_type [1], you will see that the structure has more fields than you are initiating. In this case, you just want to refer to some of the fields in the structure. You either give all fields a value (in order), or use the .field to just refer to a single field and set a value for it. [1] http://lxr.oss.org.cn/source/include/linux/fs.h?v=2.6.16#L1240 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies