Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 39996 Details for
Bug 64724
implement readahead(2) into userspace to speedup boot process
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
readahead.c, extracted from kernel-utils-2.4-9.1.131.src.rpm
readahead.c (text/plain), 667 bytes, created by
Elan Ruusamäe
on 2004-09-20 00:59:58 UTC
(
hide
)
Description:
readahead.c, extracted from kernel-utils-2.4-9.1.131.src.rpm
Filename:
MIME Type:
Creator:
Elan Ruusamäe
Created:
2004-09-20 00:59:58 UTC
Size:
667 bytes
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <unistd.h> >#include <sys/syscall.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <sched.h> > >void process_file(char *filename) >{ > int fd; > struct stat buf; > > if (!filename) > return; > > fd = open(filename,O_RDONLY); > if (fd<0) > return; > > if (fstat(fd, &buf)<0) > return; > > /* don't readahead on nfs */ > if (!gnu_dev_major(buf.st_dev)) > return; > > readahead(fd, (loff_t)0, (size_t)buf.st_size); > close(fd); > /* be nice to other processes now */ > sched_yield(); >} > > >int main(int argc, char **argv) >{ > int i; > for (i=1; i<argc; i++) > process_file(argv[i]); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 64724
:
39996
|
39997
|
39998
|
39999
|
40000
|
40108
|
40109
|
40110
|
40111
|
40112
|
54466
|
54467