All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: David Sterba <dsterba@suse.cz>
Cc: Mike Fleetwood <mike.fleetwood@googlemail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 07/14] btrfs-progs: Print more info about device sizes
Date: Wed, 30 Apr 2014 13:39:27 +0200	[thread overview]
Message-ID: <5360E0EF.8030109@libero.it> (raw)
In-Reply-To: <CAMU1PDj3CwYJgiGG27cR+XgZvRFLxY8sAQocRavi8oT9-2Kz+Q@mail.gmail.com>

I David
thanks, to take care of these enhancements.

On 04/29/2014 09:23 PM, Mike Fleetwood wrote:
> On 29 April 2014 17:02, David Sterba <dsterba@suse.cz> wrote:
>> The entire device size may not be available to the filesystem, eg. if
>> it's modified via resize. Print this information if it can be obtained
>> from the DEV_INFO ioctl.
>>
>> Print the device ID on the same line as the device name and move size to
>> the next line.
>>
>> Sample:
>> /dev/sda7, ID: 3
>>    Device size:            10.00GiB
>>    FS occuppied:            5.00GiB
> 
> Spelling mistake.  s/occuppied/occupied/.

I found a bit unclear the "FS occupied" terms. 
Can I suggest "Resized to:" instead of "FS occupied:", and to show it only when the two values differ ? In fact this value has a meaning only if a filesystem is resized.

BR
G.Baroncelli

