Samba files_struct: "bool modified" and "bool update_write_time_on_close"

Rick Gates rick123.gates at gmail.com
Sun Jan 23 04:54:08 MST 2011


Hi All,

I have been going through the samba 3.5.3 code for quite some time now.
I have been examining the various elements in the structure "files_struct",
which samba uses.

I find the following two elements of particular interest here:

bool modified;
bool update_write_time_on_close;

I see that "modified" is set to true whenever something is written into the
file. (in the function: write_file() of fileio.c)
I further see that right after "modified" is set to true (in the function:
write_file() of fileio.c), "trigger_write_time_update()" is called where
"update_write_time_on_close" is set to true.

Isnt it that whenever a files is written into, i.e. "modified" is set to
true, its update time must b updated upon calling a close?
I mean, isnt that "update_write_time_on_close" will always have the have
value as "modified"?
(if yes, then why use two variables when 1 can do the work)

My intent is just to learn and understand the samba code ... it would be
great if any of you knowledgeable beings can respond to this question of
mine. :)

Thanks,


More information about the samba-technical mailing list