+ /* On close if we're changing the real file time we
+ * must update it in the open file db too. */
+ (void)set_write_time(fsp->file_id, fsp->close_write_time);
+
+ lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL, NULL);
+ if (lck) {
+ /* Close write times overwrite sticky write times
+ so we must replace any sticky write time here. */
+ if (!null_timespec(lck->changed_write_time)) {
+ (void)set_sticky_write_time(fsp->file_id, fsp->close_write_time);
+ }
+ TALLOC_FREE(lck);
+ }
+