C code Filesystem

[c] Code Segment

const struct vm_operations_struct generic_file_vm_ops = {
.fault = filemap_fault,
+ .page_mkwrite = filemap_page_mkwrite,

Code Dissection

1.const --- A C language keyword.
Makes variable value or pointer parameter unmodifiable.
2.struct --- A C language keyword
Groups variables into a single record.
3.vm_operations_struct --- A structure name.
4.generic_file_vm_ops --- A structure variable.
5. .fault and .page_mkwrite --- designated names.

source :http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

Theory Drop

Structures  in C  are defined  as data  containers consisting  of a
sequence of  named members  of various types.  They are  similar to
records in other programming  languages. The members of a structure
are  stored  in  consecutive  locations  in  memory,  although  the
compiler is allowed to insert padding between or after members (but
not  before  the  first  member)  for efficiency.  The  size  of  a
structure is equal to the sum of the sizes of its members, plus the
size of the padding.

source : http://en.wikipedia.org/wiki/C_syntax#Structures_and_unions


The code segment contains  "struct" keyword.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s