s3: Factor out "mark_file_modified"