{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/41898754","id":41898754,"diff_hunk":"@@ -25,3 +26,21 @@ func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool {\n func (info *FileInfo) isDir() bool {\n \treturn info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0\n }\n+\n+// GetInode returns inode number from os.FileInfo object\n+func GetInode(fi os.FileInfo) (inode uint64) {\n+\ts, _ := fi.Sys().(*syscall.Stat_t)\n+\tinode = uint64(s.Ino)\n+\treturn\n+}\n+\n+// IsHardlink detects if os.FileInfo object is hardlink or not\n+func IsHardlink(fi os.FileInfo) bool {\n+\tswitch sys := fi.Sys().(type) {\n+\tcase *syscall.Stat_t:\n+\t\tif fi.Mode().IsRegular() && sys.Nlink > 1 {","path":"pkg/archive/changes_unix.go","position":24,"original_position":24,"commit_id":"41f791024d9e8022b0ef06d95d447cac08c0beb0","original_commit_id":"41f791024d9e8022b0ef06d95d447cac08c0beb0","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"body":"I wonder what's point of `fi.Mode().IsRegular()` check?","created_at":"2015-10-13T17:38:09Z","updated_at":"2015-10-13T17:38:09Z","html_url":"https://github.com/docker/docker/pull/16960#discussion_r41898754","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/16960","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/41898754"},"html":{"href":"https://github.com/docker/docker/pull/16960#discussion_r41898754"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/16960"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/16960","id":47461402,"html_url":"https://github.com/docker/docker/pull/16960","diff_url":"https://github.com/docker/docker/pull/16960.diff","patch_url":"https://github.com/docker/docker/pull/16960.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/16960","number":16960,"state":"open","locked":false,"title":"Consider hardlinks in image size.","user":{"login":"pydima","id":5312367,"avatar_url":"https://avatars.githubusercontent.com/u/5312367?v=3","gravatar_id":"","url":"https://api.github.com/users/pydima","html_url":"https://github.com/pydima","followers_url":"https://api.github.com/users/pydima/followers","following_url":"https://api.github.com/users/pydima/following{/other_user}","gists_url":"https://api.github.com/users/pydima/gists{/gist_id}","starred_url":"https://api.github.com/users/pydima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydima/subscriptions","organizations_url":"https://api.github.com/users/pydima/orgs","repos_url":"https://api.github.com/users/pydima/repos","events_url":"https://api.github.com/users/pydima/events{/privacy}","received_events_url":"https://api.github.com/users/pydima/received_events","type":"User","site_admin":false},"body":"Fixes #9283. Based on #8984. This patch fixes behavior when image size calculation\r\ndidn't consider hardlinks.\r\n\r\nSigned-off-by: Dmitry Vorobev <dimahabr@gmail.com>","created_at":"2015-10-12T20:33:32Z","updated_at":"2015-10-13T17:38:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"856d973353c7dbc053f1ed69a909f9e132f1299a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/16960/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/16960/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/16960/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/41f791024d9e8022b0ef06d95d447cac08c0beb0","head":{"label":"pydima:9283_consider_hard_links_in_image_size","ref":"9283_consider_hard_links_in_image_size","sha":"41f791024d9e8022b0ef06d95d447cac08c0beb0","user":{"login":"pydima","id":5312367,"avatar_url":"https://avatars.githubusercontent.com/u/5312367?v=3","gravatar_id":"","url":"https://api.github.com/users/pydima","html_url":"https://github.com/pydima","followers_url":"https://api.github.com/users/pydima/followers","following_url":"https://api.github.com/users/pydima/following{/other_user}","gists_url":"https://api.github.com/users/pydima/gists{/gist_id}","starred_url":"https://api.github.com/users/pydima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydima/subscriptions","organizations_url":"https://api.github.com/users/pydima/orgs","repos_url":"https://api.github.com/users/pydima/repos","events_url":"https://api.github.com/users/pydima/events{/privacy}","received_events_url":"https://api.github.com/users/pydima/received_events","type":"User","site_admin":false},"repo":{"id":44127910,"name":"docker","full_name":"pydima/docker","owner":{"login":"pydima","id":5312367,"avatar_url":"https://avatars.githubusercontent.com/u/5312367?v=3","gravatar_id":"","url":"https://api.github.com/users/pydima","html_url":"https://github.com/pydima","followers_url":"https://api.github.com/users/pydima/followers","following_url":"https://api.github.com/users/pydima/following{/other_user}","gists_url":"https://api.github.com/users/pydima/gists{/gist_id}","starred_url":"https://api.github.com/users/pydima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydima/subscriptions","organizations_url":"https://api.github.com/users/pydima/orgs","repos_url":"https://api.github.com/users/pydima/repos","events_url":"https://api.github.com/users/pydima/events{/privacy}","received_events_url":"https://api.github.com/users/pydima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pydima/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/pydima/docker","forks_url":"https://api.github.com/repos/pydima/docker/forks","keys_url":"https://api.github.com/repos/pydima/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydima/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydima/docker/teams","hooks_url":"https://api.github.com/repos/pydima/docker/hooks","issue_events_url":"https://api.github.com/repos/pydima/docker/issues/events{/number}","events_url":"https://api.github.com/repos/pydima/docker/events","assignees_url":"https://api.github.com/repos/pydima/docker/assignees{/user}","branches_url":"https://api.github.com/repos/pydima/docker/branches{/branch}","tags_url":"https://api.github.com/repos/pydima/docker/tags","blobs_url":"https://api.github.com/repos/pydima/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydima/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydima/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydima/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydima/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/pydima/docker/languages","stargazers_url":"https://api.github.com/repos/pydima/docker/stargazers","contributors_url":"https://api.github.com/repos/pydima/docker/contributors","subscribers_url":"https://api.github.com/repos/pydima/docker/subscribers","subscription_url":"https://api.github.com/repos/pydima/docker/subscription","commits_url":"https://api.github.com/repos/pydima/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydima/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydima/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydima/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydima/docker/contents/{+path}","compare_url":"https://api.github.com/repos/pydima/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydima/docker/merges","archive_url":"https://api.github.com/repos/pydima/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydima/docker/downloads","issues_url":"https://api.github.com/repos/pydima/docker/issues{/number}","pulls_url":"https://api.github.com/repos/pydima/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/pydima/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/pydima/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydima/docker/labels{/name}","releases_url":"https://api.github.com/repos/pydima/docker/releases{/id}","created_at":"2015-10-12T19:01:11Z","updated_at":"2015-10-12T19:01:24Z","pushed_at":"2015-10-12T21:12:15Z","git_url":"git://github.com/pydima/docker.git","ssh_url":"git@github.com:pydima/docker.git","clone_url":"https://github.com/pydima/docker.git","svn_url":"https://github.com/pydima/docker","homepage":"http://www.docker.com","size":70629,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"96965e2abdca3e0f0b02c8a44f842ccdea1bfb24","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-10-13T17:19:03Z","pushed_at":"2015-10-13T17:27:25Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":269559,"stargazers_count":25391,"watchers_count":25391,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6675,"mirror_url":null,"open_issues_count":1127,"forks":6675,"open_issues":1127,"watchers":25391,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/16960"},"html":{"href":"https://github.com/docker/docker/pull/16960"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/16960"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/16960/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/16960/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/16960/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/41f791024d9e8022b0ef06d95d447cac08c0beb0"}}}}