GNU bug report logs - #6131
[PATCH]: fiemap support for efficient sparse file copy

Previous Next

Package: coreutils;

Reported by: "jeff.liu" <jeff.liu <at> oracle.com>

Date: Fri, 7 May 2010 14:16:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "jeff.liu" <jeff.liu <at> oracle.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: Sunil Mushran <sunil.mushran <at> oracle.com>, Paul Eggert <eggert <at> CS.UCLA.EDU>, bug-coreutils <at> gnu.org, Joel Becker <Joel.Becker <at> oracle.com>, Tao Ma <tao.ma <at> oracle.com>, Pádraig Brady <P <at> draigBrady.com>, Chris Mason <chris.mason <at> oracle.com>
Subject: bug#6131: [PATCH]: fiemap support for efficient sparse file copy
Date: Wed, 29 Sep 2010 15:35:17 +0800
Jim Meyering wrote:
> jeff.liu wrote:
>> jeff.liu wrote:
>>> Hi Jim,
>>>
>>> Thanks for your prompt response, I will fix this issue when all review done.
>> Hi Jim,
>>
>> For my current implementation, I just have another thought to remove the "char *fname" from struct
>> extent_scan, and add a new item "int errno" to save the errno set by ioctl(2) or lseek(2) if either
>> call failed.
>> at first, I am intended to use "char *fname" for the debugging purpose inside, however, maybe its
>> better to do such things outside of the module according to the return value and errno. this change
>> can not only reduce the memory allocation for 'fname' but also make a neatly open_extent_scan()
>> interface.
>>
>> /* Structure used to reserve extent scan information per file.  */
>> struct extent_scan
>> {
>>  ....
>>   int errno;
>>   ....
>> };
>>
>> void
>> open_extent_scan (int src_fd, struct extent_scan **scan);
>>
>>
>> Is it better?
> 
> That would be better.
> Since there is only one diagnostic using that file name
> you can do the same from the caller.
> 
> In fact, why store errno in that struct at all?
> Can't you just ensure that errno is set to the proper value when it fails?
Indeed, there is no need to store 'errno'.

Thanks,
-Jeff
> 
> 
> 





This bug report was last modified 14 years and 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.