git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>,
	Linus Torvalds <torvalds@linuxfoundation.org>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] Make pack creation always fsync() the result
Date: Fri, 30 May 2008 16:27:01 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0805301620040.23581@xanadu.home> (raw)
In-Reply-To: <alpine.LFD.1.10.0805300905080.3141@woody.linux-foundation.org>

On Fri, 30 May 2008, Linus Torvalds wrote:

> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index 70d2f5d..4c2e0cd 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -515,10 +515,12 @@ static void write_pack_file(void)
>  		 * If so, rewrite it like in fast-import
>  		 */
>  		if (pack_to_stdout || nr_written == nr_remaining) {
> -			sha1close(f, sha1, 1);
> +			unsigned flags = pack_to_stdout ? CSUM_CLOSE : CSUM_FSYNC;
> +			sha1close(f, sha1, flags);
>  		} else {

Micro nit:  wouldn't it look more obvious if it was written as:

	if (pack_to_stdout) {
		sha1close(f, sha1, CSUM_CLOSE);
	} else if (nr_written == nr_remaining) {
		sha1close(f, sha1, CSUM_FSYNC);
	} else {
		...

Otherwise looks sane to me.


Nicolas

  parent reply	other threads:[~2008-05-30 20:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 20:57 reducing prune sync()s Frank Ch. Eigler
2008-05-30  0:27 ` Linus Torvalds
2008-05-30  0:32   ` Linus Torvalds
2008-05-30  1:50     ` Frank Ch. Eigler
2008-05-30 20:07     ` Florian Weimer
2008-05-30  1:51   ` David Dillow
2008-05-30  2:17     ` Linus Torvalds
2008-05-30  2:30       ` Linus Torvalds
2008-05-30 15:25   ` Frank Ch. Eigler
2008-05-30 15:57     ` Linus Torvalds
2008-05-30 16:08       ` [PATCH 1/2] Make pack creation always fsync() the result Linus Torvalds
2008-05-30 16:11         ` [PATCH 2/2] Remove now unnecessary 'sync()' calls Linus Torvalds
2008-05-30 20:27         ` Nicolas Pitre [this message]
2008-05-31 14:19         ` [PATCH 1/2] Make pack creation always fsync() the result Frank Ch. Eigler
2008-06-02 22:23           ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0805301620040.23581@xanadu.home \
    --to=nico@cam.org \
    --cc=fche@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.org \
    --cc=torvalds@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).