Skip to contentSkip to conversation

cluster/gfs2 convert/gfs2_convert.c fsck/Makef ...

Cluster-devel [email protected] 1 participant 1 message Aug 15, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2007-08-15 22:31:00

Modified files:

	gfs2/convert   : gfs2_convert.c 
	gfs2/fsck      : Makefile fsck.h main.c pass1.c 
	gfs2/libgfs2   : gfs2_log.c libgfs2.h 

Log message:
Resolves: bz #240545: gfs2_fsck should behave more like the other fscks.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/convert/gfs2_convert.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.3&r2=1.7.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/fsck.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.3&r2=1.4.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.5&r2=1.4.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/gfs2_log.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/libgfs2.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.9&r2=1.7.2.10

gfs2/convert/gfs2_convert.c +5 -1
@@ -1088,8 +1088,12 @@
 	/* Make them seal their fate.                     */
 	/* ---------------------------------------------- */
 	if (!error) {
+		int abort;
+
 		give_warning();
-		if (!query(&opts, "Convert %s from GFS1 to GFS2? (y/n)", device)) {
+		if (!gfs2_query(&abort, &opts,
+				"Convert %s from GFS1 to GFS2? (y/n)",
+				device)) {
 			log_crit("%s not converted.\n", device);
 			close(sb2.device_fd);
 			exit(0);
gfs2/fsck/Makefile +16 -10
@@ -14,7 +14,8 @@
 
 include ${top_srcdir}/make/defines.mk
 
-TARGET= gfs2_fsck
+TARGET1= fsck.gfs2
+TARGET2= gfs2_fsck
 
 INCLUDES= -I${top_srcdir}/include -I${top_srcdir}/config -I${top_srcdir}/libgfs2 -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
 LIBS=${top_srcdir}/libgfs2
@@ -27,38 +28,43 @@
 
 CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -O2
 
-all: ${TARGET}
+all: depends ${TARGET1} ${TARGET2}
 
-gfs2_fsck: $(sources:.c=.o) $(LIBS)/libgfs2.a
+${TARGET1}: $(sources:.c=.o)
 	$(CC) $(CFLAGS) -L$(LIBS) $^ -o $@ -lgfs2
 
+${TARGET2}: ${TARGET1}
+	ln -fs ${TARGET1} ${TARGET2}	
+
 %.o: %.c
 	$(CC) -MMD -c $(INCLUDES) $(CFLAGS) $< -o $@
 
+depends:
+	$(MAKE) -C ../libgfs2 all
 
 test_block_list: log.o test_block_list.o
 	$(CC) $(CFLAGS) $^ -o $@
 
 test_bitmap: test_bitmap.o log.o
 	$(CC) $(CFLAGS) $^ -o $@
+
 clean:
-	@rm -f gfs2_fsck *.o *~ *.d
+	rm -f ${TARGET1} ${TARGET2} *.o *~ *.d cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
 
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
 	fi
-	strip ${TARGET}
-	install -m755 ${TARGET} ${sbindir}
+	install -m755 ${TARGET1} ${sbindir}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
 
 distclean: clean
-	@rm -f cscope.* gfs2_fsck test_inode_list *.orig *.rej test_block_list test_bitmap
+	@rm -f cscope.* {TARGET1} test_inode_list *.orig *.rej test_block_list test_bitmap
 
 
-gfs2_fsck.pot: $(sources)
+{TARGET1}.pot: $(sources)
 	@xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
 	 --keyword=log_notice --keyword=log_warn --keyword=log_err --keyword=log_crit \
-	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(sources) > gfs2_fsck.pot	
-
+	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(sources) > ${TARGET1}.pot	
 
 -include $(sources:.c=.d)
gfs2/fsck/fsck.h +2 -0
@@ -19,6 +19,8 @@
 #define FSCK_HASH_SIZE          (1 << FSCK_HASH_SHIFT)
 #define FSCK_HASH_MASK          (FSCK_HASH_SIZE - 1)
 
+#define query(opts, fmt, args...) gfs2_query(&fsck_abort, opts, fmt, ##args)
+
 struct inode_info
 {
         osi_list_t list;
gfs2/fsck/main.c +18 -48

74 lines not on this page · raw message

gfs2/fsck/pass1.c +3 -1
@@ -766,8 +766,10 @@
 			if (gfs2_next_rg_meta(rgd, &block, first))
 				break;
 			warm_fuzzy_stuff(block);
-			if (fsck_abort) /* if asked to abort */
+			if (fsck_abort) { /* if asked to abort */
+				gfs2_rgrp_relse(rgd, not_updated);
 				return 0;
+			}
 			if (skip_this_pass) {
 				printf("Skipping pass 1 is not a good idea.\n");
 				skip_this_pass = FALSE;
gfs2/libgfs2/gfs2_log.c +102 -45

190 lines not on this page · raw message

gfs2/libgfs2/libgfs2.h +7 -1
@@ -496,7 +496,13 @@
 void decrease_verbosity(void);
 void print_fsck_log(int iif, int priority, char *file, int line,
 					const char *format, ...);
-int query(struct gfs2_options *opts, const char *format, ...);
+char gfs2_getch(void);
+
+char generic_interrupt(const char *caller, const char *where,
+		       const char *progress, const char *question,
+		       const char *answers);
+int gfs2_query(int *setonabort, struct gfs2_options *opts,
+	       const char *format, ...);
 
 /* misc.c */
 void compute_constants(struct gfs2_sbd *sdp);