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 237381 Details for
Bug 349601
GFS2 requires straightforward way to determine number of journals
[?]
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.
[patch]
Patch to implement gfs2_tool journals
349601.patch (text/plain), 3.46 KB, created by
Robert Peterson
on 2007-10-25 14:49:56 UTC
(
hide
)
Description:
Patch to implement gfs2_tool journals
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2007-10-25 14:49:56 UTC
Size:
3.46 KB
patch
obsolete
>Index: gfs2_tool.h >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/gfs2_tool.h,v >retrieving revision 1.7 >diff -w -u -p -p -u -r1.7 gfs2_tool.h >--- gfs2_tool.h 25 Oct 2007 14:14:33 -0000 1.7 >+++ gfs2_tool.h 25 Oct 2007 14:29:36 -0000 >@@ -72,6 +72,7 @@ void print_stat(int argc, char **argv); > void print_sb(int argc, char **argv); > void print_args(int argc, char **argv); > void print_jindex(int argc, char **argv); >+void print_journals(int argc, char **argv); > void print_rindex(int argc, char **argv); > void print_quota(int argc, char **argv); > void print_list(void); >Index: main.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/main.c,v >retrieving revision 1.6 >diff -w -u -p -p -u -r1.6 main.c >--- main.c 11 Oct 2007 20:27:49 -0000 1.6 >+++ main.c 25 Oct 2007 14:29:36 -0000 >@@ -53,6 +53,9 @@ static const char *usage[] = { > "Get tuneable parameters for a filesystem\n", > " gfs2_tool gettune <mountpoint>\n", > "\n", >+ "List the file system's journals:\n", >+ " gfs2_tool journals <mountpoint>\n", >+ "\n", > "List filesystems:\n", > " gfs2_tool list\n", > "\n", >@@ -235,6 +238,8 @@ main(int argc, char *argv[]) > print_args(argc, argv); > else if (strcmp(action, "gettune") == 0) > get_tune(argc, argv); >+ else if (strcmp(action, "journals") == 0) >+ print_journals(argc, argv); > else if (strcmp(action, "list") == 0) > print_list(); > else if (strcmp(action, "lockdump") == 0) >Index: misc.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/misc.c,v >retrieving revision 1.10 >diff -w -u -p -p -u -r1.10 misc.c >--- misc.c 25 Oct 2007 14:27:33 -0000 1.10 >+++ misc.c 25 Oct 2007 14:29:36 -0000 >@@ -358,6 +358,71 @@ print_args(int argc, char **argv) > > } > >+/** >+ * print_journals - print out the file system journal information >+ * @argc: >+ * @argv: >+ * >+ */ >+ >+void >+print_journals(int argc, char **argv) >+{ >+ struct gfs2_sbd sbd; >+ DIR *jindex; >+ struct dirent *journal; >+ char jindex_name[PATH_MAX], jname[PATH_MAX]; >+ int jcount; >+ struct stat statbuf; >+ >+ memset(&sbd, 0, sizeof(struct gfs2_sbd)); >+ sbd.bsize = GFS2_DEFAULT_BSIZE; >+ sbd.rgsize = -1; >+ sbd.jsize = GFS2_DEFAULT_JSIZE; >+ sbd.qcsize = GFS2_DEFAULT_QCSIZE; >+ sbd.md.journals = 1; >+ >+ sbd.path_name = argv[optind]; >+ sbd.path_fd = open(sbd.path_name, O_RDONLY); >+ if (sbd.path_fd < 0) >+ die("can't open root directory %s: %s\n", >+ sbd.path_name, strerror(errno)); >+ check_for_gfs2(&sbd); >+ sbd.device_fd = open(sbd.device_name, O_RDONLY); >+ if (sbd.device_fd < 0) >+ die("can't open device %s: %s\n", >+ sbd.device_name, strerror(errno)); >+ if (!find_gfs2_meta(&sbd)) >+ mount_gfs2_meta(&sbd); >+ lock_for_admin(&sbd); >+ >+ sprintf(jindex_name, "%s/jindex", sbd.metafs_path); >+ jindex = opendir(jindex_name); >+ if (!jindex) { >+ die("Can't open %s\n", jindex_name); >+ } else { >+ jcount = 0; >+ while ((journal = readdir(jindex))) { >+ if (journal->d_name[0] == '.') >+ continue; >+ sprintf(jname, "%s/%s", jindex_name, journal->d_name); >+ if (stat(jname, &statbuf)) { >+ statbuf.st_size = 0; >+ perror(jname); >+ } >+ jcount++; >+ printf("%s - %lluMB\n", journal->d_name, >+ (unsigned long long)statbuf.st_size / 1048576); >+ } >+ >+ printf("%d journals found.\n", jcount); >+ closedir(jindex); >+ } >+ cleanup_metafs(&sbd); >+ close(sbd.device_fd); >+ close(sbd.path_fd); >+} >+ > #if GFS2_TOOL_FEATURE_IMPLEMENTED > /** > * print_jindex - print out the journal index
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 349601
: 237381