Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 68f8a96419c8a60f2598bc2b8ea2830fb206a2ca
Parent: f2efa1d859e16711c788eaa4c7bcbb7965e580d1
Author: Carlos Maiolino <cmaiolino(a)redhat.com>
AuthorDate: Tue Jun 14 11:22:45 2011 -0300
Committer: Carlos Maiolino <cmaiolino(a)redhat.com>
CommitterDate: Tue Jun 14 12:56:30 2011 -0300
Track translatable files
This is the first patch adding the possible
translatable files to the i18n infra-structure.
This is the list of files which will be monitored
by the i18n and set to have translatable strings
---
po/POTFILES.in | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 667e27c..88d2198 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1 +1,37 @@
# List of source files which contain translatable strings.
+#
+#edit tool
+gfs2/edit/extended.c
+gfs2/edit/gfs2hex.c
+gfs2/edit/hexedit.c
+gfs2/edit/savemeta.c
+
+#fsck tool
+gfs2/fsck/eattr.c
+gfs2/fsck/fs_recovery.c
+gfs2/fsck/hash.c
+gfs2/fsck/initialize.c
+gfs2/fsck/inode_hash.c
+gfs2/fsck/link.c
+gfs2/fsck/lost_n_found.c
+gfs2/fsck/main.c
+gfs2/fsck/metawalk.c
+gfs2/fsck/pass1b.c
+gfs2/fsck/pass1.c
+gfs2/fsck/pass1c.c
+gfs2/fsck/pass2.c
+gfs2/fsck/pass3.c
+gfs2/fsck/pass4.c
+gfs2/fsck/pass5.c
+gfs2/fsck/rgrepair.c
+gfs2/fsck/util.c
+
+#mkfs tool
+gfs2/mkfs/main.c
+gfs2/mkfs/main_grow.c
+gfs2/mkfs/main_jadd.c
+gfs2/mkfs/main_mkfs.c
+
+#tune tool
+gfs2/tune/main.c
+gfs2/tune/super.c
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9b…
Commit: 9be62ccbea876e67b8ad4bb3c1b4203feb4fc1f7
Parent: 36a3625f67fd9a223d5e2db5e3ef3f02d37ee772
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Tue Jan 25 12:10:25 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Jun 13 12:40:01 2011 -0400
resource-agents: Improve LD_LIBRARY_PATH handling by SAP*
This is a backport from the Heartbeat resource agents repository.
Author: Dejan Muhamedagic (dejan at hello-penguin com)
http://hg.linux-ha.org/agents/rev/2773e5850003
Resolves: rhbz#710637
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/SAPDatabase | 3 ++-
rgmanager/src/resources/SAPInstance | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/SAPDatabase b/rgmanager/src/resources/SAPDatabase
index 5027018..3be8c8e 100644
--- a/rgmanager/src/resources/SAPDatabase
+++ b/rgmanager/src/resources/SAPDatabase
@@ -993,7 +993,8 @@ fi
# as root user we need the library path to the SAP kernel to be able to call executables
if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
- LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
+ LD_LIBRARY_PATH=$DIR_EXECUTABLE${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH
fi
sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
diff --git a/rgmanager/src/resources/SAPInstance b/rgmanager/src/resources/SAPInstance
index e70e2a3..fc0cb9e 100644
--- a/rgmanager/src/resources/SAPInstance
+++ b/rgmanager/src/resources/SAPInstance
@@ -566,7 +566,8 @@ fi
# as root user we need the library path to the SAP kernel to be able to call sapcontrol
if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
- LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
+ LD_LIBRARY_PATH=$DIR_EXECUTABLE${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH
fi
sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=10…
Commit: 103de0c93a208ae96b9771b8d7410e0537af9327
Parent: e9a69100bf11c054baeb659ba9760c713d0162cb
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed May 4 18:21:07 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Mon Jun 13 17:18:41 2011 +0100
gfs2_edit: Add compression to savemeta and restoremeta
This patch adds the ability to output gzip-compressed data with savemeta and
makes it the default behaviour. It also adds a -z <0-9> option to allow the
level of compression to be controlled, 0 meaning no compression and 9 being the
default. restoremeta can now restore from a gzip-compressed or raw metadata
file without any extra options.
The file opening, closing and writing code from savemeta has been moved into
savemeta{open,close,write} functions to abstract away compressed and
non-compressed file output.
Adds a dependency on zlib.
rhbz#702313
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/Makefile | 2 +
gfs2/edit/hexedit.c | 49 +++++++++---
gfs2/edit/hexedit.h | 2 +-
gfs2/edit/savemeta.c | 218 ++++++++++++++++++++++++++++++++++++-------------
gfs2/man/gfs2_edit.8 | 42 +++++-----
5 files changed, 224 insertions(+), 89 deletions(-)
diff --git a/gfs2/edit/Makefile b/gfs2/edit/Makefile
index 3445cc2..1d8cbc8 100644
--- a/gfs2/edit/Makefile
+++ b/gfs2/edit/Makefile
@@ -17,12 +17,14 @@ OBJS= gfs2hex.o \
CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64
CFLAGS += -I${ncursesincdir}
+CFLAGS += -I${zlibincdir}
CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
CFLAGS += -I$(S)/../include -I$(S)/../libgfs2
CFLAGS += -I${incdir}
LDFLAGS += -L${ncurseslibdir} -lncurses
LDFLAGS += -L../libgfs2/ -lgfs2
+LDFLAGS += -L${zliblibdir} -lz
LDFLAGS += -L${libdir}
LDDEPS += ../libgfs2/libgfs2.a
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index abeed18..d908169 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -39,6 +39,7 @@ struct gfs2_log_header *llh;
struct gfs2_log_descriptor *lld;
int pgnum;
int details = 0;
+long int gziplevel = 9;
int display(int identify_only);
@@ -3292,7 +3293,7 @@ static void dump_journal(const char *journal)
/* ------------------------------------------------------------------------ */
static void usage(void)
{
- fprintf(stderr,"\nFormat is: gfs2_edit [-c 1] [-V] [-x] [-h] [identify] [-p structures|blocks][blocktype][blockalloc [val]][blockbits][blockrg][find sb|rg|rb|di|in|lf|jd|lh|ld|ea|ed|lb|13|qc][field <f>[val]] /dev/device\n\n");
+ fprintf(stderr,"\nFormat is: gfs2_edit [-c 1] [-V] [-x] [-h] [identify] [-z <0-9>] [-p structures|blocks][blocktype][blockalloc [val]][blockbits][blockrg][find sb|rg|rb|di|in|lf|jd|lh|ld|ea|ed|lb|13|qc][field <f>[val]] /dev/device\n\n");
fprintf(stderr,"If only the device is specified, it enters into hexedit mode.\n");
fprintf(stderr,"identify - prints out only the block type, not the details.\n");
fprintf(stderr,"printsavedmeta - prints out the saved metadata blocks from a savemeta file.\n");
@@ -3333,6 +3334,8 @@ static void usage(void)
fprintf(stderr,"-p <b> find sb|rg|rb|di|in|lf|jd|lh|ld|ea|ed|lb|"
"13|qc - find block of given type after block <b>\n");
fprintf(stderr," <b> specifies the starting block for search\n");
+ fprintf(stderr,"-z 1 use gzip compression level 1 for savemeta (default 9)\n");
+ fprintf(stderr,"-z 0 do not use compression\n");
fprintf(stderr,"-s specifies a starting block such as root, rindex, quota, inum.\n");
fprintf(stderr,"-x print in hexmode.\n");
fprintf(stderr,"-h prints this help.\n\n");
@@ -3359,10 +3362,33 @@ static void usage(void)
fprintf(stderr," gfs2_edit -p quota find di /dev/x/y\n");
fprintf(stderr," To set the Resource Group flags for rg #7 to 3.\n");
fprintf(stderr," gfs2_edit rgflags 7 3 /dev/sdc2\n");
- fprintf(stderr," To save off all metadata for /dev/vg/lv:\n");
- fprintf(stderr," gfs2_edit savemeta /dev/vg/lv /tmp/metasave\n");
+ fprintf(stderr," To save off all metadata for /dev/vg/lv without compression:\n");
+ fprintf(stderr," gfs2_edit savemeta -z 0 /dev/vg/lv /tmp/metasave\n");
}/* usage */
+/**
+ * getgziplevel - Process the -z parameter to savemeta operations
+ * argv - argv
+ * i - a pointer to the argv index at which to begin processing
+ * The index pointed to by i will be incremented past the -z option if found
+ */
+static void getgziplevel(char *argv[], int *i)
+{
+ char *endptr;
+ (*i)++;
+ if (!strcasecmp(argv[*i], "-z")) {
+ (*i)++;
+ errno = 0;
+ gziplevel = strtol(argv[*i], &endptr, 10);
+ if (errno || endptr == argv[*i] || gziplevel < 0 || gziplevel > 9) {
+ fprintf(stderr, "Compression level out of range: %s\n", argv[*i]);
+ exit(-1);
+ }
+ } else {
+ (*i)--;
+ }
+}
+
/* ------------------------------------------------------------------------ */
/* parameterpass1 - pre-processing for command-line parameters */
/* ------------------------------------------------------------------------ */
@@ -3555,13 +3581,16 @@ static void process_parameters(int argc, char *argv[], int pass)
exit(EXIT_SUCCESS);
}
}
- else if (!strcasecmp(argv[i], "savemeta"))
- savemeta(argv[i+2], 0);
- else if (!strcasecmp(argv[i], "savemetaslow"))
- savemeta(argv[i+2], 1);
- else if (!strcasecmp(argv[i], "savergs"))
- savemeta(argv[i+2], 2);
- else if (isdigit(argv[i][0])) { /* decimal addr */
+ else if (!strcasecmp(argv[i], "savemeta")) {
+ getgziplevel(argv, &i);
+ savemeta(argv[i+2], 0, gziplevel);
+ } else if (!strcasecmp(argv[i], "savemetaslow")) {
+ getgziplevel(argv, &i);
+ savemeta(argv[i+2], 1, gziplevel);
+ } else if (!strcasecmp(argv[i], "savergs")) {
+ getgziplevel(argv, &i);
+ savemeta(argv[i+2], 2, gziplevel);
+ } else if (isdigit(argv[i][0])) { /* decimal addr */
sscanf(argv[i], "%"SCNd64, &temp_blk);
push_block(temp_blk);
} else {
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index a7a3109..cc87925 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -341,7 +341,7 @@ extern void gfs_log_header_in(struct gfs_log_header *head,
struct gfs2_buffer_head *bh);
extern void gfs_log_header_print(struct gfs_log_header *lh);
extern void gfs_dinode_in(struct gfs_dinode *di, struct gfs2_buffer_head *bh);
-extern void savemeta(char *out_fn, int saveoption);
+extern void savemeta(char *out_fn, int saveoption, int gziplevel);
extern void restoremeta(const char *in_fn, const char *out_device,
uint64_t printblocksonly);
extern int display(int identify_only);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 7840e03..cb7e243 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -16,6 +16,7 @@
#include <limits.h>
#include <sys/time.h>
#include <linux/gfs2_ondisk.h>
+#include <zlib.h>
#include "osi_list.h"
#include "gfs2hex.h"
@@ -32,6 +33,13 @@ struct saved_metablock {
char buf[BUFSIZE];
};
+struct metafd {
+ int fd;
+ gzFile gzfd;
+ const char *filename;
+ int gziplevel;
+};
+
struct saved_metablock *savedata;
uint64_t last_fs_block, last_reported_block, blks_saved, total_out, pct;
uint64_t journal_blocks[MAX_JOURNALS_SAVED];
@@ -191,7 +199,98 @@ static void warm_fuzzy_stuff(uint64_t wfsblock, int force)
}
}
-static int save_block(int fd, int out_fd, uint64_t blk)
+/**
+ * Open a file and prepare it for writing by savemeta()
+ * out_fn: the path to the file, which will be truncated if it exists
+ * gziplevel: 0 - do not compress the file,
+ * 1-9 - use gzip compression level 1-9
+ * Returns a struct metafd containing the opened file descriptor
+ */
+static struct metafd savemetaopen(char *out_fn, int gziplevel)
+{
+ struct metafd mfd;
+ char gzmode[5] = "rwb9";
+ char dft_fn[] = DFT_SAVE_FILE;
+
+ if (!out_fn) {
+ out_fn = dft_fn;
+ mfd.fd = mkstemp(out_fn);
+ } else {
+ mfd.fd = open(out_fn, O_RDWR | O_CREAT, 0644);
+ }
+ mfd.filename = out_fn;
+
+ if (mfd.fd < 0) {
+ fprintf(stderr, "Can't open %s: %s\n", out_fn, strerror(errno));
+ exit(1);
+ }
+
+ if (ftruncate(mfd.fd, 0)) {
+ fprintf(stderr, "Can't truncate %s: %s\n", out_fn, strerror(errno));
+ exit(1);
+ }
+
+ mfd.gziplevel = gziplevel;
+ if (gziplevel > 0) {
+ gzmode[3] = '0' + gziplevel;
+ mfd.gzfd = gzdopen(mfd.fd, gzmode);
+ if (!mfd.gzfd) {
+ fprintf(stderr, "gzdopen error: %s\n", strerror(errno));
+ exit(1);
+ }
+ }
+
+ return mfd;
+}
+
+/**
+ * Write nbyte bytes from buf to a file opened with savemetaopen()
+ * mfd: the file descriptor opened using savemetaopen()
+ * buf: the buffer to write data from
+ * nbyte: the number of bytes to write
+ * Returns the number of bytes written from buf or -1 on error
+ */
+static ssize_t savemetawrite(struct metafd *mfd, const void *buf, size_t nbyte)
+{
+ ssize_t ret;
+ int gzerr;
+ const char *gzerrmsg;
+
+ if (mfd->gziplevel == 0) {
+ return write(mfd->fd, buf, nbyte);
+ }
+
+ ret = gzwrite(mfd->gzfd, buf, nbyte);
+ if (ret != nbyte) {
+ gzerrmsg = gzerror(mfd->gzfd, &gzerr);
+ if (gzerr != Z_ERRNO) {
+ fprintf(stderr, "Error: zlib: %s\n", gzerrmsg);
+ }
+ }
+ return ret;
+}
+
+/**
+ * Closes a file descriptor previously opened using savemetaopen()
+ * mfd: the file descriptor previously opened using savemetaopen()
+ * Returns 0 on success or -1 on error
+ */
+static int savemetaclose(struct metafd *mfd)
+{
+ int gzret;
+ if (mfd->gziplevel > 0) {
+ gzret = gzclose(mfd->gzfd);
+ if (gzret == Z_STREAM_ERROR) {
+ fprintf(stderr, "gzclose: file is not valid\n");
+ return -1;
+ } else if (gzret == Z_ERRNO) {
+ return -1;
+ }
+ }
+ return close(mfd->fd);
+}
+
+static int save_block(int fd, struct metafd *mfd, uint64_t blk)
{
int blktype, blklen, outsz;
uint16_t trailing0;
@@ -226,7 +325,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
p--;
}
savedata->blk = cpu_to_be64(blk);
- if (write(out_fd, &savedata->blk, sizeof(savedata->blk)) !=
+ if (savemetawrite(mfd, &savedata->blk, sizeof(savedata->blk)) !=
sizeof(savedata->blk)) {
fprintf(stderr, "write error: %s from %s:%d: "
"block %lld (0x%llx)\n", strerror(errno),
@@ -237,7 +336,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
}
outsz = blklen - trailing0;
savedata->siglen = cpu_to_be16(outsz);
- if (write(out_fd, &savedata->siglen, sizeof(savedata->siglen)) !=
+ if (savemetawrite(mfd, &savedata->siglen, sizeof(savedata->siglen)) !=
sizeof(savedata->siglen)) {
fprintf(stderr, "write error: %s from %s:%d: "
"block %lld (0x%llx)\n", strerror(errno),
@@ -246,7 +345,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
(unsigned long long)savedata->blk);
exit(-1);
}
- if (write(out_fd, savedata->buf, outsz) != outsz) {
+ if (savemetawrite(mfd, savedata->buf, outsz) != outsz) {
fprintf(stderr, "write error: %s from %s:%d: "
"block %lld (0x%llx)\n", strerror(errno),
__FUNCTION__, __LINE__,
@@ -263,7 +362,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
/*
* save_ea_block - save off an extended attribute block
*/
-static void save_ea_block(int out_fd, struct gfs2_buffer_head *metabh)
+static void save_ea_block(struct metafd *mfd, struct gfs2_buffer_head *metabh)
{
int i, e, ea_len = sbd.bsize;
struct gfs2_ea_header ea;
@@ -281,7 +380,7 @@ static void save_ea_block(int out_fd, struct gfs2_buffer_head *metabh)
b = (uint64_t *)(metabh->b_data);
b += charoff + i;
blk = be64_to_cpu(*b);
- save_block(sbd.device_fd, out_fd, blk);
+ save_block(sbd.device_fd, mfd, blk);
}
if (!ea.ea_rec_len)
break;
@@ -292,7 +391,7 @@ static void save_ea_block(int out_fd, struct gfs2_buffer_head *metabh)
/*
* save_indirect_blocks - save all indirect blocks for the given buffer
*/
-static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
+static void save_indirect_blocks(struct metafd *mfd, osi_list_t *cur_list,
struct gfs2_buffer_head *mybh, int height, int hgt)
{
uint64_t old_block = 0, indir_block;
@@ -312,10 +411,10 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
if (indir_block == old_block)
continue;
old_block = indir_block;
- blktype = save_block(sbd.device_fd, out_fd, indir_block);
+ blktype = save_block(sbd.device_fd, mfd, indir_block);
if (blktype == GFS2_METATYPE_EA) {
nbh = bread(&sbd, indir_block);
- save_ea_block(out_fd, nbh);
+ save_ea_block(mfd, nbh);
brelse(nbh);
}
if (height != hgt) { /* If not at max height */
@@ -331,7 +430,7 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
/*
* save_inode_data - save off important data associated with an inode
*
- * out_fd - destination file descriptor
+ * mfd - destination file descriptor
* block - block number of the inode to save the data for
*
* For user files, we don't want anything except all the indirect block
@@ -343,7 +442,7 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
* For file system journals, the "data" is a mixture of metadata and
* journaled data. We want all the metadata and none of the user data.
*/
-static void save_inode_data(int out_fd)
+static void save_inode_data(struct metafd *mfd)
{
uint32_t height;
struct gfs2_inode *inode;
@@ -380,7 +479,7 @@ static void save_inode_data(int out_fd)
for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next){
mybh = osi_list_entry(tmp, struct gfs2_buffer_head,
b_altlist);
- save_indirect_blocks(out_fd, cur_list, mybh,
+ save_indirect_blocks(mfd, cur_list, mybh,
height, i);
} /* for blocks at that height */
} /* for height */
@@ -408,7 +507,7 @@ static void save_inode_data(int out_fd)
old_leaf = leaf_no;
mybh = bread(&sbd, leaf_no);
if (gfs2_check_meta(mybh, GFS2_METATYPE_LF) == 0)
- save_block(sbd.device_fd, out_fd, leaf_no);
+ save_block(sbd.device_fd, mfd, leaf_no);
brelse(mybh);
}
}
@@ -417,17 +516,17 @@ static void save_inode_data(int out_fd)
struct gfs2_buffer_head *lbh;
lbh = bread(&sbd, inode->i_di.di_eattr);
- save_block(sbd.device_fd, out_fd, inode->i_di.di_eattr);
+ save_block(sbd.device_fd, mfd, inode->i_di.di_eattr);
gfs2_meta_header_in(&mh, lbh);
if (mh.mh_magic == GFS2_MAGIC &&
mh.mh_type == GFS2_METATYPE_EA)
- save_ea_block(out_fd, lbh);
+ save_ea_block(mfd, lbh);
else if (mh.mh_magic == GFS2_MAGIC &&
mh.mh_type == GFS2_METATYPE_IN)
- save_indirect_blocks(out_fd, cur_list, lbh, 2, 2);
+ save_indirect_blocks(mfd, cur_list, lbh, 2, 2);
else {
if (mh.mh_magic == GFS2_MAGIC) /* if it's metadata */
- save_block(sbd.device_fd, out_fd,
+ save_block(sbd.device_fd, mfd,
inode->i_di.di_eattr);
fprintf(stderr,
"\nWarning: corrupt extended "
@@ -527,32 +626,21 @@ static int next_rg_freemeta(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
return 0;
}
-void savemeta(char *out_fn, int saveoption)
+void savemeta(char *out_fn, int saveoption, int gziplevel)
{
- int out_fd;
int slow;
osi_list_t *tmp;
int rgcount;
uint64_t jindex_block;
struct gfs2_buffer_head *lbh;
struct rgrp_list *last_rgd, *prev_rgd;
+ struct metafd mfd;
slow = (saveoption == 1);
sbd.md.journals = 1;
- if (!out_fn) {
- out_fn = strdup(DFT_SAVE_FILE);
- if (!out_fn)
- die("Can't allocate memory for the operation.\n");
- out_fd = mkstemp(out_fn);
- } else
- out_fd = open(out_fn, O_RDWR | O_CREAT, 0644);
-
- if (out_fd < 0)
- die("Can't open %s: %s\n", out_fn, strerror(errno));
-
- if (ftruncate(out_fd, 0))
- die("Can't truncate %s: %s\n", out_fn, strerror(errno));
+ mfd = savemetaopen(out_fn, gziplevel);
+
savedata = malloc(sizeof(struct saved_metablock));
if (!savedata)
die("Can't allocate memory for the operation.\n");
@@ -647,15 +735,15 @@ void savemeta(char *out_fn, int saveoption)
get_journal_inode_blocks();
if (!slow) {
/* Save off the superblock */
- save_block(sbd.device_fd, out_fd, 0x10 * (4096 / sbd.bsize));
+ save_block(sbd.device_fd, &mfd, 0x10 * (4096 / sbd.bsize));
/* If this is gfs1, save off the rindex because it's not
part of the file system as it is in gfs2. */
if (gfs1) {
int j;
block = sbd1->sb_rindex_di.no_addr;
- save_block(sbd.device_fd, out_fd, block);
- save_inode_data(out_fd);
+ save_block(sbd.device_fd, &mfd, block);
+ save_inode_data(&mfd);
/* In GFS1, journals aren't part of the RG space */
for (j = 0; j < journals_found; j++) {
log_debug("Saving journal #%d\n", j + 1);
@@ -663,7 +751,7 @@ void savemeta(char *out_fn, int saveoption)
block < journal_blocks[j] +
gfs1_journal_size;
block++)
- save_block(sbd.device_fd, out_fd, block);
+ save_block(sbd.device_fd, &mfd, block);
}
}
/* Walk through the resource groups saving everything within */
@@ -685,7 +773,7 @@ void savemeta(char *out_fn, int saveoption)
for (block = rgd->ri.ri_addr;
block < rgd->ri.ri_data0; block++) {
warm_fuzzy_stuff(block, FALSE);
- save_block(sbd.device_fd, out_fd, block);
+ save_block(sbd.device_fd, &mfd, block);
}
/* Save off the other metadata: inodes, etc. */
if (saveoption != 2) {
@@ -694,9 +782,9 @@ void savemeta(char *out_fn, int saveoption)
while (!gfs2_next_rg_meta(rgd, &block, first)){
warm_fuzzy_stuff(block, FALSE);
blktype = save_block(sbd.device_fd,
- out_fd, block);
+ &mfd, block);
if (blktype == GFS2_METATYPE_DI)
- save_inode_data(out_fd);
+ save_inode_data(&mfd);
first = 0;
}
/* Save off the free/unlinked meta blocks too.
@@ -705,7 +793,7 @@ void savemeta(char *out_fn, int saveoption)
while (!next_rg_freemeta(&sbd, rgd, &block,
first)) {
blktype = save_block(sbd.device_fd,
- out_fd, block);
+ &mfd, block);
first = 0;
}
}
@@ -714,7 +802,7 @@ void savemeta(char *out_fn, int saveoption)
}
if (slow) {
for (block = 0; block < last_fs_block; block++) {
- save_block(sbd.device_fd, out_fd, block);
+ save_block(sbd.device_fd, &mfd, block);
}
}
/* Clean up */
@@ -722,28 +810,33 @@ void savemeta(char *out_fn, int saveoption)
/* so we tell the user that we've processed everything. */
block = last_fs_block;
warm_fuzzy_stuff(block, TRUE);
- printf("\nMetadata saved to file %s.\n", out_fn);
+ printf("\nMetadata saved to file %s ", mfd.filename);
+ if (mfd.gziplevel) {
+ printf("(gzipped, level %d).\n", mfd.gziplevel);
+ } else {
+ printf("(uncompressed).\n");
+ }
free(savedata);
- close(out_fd);
+ savemetaclose(&mfd);
close(sbd.device_fd);
exit(0);
}
-static int restore_data(int fd, int in_fd, int printblocksonly,
+static int restore_data(int fd, gzFile *gzin_fd, int printblocksonly,
int find_highblk)
{
size_t rs;
uint64_t buf64, writes = 0, highest_valid_block = 0;
uint16_t buf16;
- int first = 1, pos;
+ int first = 1, pos, gzerr;
char rdbuf[256];
char gfs_superblock_id[8] = {0x01, 0x16, 0x19, 0x70,
0x00, 0x00, 0x00, 0x01};
if (!printblocksonly)
lseek(fd, 0, SEEK_SET);
- lseek(in_fd, 0, SEEK_SET);
- rs = read(in_fd, rdbuf, sizeof(rdbuf));
+ gzseek(gzin_fd, 0, SEEK_SET);
+ rs = gzread(gzin_fd, rdbuf, sizeof(rdbuf));
if (rs != sizeof(rdbuf)) {
fprintf(stderr, "Error: File is too small.\n");
return -1;
@@ -757,7 +850,7 @@ static int restore_data(int fd, int in_fd, int printblocksonly,
}
if (pos == sizeof(rdbuf) - sizeof(uint64_t) - sizeof(uint16_t))
pos = 0;
- if (lseek(in_fd, pos, SEEK_SET) != pos) {
+ if (gzseek(gzin_fd, pos, SEEK_SET) != pos) {
fprintf(stderr, "bad seek: %s from %s:%d: "
"offset %lld (0x%llx)\n", strerror(errno),
__FUNCTION__, __LINE__, (unsigned long long)pos,
@@ -770,7 +863,7 @@ static int restore_data(int fd, int in_fd, int printblocksonly,
struct gfs2_buffer_head dummy_bh;
memset(savedata, 0, sizeof(struct saved_metablock));
- rs = read(in_fd, &buf64, sizeof(uint64_t));
+ rs = gzread(gzin_fd, &buf64, sizeof(uint64_t));
if (!rs)
break;
if (rs != sizeof(uint64_t)) {
@@ -789,7 +882,15 @@ static int restore_data(int fd, int in_fd, int printblocksonly,
savedata->blk);
return -1;
}
- rs = read(in_fd, &buf16, sizeof(uint16_t));
+ if (gzread(gzin_fd, &buf16, sizeof(uint16_t)) !=
+ sizeof(uint16_t)) {
+ fprintf(stderr, "read error: %s from %s:%d: "
+ "block %lld (0x%llx)\n",
+ gzerror(gzin_fd, &gzerr), __FUNCTION__, __LINE__,
+ (unsigned long long)savedata->blk,
+ (unsigned long long)savedata->blk);
+ exit(-1);
+ }
savedata->siglen = be16_to_cpu(buf16);
if (savedata->siglen > sizeof(savedata->buf)) {
fprintf(stderr, "\nBad record length: %d for block #%"
@@ -798,11 +899,11 @@ static int restore_data(int fd, int in_fd, int printblocksonly,
return -1;
}
if (savedata->siglen &&
- read(in_fd, savedata->buf, savedata->siglen) !=
+ gzread(gzin_fd, savedata->buf, savedata->siglen) !=
savedata->siglen) {
fprintf(stderr, "read error: %s from %s:%d: "
"block %lld (0x%llx)\n",
- strerror(errno), __FUNCTION__, __LINE__,
+ gzerror(gzin_fd, &gzerr), __FUNCTION__, __LINE__,
(unsigned long long)savedata->blk,
(unsigned long long)savedata->blk);
exit(-1);
@@ -908,15 +1009,16 @@ static void complain(const char *complaint)
void restoremeta(const char *in_fn, const char *out_device,
uint64_t printblocksonly)
{
- int in_fd, error;
+ int error;
+ gzFile gzfd;
termlines = 0;
if (!in_fn)
complain("No source file specified.");
if (!printblocksonly && !out_device)
complain("No destination file system specified.");
- in_fd = open(in_fn, O_RDONLY);
- if (in_fd < 0)
+ gzfd = gzopen(in_fn, "rb");
+ if (!gzfd)
die("Can't open source file %s: %s\n",
in_fn, strerror(errno));
@@ -933,13 +1035,13 @@ void restoremeta(const char *in_fn, const char *out_device,
die("Can't allocate memory for the restore operation.\n");
blks_saved = 0;
- restore_data(sbd.device_fd, in_fd, printblocksonly, 1);
- error = restore_data(sbd.device_fd, in_fd, printblocksonly, 0);
+ restore_data(sbd.device_fd, gzfd, printblocksonly, 1);
+ error = restore_data(sbd.device_fd, gzfd, printblocksonly, 0);
printf("File %s %s %s.\n", in_fn,
(printblocksonly ? "print" : "restore"),
(error ? "error" : "successful"));
free(savedata);
- close(in_fd);
+ gzclose(gzfd);
if (!printblocksonly)
close(sbd.device_fd);
diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8
index 2546c7b..a48a38c 100644
--- a/gfs2/man/gfs2_edit.8
+++ b/gfs2/man/gfs2_edit.8
@@ -138,7 +138,9 @@ Print program version information only.
.TP
\fB-x\fP
Print in hex mode.
-
+.TP
+\fB-z <0-9>\fP
+Compress metadata with gzip compression level 1 to 9 (default 9). 0 means no compression at all.
.TP
\fBrg\fP \fI<rg>\fR \fI<device>\fR
Print the contents of Resource Group \fI<rg>\fR on \fI<device>\fR.
@@ -169,35 +171,35 @@ that may be contained in the files. This option works quickly by
using the system bitmap blocks in the resource groups to determine the
location of all the metadata. If there is corruption
in the bitmaps, resource groups or rindex file, this method may fail and
-you may need to use the savemetaslow option.
-The destination file is not compressed. You may want to compress it
-with a program such as bzip2 before sending it for analysis.
+you may need to use the savemetaslow option. The destination file is
+compressed using gzip unless -z 0 is specified.
.TP
\fBsavemetaslow\fP \fI<device>\fR \fI<filename>\fR
Save off GFS2 metadata, as with the savemeta option, examining every
block in the file system for metadata. This option is less prone to failure
due to file system corruption than the savemeta option, but it is
-extremely slow.
+extremely slow. The destination file is compressed using gzip unless
+-z 0 is specified.
.TP
\fBsavergs\fP \fI<device>\fR \fI<filename>\fR
Save off only the GFS2 resource group metadata for the file system on the
-specified device to a file given by <filename>.
+specified device to a file given by <filename>. The destination file is
+compressed using gzip unless -z 0 is specified.
.TP
\fBrestoremeta\fP \fI<filename>\fR \fI<dest device>\fR
-Take a file created with the savemeta option and restores its
-contents on top of the specified destination device. \fBWARNING\fP:
-When you use this option, the file system and all data on the
-destination device is destroyed. Since only metadata (but no data)
-is restored, every file in the resulting file system is likely to be
-corrupt. The ONLY purpose of this option is to examine and debug file
-system problems by restoring and examining the state of the saved metadata.
-If the destination file system is the same size or larger than the source
-file system where the metadata was saved, the resulting file system
-will be the same size as the source. If the destination device is
-smaller than the source file system, gfs2_edit will restore as much as
-it can, then quit, leaving you with a file system that probably will not
-mount, but from which you might still be able to figure out what is
-wrong with the source file system.
+Take a compressed or uncompressed file created with the savemeta option and
+restores its contents on top of the specified destination device.
+\fBWARNING\fP: When you use this option, the file system and all data on the
+destination device is destroyed. Since only metadata (but no data) is
+restored, every file in the resulting file system is likely to be corrupt. The
+ONLY purpose of this option is to examine and debug file system problems by
+restoring and examining the state of the saved metadata. If the destination
+file system is the same size or larger than the source file system where the
+metadata was saved, the resulting file system will be the same size as the
+source. If the destination device is smaller than the source file system,
+gfs2_edit will restore as much as it can, then quit, leaving you with a file
+system that probably will not mount, but from which you might still be able to
+figure out what is wrong with the source file system.
.SH INTERACTIVE MODE
If you specify a device on the gfs2_edit command line and you specify
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: f2efa1d859e16711c788eaa4c7bcbb7965e580d1
Parent: 71ae3db1b77c4a8520758494dded6859a2cfbd7e
Author: Carlos Maiolino <cmaiolino(a)redhat.com>
AuthorDate: Thu Jun 9 14:14:22 2011 -0300
Committer: Carlos Maiolino <cmaiolino(a)redhat.com>
CommitterDate: Thu Jun 9 14:14:22 2011 -0300
Add i18n support to gfs2-utils
This patch adds i18n support to gfs2-utils, creating the
structure required by gnu gettext.
It makes use of an external libintl, instead of embed it
into the package.
---
Makefile.am | 4 +-
config.rpath | 672 ++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 5 +
po/ChangeLog | 12 +
po/Makefile.in.in | 444 ++++++++++++++++++++++++++++++++
po/Makevars | 41 +++
po/POTFILES.in | 1 +
po/Rules-quot | 47 ++++
po/boldquot.sed | 10 +
po/en(a)boldquot.header | 25 ++
po/en(a)quot.header | 22 ++
po/insert-header.sin | 23 ++
po/quot.sed | 6 +
po/remove-potcdate.sin | 19 ++
14 files changed, 1329 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 688c350..2e5d9ae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-EXTRA_DIST = autogen.sh
+EXTRA_DIST = config.rpath m4/ChangeLog autogen.sh
AUTOMAKE_OPTIONS = foreign
@@ -12,7 +12,7 @@ noinst_HEADERS = make/copyright.cf
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = group gfs2 doc
+SUBDIRS = po group gfs2 doc
install-exec-local:
$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
diff --git a/config.rpath b/config.rpath
new file mode 100755
index 0000000..17298f2
--- /dev/null
+++ b/config.rpath
@@ -0,0 +1,672 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2010 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord(a)gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja(a)dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/configure.ac b/configure.ac
index 5ebff8a..81ffad8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,10 @@ AC_PROG_LIBTOOL
AC_LANG([C])
+#i18n support
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.18])
+
# Sanitize path
if test "$prefix" = "NONE"; then
@@ -282,6 +286,7 @@ AC_CONFIG_FILES([Makefile
gfs2/tune/Makefile
gfs2/man/Makefile
doc/Makefile
+ po/Makefile.in
])
AC_OUTPUT
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 0000000..d4bc042
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,12 @@
+2011-06-09 gettextize <bug-gnu-gettext(a)gnu.org>
+
+ * Makefile.in.in: New file, from gettext-0.18.1.
+ * boldquot.sed: New file, from gettext-0.18.1.
+ * en(a)boldquot.header: New file, from gettext-0.18.1.
+ * en(a)quot.header: New file, from gettext-0.18.1.
+ * insert-header.sin: New file, from gettext-0.18.1.
+ * quot.sed: New file, from gettext-0.18.1.
+ * remove-potcdate.sin: New file, from gettext-0.18.1.
+ * Rules-quot: New file, from gettext-0.18.1.
+ * POTFILES.in: New file.
+
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..83d8838
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,444 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper(a)gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.18
+GETTEXT_MACRO_VERSION = 0.18
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: check-macro-version all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+check-macro-version:
+ @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
+ package_gnu='GNU '; \
+ else \
+ package_gnu=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_gnu}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..5c753bf
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Red Hat, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = linux-cluster(a)redhat.com
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..667e27c
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1 @@
+# List of source files which contain translatable strings.
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644
index 0000000..af52487
--- /dev/null
+++ b/po/Rules-quot
@@ -0,0 +1,47 @@
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en(a)quot.header en(a)boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en(a)quot.po-create:
+ $(MAKE) en(a)quot.po-update
+en(a)boldquot.po-create:
+ $(MAKE) en(a)boldquot.po-update
+
+en(a)quot.po-update: en(a)quot.po-update-en
+en(a)boldquot.po-update: en(a)boldquot.po-update-en
+
+.insert-header.po-update-en:
+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ ll=`echo $$lang | sed -e 's/@.*//'`; \
+ LC_ALL=C; export LC_ALL; \
+ cd $(srcdir); \
+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "creation of $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+en(a)quot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en(a)quot.header/g' $(srcdir)/insert-header.sin > en(a)quot.insert-header
+
+en(a)boldquot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en(a)boldquot.header/g' $(srcdir)/insert-header.sin > en(a)boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+ rm -f *.insert-header
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
index 0000000..4b937aa
--- /dev/null
+++ b/po/boldquot.sed
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“[1m/g
+s/”/[0m”/g
+s/‘/‘[1m/g
+s/’/[0m’/g
diff --git a/po/en(a)boldquot.header b/po/en(a)boldquot.header
new file mode 100644
index 0000000..fedb6a0
--- /dev/null
+++ b/po/en(a)boldquot.header
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/po/en(a)quot.header b/po/en(a)quot.header
new file mode 100644
index 0000000..a9647fc
--- /dev/null
+++ b/po/en(a)quot.header
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
index 0000000..b26de01
--- /dev/null
+++ b/po/insert-header.sin
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644
index 0000000..0122c46
--- /dev/null
+++ b/po/quot.sed
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e9…
Commit: e9a69100bf11c054baeb659ba9760c713d0162cb
Parent: 18c47dede44df18b6ebad1e1a20756e3ba498596
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jun 3 07:17:25 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Jun 3 07:17:25 2011 -0500
fsck.gfs2: segfault in pass1b
The problem occurred when there were duplicate block
references in a dinode but all references in the duplicate
list are eventually deleted due to other corruption.
The fix is an additional check whether the list is empty.
rhbz#679080
---
gfs2/fsck/pass1b.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 4d97879..7f79783 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -542,7 +542,7 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct duptree *b)
last_reference = clear_a_reference(sbp, b, &b->ref_inode_list,
&dh, 0);
- if (last_reference) {
+ if (last_reference && !osi_list_empty(&b->ref_inode_list)) {
uint8_t q;
/* If we're down to a single reference (and not all references
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=1e95a3d8c8…
Commit: 1e95a3d8c8fb8ef889b4e69fca9ac7d9c062517b
Parent: 7675151a06bc021d32a8ceba0c62f270efda448c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 1 12:14:56 2011 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 1 12:14:56 2011 -0500
dlm_controld: clear waiting plocks for closed files
The new CLOSE flag is set in unlock operations that are
generated by the vfs removing locks that were not unlocked
by the process, when the process closes the file or exits.
The kernel does not take a reply for these unlock-close
operations.
plock requests can now be interrupted in the kernel when the
process is killed. So the unlock-close also needs to clear
any waiting plocks that were abandoned by the killed process.
The corresponding kernel patch:
https://lkml.org/lkml/2011/5/23/237
bz 678585
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/plock.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 66b20a1..967f3c0 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -3,6 +3,10 @@
#include <linux/dlm_plock.h>
+/* FIXME: remove this once everyone is using the version of
+ * dlm_plock.h which defines it */
+#define DLM_PLOCK_FL_CLOSE 1
+
static uint32_t plock_read_count;
static uint32_t plock_recv_count;
static uint32_t plock_rate_delays;
@@ -679,6 +683,27 @@ static int unlock_internal(struct lockspace *ls, struct resource *r,
return rv;
}
+static void clear_waiters(struct lockspace *ls, struct resource *r,
+ struct dlm_plock_info *in)
+{
+ struct lock_waiter *w, *safe;
+
+ list_for_each_entry_safe(w, safe, &r->waiters, list) {
+ if (w->info.nodeid != in->nodeid || w->info.owner != in->owner)
+ continue;
+
+ list_del(&w->list);
+
+ log_plock_error(ls, "clear waiter %llx %llx-%llx %d/%u/%llx",
+ (unsigned long long)in->number,
+ (unsigned long long)in->start,
+ (unsigned long long)in->end,
+ in->nodeid, in->pid,
+ (unsigned long long)in->owner);
+ free(w);
+ }
+}
+
static int add_waiter(struct lockspace *ls, struct resource *r,
struct dlm_plock_info *in)
@@ -764,9 +789,16 @@ static void do_unlock(struct lockspace *ls, struct dlm_plock_info *in,
rv = unlock_internal(ls, r, in);
+ if (in->flags & DLM_PLOCK_FL_CLOSE) {
+ clear_waiters(ls, r, in);
+ /* no replies for unlock-close ops */
+ goto skip_result;
+ }
+
if (in->nodeid == our_nodeid)
write_result(ls, in, rv);
+ skip_result:
do_waiters(ls, r);
put_resource(ls, r);
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a5…
Commit: a548bd3333824341373a5f9a8ff9a456c5af59c8
Parent: 4784df4a5d9e4c606c159f48d9ea4dddc727cce4
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 1 12:13:06 2011 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 1 12:13:06 2011 -0500
dlm_controld: clear waiting plocks for closed files
The new CLOSE flag is set in unlock operations that are
generated by the vfs removing locks that were not unlocked
by the process, when the process closes the file or exits.
The kernel does not take a reply for these unlock-close
operations.
plock requests can now be interrupted in the kernel when the
process is killed. So the unlock-close also needs to clear
any waiting plocks that were abandoned by the killed process.
The corresponding kernel patch:
https://lkml.org/lkml/2011/5/23/237
bz 678585
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/plock.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index f27001f..f596d2f 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -3,6 +3,10 @@
#include <linux/dlm_plock.h>
+/* FIXME: remove this once everyone is using the version of
+ * dlm_plock.h which defines it */
+#define DLM_PLOCK_FL_CLOSE 1
+
static uint32_t plock_read_count;
static uint32_t plock_recv_count;
static uint32_t plock_rate_delays;
@@ -631,6 +635,27 @@ static int unlock_internal(struct lockspace *ls, struct resource *r,
return rv;
}
+static void clear_waiters(struct lockspace *ls, struct resource *r,
+ struct dlm_plock_info *in)
+{
+ struct lock_waiter *w, *safe;
+
+ list_for_each_entry_safe(w, safe, &r->waiters, list) {
+ if (w->info.nodeid != in->nodeid || w->info.owner != in->owner)
+ continue;
+
+ list_del(&w->list);
+
+ log_plock_error(ls, "clear waiter %llx %llx-%llx %d/%u/%llx",
+ (unsigned long long)in->number,
+ (unsigned long long)in->start,
+ (unsigned long long)in->end,
+ in->nodeid, in->pid,
+ (unsigned long long)in->owner);
+ free(w);
+ }
+}
+
static int add_waiter(struct lockspace *ls, struct resource *r,
struct dlm_plock_info *in)
@@ -716,9 +741,16 @@ static void do_unlock(struct lockspace *ls, struct dlm_plock_info *in,
rv = unlock_internal(ls, r, in);
+ if (in->flags & DLM_PLOCK_FL_CLOSE) {
+ clear_waiters(ls, r, in);
+ /* no replies for unlock-close ops */
+ goto skip_result;
+ }
+
if (in->nodeid == our_nodeid)
write_result(ls, in, rv);
+ skip_result:
do_waiters(ls, r);
put_resource(r);
}