Bug 144989 - [SOUP] Use st_birthtime on FreeBSD and NetBSD instead of setting xattr
Summary: [SOUP] Use st_birthtime on FreeBSD and NetBSD instead of setting xattr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-13 23:15 PDT by Ting-Wei Lan
Modified: 2015-05-19 09:37 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.44 KB, patch)
2015-05-13 23:19 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff
Patch (4.52 KB, patch)
2015-05-16 11:48 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff
Patch (4.45 KB, patch)
2015-05-19 07:03 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2015-05-13 23:15:53 PDT
FreeBSD and NetBSD have st_birthtime in struct stat, so we can easily get creation time of files without manually setting xattr. There is existing code for PLATFORM(COCOA), and we can just reuse it.

FreeBSD xattr API is incompatible with Linux xattr API, so GLib doesn't support it. st_birthtime works on both UFS2 and tmpfs.
NetBSD xattr has a compatible interface with Linux xattr, but it is only supported on old filesystem such as UFS1. st_birthtime works on both UFS2 and tmpfs.
Comment 1 Ting-Wei Lan 2015-05-13 23:19:46 PDT
Created attachment 253099 [details]
Patch
Comment 2 Carlos Garcia Campos 2015-05-14 00:35:49 PDT
Comment on attachment 253099 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253099&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:80
> -#if PLATFORM(COCOA)
> +#if PLATFORM(COCOA) || (USE(SOUP) && (OS(DARWIN) || OS(FREEBSD) || OS(NETBSD)))

Maybe we could simplify this by defining a macro for this in WTF/wtf/Platform.h, something like HAVE_STAT_BIRTHTIME or something similar.
Comment 3 Ting-Wei Lan 2015-05-16 11:48:11 PDT
Created attachment 253272 [details]
Patch
Comment 4 Carlos Garcia Campos 2015-05-17 23:24:02 PDT
Comment on attachment 253272 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253272&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:80
> -#if PLATFORM(COCOA)
> +#if PLATFORM(COCOA) || (USE(SOUP) && HAVE(STAT_BIRTHTIME))

I think we could use just #if HAVE(STAT_BIRTHTIME)
Comment 5 Darin Adler 2015-05-18 08:39:27 PDT
Comment on attachment 253272 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253272&action=review

>> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:80
>> +#if PLATFORM(COCOA) || (USE(SOUP) && HAVE(STAT_BIRTHTIME))
> 
> I think we could use just #if HAVE(STAT_BIRTHTIME)

Yes, that’s right.
Comment 6 Ting-Wei Lan 2015-05-19 07:03:41 PDT
Created attachment 253384 [details]
Patch
Comment 7 Carlos Garcia Campos 2015-05-19 08:12:21 PDT
Comment on attachment 253384 [details]
Patch

Thanks!
Comment 8 WebKit Commit Bot 2015-05-19 09:37:19 PDT
Comment on attachment 253384 [details]
Patch

Clearing flags on attachment: 253384

Committed r184567: <http://trac.webkit.org/changeset/184567>
Comment 9 WebKit Commit Bot 2015-05-19 09:37:26 PDT
All reviewed patches have been landed.  Closing bug.