Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 920897 Details for
Bug 850426
gfs2: Add xgetdents syscall to the kernel
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Program to test the readahead system call
ra_test.c (text/x-csrc), 1.75 KB, created by
Abhijith Das
on 2014-07-25 08:07:02 UTC
(
hide
)
Description:
Program to test the readahead system call
Filename:
MIME Type:
Creator:
Abhijith Das
Created:
2014-07-25 08:07:02 UTC
Size:
1.75 KB
patch
obsolete
>#define _GNU_SOURCE >#define _ATFILE_SOURCE > >#include <fcntl.h> >#include <stdio.h> >#include <stdlib.h> >#include <unistd.h> >#include <sys/syscall.h> >#include <sys/types.h> >#include <errno.h> >#include <string.h> > >#define __NR_dir_readahead 317 > >static __attribute__((unused)) >int dir_readahead(unsigned int fd, long long *offset, unsigned int count) >{ > return syscall(__NR_dir_readahead, fd, offset, count); >} > >long long offset = 0; >unsigned int count = 100000; >const char *dirname; > >void print_usage(const char *prog) >{ > fprintf(stderr, " Usage: %s [OPTION] <dir>\n\n", prog); > fprintf(stderr, " -o OFFSET Offset to start dir scan from (default 0)\n"); > fprintf(stderr, " -c COUNT Number of entries to readahead (default 1000000)\n"); >} > > >void parse_opts(int argc, char **argv) >{ > int opt; > while ((opt = getopt(argc, argv, "o:c:q")) != -1) { > switch (opt) { > case 'o': > offset = strtoull(optarg, NULL, 0); > break; > case 'c': > count = atoi(optarg); > break; > default: > fprintf(stderr, "Invalid argument\n"); > print_usage(argv[0]); > exit(EXIT_FAILURE); > } > } > if (optind >= argc) { > fprintf(stderr, "Expected <dir> argument\n"); > print_usage(argv[0]); > exit(EXIT_FAILURE); > } > > dirname = argv[optind]; >} > >int main(int argc, char **argv) >{ > int fd, err = 0; > > parse_opts(argc, argv); > > fd = open(dirname, O_RDONLY | O_DIRECTORY); > if (fd < 0) { > fprintf(stderr, "open %s failed: %s\n", dirname, strerror(errno)); > err = -1; > goto out; > } > > do { > err = dir_readahead(fd, &offset, count); > if (err < 0) { > if (errno == EBUSY) { > fprintf(stderr, "busy. sleeping 1s\n"); > sleep(1); > continue; > } > break; > } > } while (err); > > if (err < 0) > fprintf(stderr, "rddir_readahead failed: %d-%s\n", errno, strerror(errno)); > close(fd); > >out: > return err; >}
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 850426
:
605960
|
617073
|
625592
|
678841
|
680222
|
680282
|
708389
|
731269
|
731270
|
731272
|
731273
|
731274
|
731278
|
731279
|
732739
|
732740
|
732845
|
834840
|
853502
|
909528
|
909529
|
909534
|
912745
|
917238
|
917239
|
920895
|
920896
| 920897 |
920898
|
920899
|
920902
|
920903
|
947987