Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Issue 3698005: bsdiff: if file is /dev/fd/*, don't open/close it. Just use the fd. (Closed)

Created:
10 years, 2 months ago by adlr
Modified:
9 years ago
Reviewers:
petkov
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, tedbo, adlr, anush
Base URL:
ssh://git@chromiumos-git/chromiumos-overlay.git
Visibility:
Public.

Description

bsdiff: if file is /dev/fd/*, don't open/close it. Just use the fd. The updater, in an attempt to keep bspatch from open/closing the raw block device frequently, passes a file descriptor and a path of /dev/fd/(some number) as the path. This patch causes bspatch to recognize that magic file path and not call open/close. This dramatically reduces resource usage on client machines performing delta updates. BUG=7636 TEST=Installed delta on device Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=a13e3cb

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -12 lines) Patch
M dev-util/bsdiff/files/4.3_bspatch-support-input-output-positioning.patch View 11 chunks +32 lines, -12 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
adlr
10 years, 2 months ago (2010-10-12 21:39:39 UTC) #1
petkov
LGTM http://codereview.chromium.org/3698005/diff/1/2 File dev-util/bsdiff/files/4.3_bspatch-support-input-output-positioning.patch (right): http://codereview.chromium.org/3698005/diff/1/2#newcode189 dev-util/bsdiff/files/4.3_bspatch-support-input-output-positioning.patch:189: + sscanf(filename + strlen(kFdFilePrefix), "%d", &fd); given that ...
10 years, 2 months ago (2010-10-12 21:53:23 UTC) #2
adlr
On Tue, Oct 12, 2010 at 2:53 PM, <petkov@chromium.org> wrote: > LGTM > > > ...
10 years, 2 months ago (2010-10-12 23:07:45 UTC) #3
petkov
10 years, 2 months ago (2010-10-12 23:10:37 UTC) #4
On 2010/10/12 23:07:45, adlr wrote:
> On Tue, Oct 12, 2010 at 2:53 PM, <mailto:petkov@chromium.org> wrote:
> 
> > LGTM
> >
> >
> >
> > http://codereview.chromium.org/3698005/diff/1/2
> > File
> >
> > dev-util/bsdiff/files/4.3_bspatch-support-input-output-positioning.patch
> > (right):
> >
> > http://codereview.chromium.org/3698005/diff/1/2#newcode189
> >
> >
dev-util/bsdiff/files/4.3_bspatch-support-input-output-positioning.patch:189:
> > +               sscanf(filename + strlen(kFdFilePrefix), "%d", &fd);
> > given that you're not detecting errors, why not use atoi?
> 
> 
> I'm working on the assumption that if there's a failure, fd will remain -1,
> but w/ atoi() I'm not sure what the error return would be.

A true... still LGTM.

Thanks,

Darin

> 
> -andrew
> 
> 
> >
> >
> > http://codereview.chromium.org/3698005/show
> >
>

Powered by Google App Engine
This is Rietveld 408576698