cluster/gfs2 libgfs2/libgfs2.h libgfs2/misc.c ...
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-05-10 15:47:46
Modified files:
gfs2/libgfs2 : libgfs2.h misc.c gfs2/mkfs : Makefile main.c main_jadd.c main_mkfs.c gfs2/quota : check.c gfs2_quota.h main.c gfs2/tool : gfs2_tool.h
Added files:
gfs2/mkfs : main_grow.c
Log message:
Resolves: Bugzilla Bug 234844: Need to add a "gfs2_grow" command
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/libgfs2.h.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/misc.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_grow.c.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/Makefile.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_mkfs.c.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/quota/check.c.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/quota/gfs2_quota.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/quota/main.c.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/tool/gfs2_tool.h.diff?cvsroot=cluster&r1=1.5&r2=1.6
gfs2/libgfs2/libgfs2.h +10 -2
@@ -165,7 +165,7 @@int expert;int override; -char *device_name; +char device_name[PATH_MAX ];char *path_name;/* Constants */
@@ -219,6 +219,9 @@unsigned int spills;unsigned int writes; +int metafs_fd; +int metafs_mounted;/* If metafs was already mounted */ +char metafs_path[PATH_MAX ];/* where metafs is mounted */ };extern char *prog_name;
@@ -343,7 +346,6 @@/* device_geometry.c */ void device_geometry (struct gfs2_sbd *sdp);void fix_device_geometry (struct gfs2_sbd *sdp); -void munge_device_geometry_for_grow (struct gfs2_sbd *sdp);/* fs_bits.c */ #define BFITNOENT (0xFFFFFFFF)
@@ -497,6 +499,12 @@/* misc.c */ void compute_constants (struct gfs2_sbd *sdp); +int find_gfs2_meta (struct gfs2_sbd *sdp); +int dir_exists (const char *dir); +void check_for_gfs2 (struct gfs2_sbd *sdp); +void mount_gfs2_meta (struct gfs2_sbd *sdp); +void lock_for_admin (struct gfs2_sbd *sdp); +void cleanup_metafs (struct gfs2_sbd *sdp);/* rgrp.c */ int gfs2_compute_bitstructs (struct gfs2_sbd *sdp,struct rgrp_list *rgd);
gfs2/libgfs2/misc.c +171 -2
189 lines not on this page · raw message
gfs2/mkfs/main_grow.c +269 -195
533 lines not on this page · raw message
gfs2/mkfs/Makefile +9 -3
@@ -7,9 +7,11 @@ TARGET1= mkfs.gfs2 TARGET2= gfs2_jadd +TARGET3= gfs2_grow OBJS= main.o \ main_mkfs.o \ + main_grow.o \ main_jadd.o CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
@@ -21,7 +23,7 @@ LDFLAGS += -L${volidlibdir} -lvolume_id LDFLAGS += -L../libgfs2 -lgfs2 -all: ${TARGET1} ${TARGET2} +all: ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET1}: ${OBJS} $(CC) -o $@ $^ $(LDFLAGS)
@@ -29,16 +31,20 @@ ${TARGET2}: ${TARGET1} ln -s ${TARGET1} ${TARGET2} +${TARGET3}: ${TARGET1} + ln -s ${TARGET1} ${TARGET3} + %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< install: all install -m 0755 ${TARGET1} ${sbindir} ln -f ${sbindir}/${TARGET1} ${sbindir}/${TARGET2} + ln -f ${sbindir}/${TARGET1} ${sbindir}/${TARGET3} uninstall: - ${UNINSTALL} ${TARGET1} ${TARGET2} ${sbindir} + ${UNINSTALL} ${TARGET1} ${TARGET2} ${TARGET3} ${sbindir} clean: - rm -f *.o ${TARGET1} ${TARGET2} + rm -f *.o ${TARGET1} ${TARGET2} ${TARGET3}
gfs2/mkfs/main.c +2 -2
@@ -53,9 +53,9 @@main_jadd (argc, argv); else if (!strcmp(whoami, "gfs2_mkfs") || !strcmp(whoami, "mkfs.gfs2"))main_mkfs (argc, argv); -#if 0 -if (!strcmp (whoami,"gfs2_grow" )) + else if (!strcmp(whoami, "gfs2_grow"))main_grow (argc, argv); +#if 0 else if (!strcmp(whoami, "gfs2_shrink"))main_shrink (argc, argv);#endif
gfs2/mkfs/main_jadd.c +20 -180
262 lines not on this page · raw message
gfs2/mkfs/main_mkfs.c +7 -9
@@ -86,7 +86,7 @@int cont = TRUE;int optchar; - sdp->device_name =NULL ; +memset (sdp->device_name,0 ,sizeof (sdp->device_name)); sdp->md.journals =1 ;strcpy (sdp->lockproto,"lock_nolock" );
@@ -169,10 +169,10 @@case 1 :if (strcmp (optarg,"gfs2" ) ==0 )continue ; -if (sdp->device_name) { +if (sdp->device_name[0 ]) {die ("More than one device specified (try -h for help)" ); } - sdp->device_name = optarg; +strcpy (sdp->device_name, optarg);break ;default :
@@ -181,11 +181,10 @@ }; } -if ((sdp->device_name ==NULL ) && (optind < argc)) { - sdp->device_name = argv[optind++]; - } +if ((sdp->device_name[0 ] ==0 ) && (optind < argc)) +strcpy (sdp->device_name, argv[optind++]); -if (sdp->device_name ==NULL ) +if (sdp->device_name[0 ] =='\0' )die ("no device specified (try -h for help)\n" );if (optind < argc)
@@ -264,8 +263,7 @@die ("error identifying the contents of %s: %s\n" , sdp->device_name,strerror (errno)); -printf ("This will destroy any data on %s.\n" , - sdp->device_name); +printf ("This will destroy any data on %s.\n" , sdp->device_name);if (volume_id_probe_all (vid,0 , sdp->device_size) ==0 )printf (" It appears to contain a %s %s.\n" , vid->type, vid->usage_id ==VOLUME_ID_OTHER ?"partition" : vid->usage);
gfs2/quota/check.c +31 -29
142 lines not on this page · raw message
gfs2/quota/gfs2_quota.h +4 -6
@@ -2,7 +2,7 @@ ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. -** Copyright (C) 2004 Red Hat, Inc. All rights reserved. +** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. ** ** This copyrighted material is made available to anyone wishing to use, ** modify, copy, or redistribute it subject to the terms and conditions
@@ -98,19 +98,17 @@/* main.c */ -void check_for_gfs2 (const char *path);void do_get_super (int fd,struct gfs2_sb *sb); -void do_sync (commandline_t *comline); +void do_sync (struct gfs2_sbd *sdp,commandline_t *comline);void lock_for_admin (); -int find_gfs2_meta (const char *mnt);void mount_gfs2_meta ();void cleanup ();void read_superblock (struct gfs2_sb *sb);/* check.c */ -void do_check (commandline_t *comline); -void do_quota_init (commandline_t *comline); +void do_check (struct gfs2_sbd *sdp,commandline_t *comline); +void do_quota_init (struct gfs2_sbd *sdp,commandline_t *comline);/* names.c */
gfs2/quota/main.c +52 -195
431 lines not on this page · raw message
gfs2/tool/gfs2_tool.h +2 -1
@@ -2,7 +2,7 @@ ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. -** Copyright (C) 2004 Red Hat, Inc. All rights reserved. +** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. ** ** This copyrighted material is made available to anyone wishing to use, ** modify, copy, or redistribute it subject to the terms and conditions
@@ -95,6 +95,7 @@void check_for_gfs2 (int fd,char *path);char *get_list (void );char **str2lines (char *str); +const char *find_debugfs_mount (void );char *mp2fsname (char *mp);char *name2value (char *str,char *name);uint32_t name2u32 (char *str,char *name);