FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-07-2011, 01:05 PM
Andrew Price
 
Default mkfs.gfs2: Some minor cleanups

- The -K option isn't currently parsed, add it to the getopt option
string.
- Variable 'input' is defined but not used, remove it.
- Add back reporting of the current device contents.
- Don't call the discard blocks ioctl on regular files.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/mkfs/main_mkfs.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 6de1d12..eeff47b 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -109,7 +109,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
sdp->orig_fssize = 0;

while (cont) {
- optchar = getopt(argc, argv, "-b:chJ:j:Op:qr:t:u:VX");
+ optchar = getopt(argc, argv, "-b:chJ:j:KOp:qr:t:u:VX");

switch (optchar) {
case 'b':
@@ -325,7 +325,6 @@ static void are_you_sure(void)
static void verify_bsize(struct gfs2_sbd *sdp)
{
unsigned int x;
- char input[32];

/* Block sizes must be a power of two from 512 to 65536 */

@@ -561,8 +560,11 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}

- if (!sdp->override)
+ if (!sdp->override) {
+ printf( _("This will destroy any data on %s.
"), sdp->device_name);
+ check_dev_content(sdp->device_name);
are_you_sure();
+ }

if (!S_ISREG(st_buf.st_mode) && device_topology(sdp)) {
perror(_("Device topology error
"));
@@ -621,7 +623,7 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}

- if (discard)
+ if (!S_ISREG(st_buf.st_mode) && discard)
discard_blocks(sdp);

/* Compute the resource group layouts */
--
1.7.6.4
 
Old 11-07-2011, 01:11 PM
Steven Whitehouse
 
Default mkfs.gfs2: Some minor cleanups

Hi,

Looks good to me,

Steve.

On Mon, 2011-11-07 at 14:05 +0000, Andrew Price wrote:
> - The -K option isn't currently parsed, add it to the getopt option
> string.
> - Variable 'input' is defined but not used, remove it.
> - Add back reporting of the current device contents.
> - Don't call the discard blocks ioctl on regular files.
>
> Signed-off-by: Andrew Price <anprice@redhat.com>
> ---
> gfs2/mkfs/main_mkfs.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
> index 6de1d12..eeff47b 100644
> --- a/gfs2/mkfs/main_mkfs.c
> +++ b/gfs2/mkfs/main_mkfs.c
> @@ -109,7 +109,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
> sdp->orig_fssize = 0;
>
> while (cont) {
> - optchar = getopt(argc, argv, "-b:chJ:j:Op:qr:t:u:VX");
> + optchar = getopt(argc, argv, "-b:chJ:j:KOp:qr:t:u:VX");
>
> switch (optchar) {
> case 'b':
> @@ -325,7 +325,6 @@ static void are_you_sure(void)
> static void verify_bsize(struct gfs2_sbd *sdp)
> {
> unsigned int x;
> - char input[32];
>
> /* Block sizes must be a power of two from 512 to 65536 */
>
> @@ -561,8 +560,11 @@ void main_mkfs(int argc, char *argv[])
> exit(EXIT_FAILURE);
> }
>
> - if (!sdp->override)
> + if (!sdp->override) {
> + printf( _("This will destroy any data on %s.
"), sdp->device_name);
> + check_dev_content(sdp->device_name);
> are_you_sure();
> + }
>
> if (!S_ISREG(st_buf.st_mode) && device_topology(sdp)) {
> perror(_("Device topology error
"));
> @@ -621,7 +623,7 @@ void main_mkfs(int argc, char *argv[])
> exit(EXIT_FAILURE);
> }
>
> - if (discard)
> + if (!S_ISREG(st_buf.st_mode) && discard)
> discard_blocks(sdp);
>
> /* Compute the resource group layouts */
 

Thread Tools




All times are GMT. The time now is 04:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org