Skip to content

Support for file readahead under linux using readahead #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

frankeh
Copy link
Contributor

@frankeh frankeh commented Jan 28, 2016

Reusing the base structure of the function to maintain the offset logic
and replace fcntl( F_RDAVICE ) with readahead under linux.

#ifdef __linux__
_dispatch_io_syscall_switch(err,
readahead(op->fd_entry->fd, advise.ra_offset, advise.ra_count),
case EBADF: break; // bad file desciptor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring EBADF is wrong it should be caught by the dispatch_assume_zero() below to log as this is a programming error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case EBADF and EINVAL both should be ignored, since EINVAL
recognizes filedescriptor on which this operation can not be applied ( e.g. socket ).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean both should NOT be ignored and caught by dispatch_assume_zero()

@MadCoder
Copy link
Contributor

Two nits, please directly squash the fixes and force-push your pull request, there's no need to create a new one.

@frankeh frankeh reopened this Jan 28, 2016
MadCoder added a commit that referenced this pull request Jan 28, 2016
Support for file readahead under linux using readahead
@MadCoder MadCoder merged commit dfa43cd into swiftlang:master Jan 28, 2016
das pushed a commit that referenced this pull request Jun 14, 2016
Support for file readahead under linux using readahead

Signed-off-by: Daniel A. Steffen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants