Re: [PATCH] git-count-objects: Fix a disk-space under-estimate on Cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx> writes:

> I haven't tried this patch, but I think you may need to add something like
> the following (*not tested*):
>
> --- >8 ---
> diff --git a/compat/cygwin.c b/compat/cygwin.c
> index b4a51b9..7e9edec 100644
> --- a/compat/cygwin.c
> +++ b/compat/cygwin.c
> @@ -53,6 +53,7 @@ static int do_stat(const char *file_name, struct stat *buf, stat_fn_t cygstat)
>  		buf->st_size = (off_t)fdata.nFileSizeLow;
>  #endif
>  		buf->st_blocks = size_to_blocks(buf->st_size);
> +		buf->st_blksize = 512;
>  		filetime_to_timespec(&fdata.ftLastAccessTime, &buf->st_atim);
>  		filetime_to_timespec(&fdata.ftLastWriteTime, &buf->st_mtim);
>  		filetime_to_timespec(&fdata.ftCreationTime, &buf->st_ctim);
> --- >8 ---

Doesn't this contradict with everything you said?

You are forcing st_blksize to 512 but still return the same old st_blocks;
I do not understand what that would achieve.

In your experiments, st_blocks was reported in 1024-byte blocks and that
size coincided with what was reported in st_blksize, and that was the
whole point of the approach taken by the ST_BLOCKS_COUNTS_IN_BLKSIZE
patch.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]