> 
>>    Data,RAID10:           512.00MiB
>>    Metadata,RAID10:       512.00MiB
>>    System,RAID10:           4.00MiB
>>    Unallocated:             9.00GiB
>>
>> Signed-off-by: David Sterba <dsterba@suse.cz>
>> ---
>>  cmds-device.c        |  6 +++---
>>  cmds-fi-disk_usage.c | 13 ++++++++++++-
>>  cmds-fi-disk_usage.h |  6 +++++-
>>  3 files changed, 20 insertions(+), 5 deletions(-)
>>
>> diff --git a/cmds-device.c b/cmds-device.c
>> index 7a9d808b36dd..519725f83e8c 100644
>> --- a/cmds-device.c
>> +++ b/cmds-device.c
>> @@ -447,9 +447,9 @@ static int _cmd_device_usage(int fd, char *path, int mode)
>>         }
>>
>>         for (i = 0; i < device_info_count; i++) {
>> -               printf("%s\t%10s\n", device_info_ptr[i].path,
>> -                       df_pretty_sizes(device_info_ptr[i].size, mode));
>> -
>> +               printf("%s, ID: %llu\n", device_info_ptr[i].path,
>> +                               device_info_ptr[i].devid);
>> +               print_device_sizes(fd, &device_info_ptr[i], mode);
>>                 print_device_chunks(fd, device_info_ptr[i].devid,
>>                                 device_info_ptr[i].size,
>>                                 info_ptr, info_count,
>> diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c
>> index 067c60078710..ddb064cc4c66 100644
>> --- a/cmds-fi-disk_usage.c
>> +++ b/cmds-fi-disk_usage.c
>> @@ -499,7 +499,8 @@ int load_device_info(int fd, struct device_info **device_info_ptr,
>>
>>                 info[ndevs].devid = dev_info.devid;
>>                 strcpy(info[ndevs].path, (char *)dev_info.path);
>> -               info[ndevs].size = get_partition_size((char *)dev_info.path);
>> +               info[ndevs].device_size = get_partition_size((char *)dev_info.path);
>> +               info[ndevs].size = dev_info.total_size;
>>                 ++ndevs;
>>         }
>>
>> @@ -879,5 +880,15 @@ void print_device_chunks(int fd, u64 devid, u64 total_size,
>>         printf("   Unallocated: %*s%10s\n",
>>                 (int)(20 - strlen("Unallocated")), "",
>>                 df_pretty_sizes(total_size - allocated, mode));
>> +}
>>
>> +void print_device_sizes(int fd, struct device_info *devinfo, int mode)
>> +{
>> +       printf("   Device size: %*s%10s\n",
>> +               (int)(20 - strlen("Device size")), "",
>> +               df_pretty_sizes(devinfo->device_size, mode));
>> +       printf("   FS occuppied:%*s%10s\n",
> 
> Here too.  s/occuppied/occupied/.
> 
>> +               (int)(20 - strlen("FS occupied")), "",
>> +               df_pretty_sizes(devinfo->size, mode));
>> +       }
>>  }
>> diff --git a/cmds-fi-disk_usage.h b/cmds-fi-disk_usage.h
>> index 787b4eb56acf..79cc2a115bc5 100644
>> --- a/cmds-fi-disk_usage.h
>> +++ b/cmds-fi-disk_usage.h
>> @@ -27,7 +27,10 @@ int cmd_filesystem_usage(int argc, char **argv);
>>  struct device_info {
>>         u64     devid;
>>         char    path[BTRFS_DEVICE_PATH_NAME_MAX];
>> -       u64     size;
>> +       /* Size of the block device */
>> +       u64     device_size;
>> +       /* Size that's occupied by the filesystem, can be changed via resize */
>> +       u64     size;
>>  };
>>
>>  /*
>> @@ -50,5 +53,6 @@ char *df_pretty_sizes(u64 size, int mode);
>>  void print_device_chunks(int fd, u64 devid, u64 total_size,
>>                 struct chunk_info *chunks_info_ptr,
>>                 int chunks_info_count, int mode);
>> +void print_device_sizes(int fd, struct device_info *devinfo, int mode);
>>
>>  #endif
>> --
>> 1.9.0
> 
> Same spelling mistake (occuppied) also occurs in the following patches too:
>  [PATCH 08/14] btrfs-progs: compare unallocated space against the correct value
>  [PATCH 12/14] btrfs-progs: replace df_pretty_sizes with pretty_size_mode
> 
> Thanks,
> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2014-04-30 11:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 15:56 [PATCH 00/14] Enhanced df - followup David Sterba
2014-04-29 15:57 ` [PATCH 01/14] btrfs-progs: read global reserve size from space infos David Sterba
2014-04-29 15:57 ` [PATCH 02/14] btrfs-progs: add original 'df' and rename 'disk_usage' to 'usage' David Sterba
2014-04-29 15:58 ` [PATCH 03/14] btrfs-progs: move device usage to cmds-device, more cleanups David Sterba
2014-04-29 15:58 ` [PATCH 04/14] btrfs-progs: check if we can't get info from ioctls due to permissions David Sterba
2014-04-29 16:01 ` [PATCH 05/14] btrfs-progs: zero out structures before calling ioctl David Sterba
2014-04-29 16:02 ` [PATCH 06/14] btrfs-progs: print B for bytes David Sterba
2014-04-29 16:02 ` [PATCH 07/14] btrfs-progs: Print more info about device sizes David Sterba
2014-04-29 19:23   ` Mike Fleetwood
2014-04-30 11:39     ` Goffredo Baroncelli [this message]
2014-04-30 12:11       ` David Sterba
2014-04-30 13:31         ` Frank Kingswood
2014-04-30 13:37           ` David Taylor
2014-04-30 17:38             ` Goffredo Baroncelli
2014-05-02 13:13               ` David Sterba
2014-05-02 13:15             ` David Sterba
2014-05-14 18:00           ` David Sterba
2014-04-30 11:52     ` David Sterba
2014-04-29 16:02 ` [PATCH 08/14] btrfs-progs: compare unallocated space against the correct value David Sterba
2014-04-29 16:02 ` [PATCH 09/14] btrfs-progs: add section of overall filesystem usage David Sterba
2014-04-29 16:02 ` [PATCH 10/14] btrfs-progs: cleanup filesystem/device usage code David Sterba
2014-04-29 16:02 ` [PATCH 11/14] btrfs-progs: extend pretty printers with unit mode David Sterba
2014-04-29 16:02 ` [PATCH 12/14] btrfs-progs: replace df_pretty_sizes with pretty_size_mode David Sterba
2014-04-29 16:02 ` [PATCH 13/14] btrfs-progs: clean up return codes and paths David Sterba
2014-04-29 16:03 ` [PATCH 14/14] btrfs-progs: move global reserve to overall summary David Sterba
2014-04-29 17:10 ` [PATCH 00/14] Enhanced df - followup Duncan
2014-04-29 17:17   ` Marc MERLIN
2014-04-29 17:33     ` Holger Hoffstätte
2014-04-30  0:42       ` Duncan
2014-04-30  8:15         ` Martin Steigerwald
2014-04-30 12:37           ` David Sterba
2014-04-30 13:01   ` David Sterba
2014-04-30 17:25     ` Duncan
2014-04-29 19:14 ` Mike Fleetwood
2014-04-30 12:22   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5360E0EF.8030109@libero.it \
    --to=kreijack@libero.it \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mike.fleetwood@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.