[OpenAFS] Setting quotas with interesting numbers

Derrick Brashear shadow@gmail.com
Thu, 22 Sep 2011 19:28:20 -0400


On Thu, Sep 22, 2011 at 3:30 PM, Steve Simmons <scs@umich.edu> wrote:
> I've been working on a patch to AFS so that one could add scales to numbe=
rs. The primary goal is to be able to do things like
>
> =A0 $ fs setq . 1g

commit 54c0a3f3e6575fa5af39ddd797d5381c36b48001
Author: Evan Broder <broder@mit.edu>
Date:   Wed Mar 25 18:18:09 2009 -0500

    Allow passing in human-readable units for specifying amounts of space

    Add a util_GetHumanInt32 function for parsing numbers human-readable
    units using single-character, uppercase suffixes for indicating orders
    of magnitude (e.g. 'M', 'G').

    Use this function to parse human readable values for all arguments
    that previously accepted a value in kilobytes: fs setquota, fs
    setcachesize, vos setfields, and vos create.

    Reviewed-on: http://gerrit.openafs.org/66

?

> and get a gigabyte quota. For we who use powers of 1024, that's a helluva=
 lot easier than
>
> =A0 $ fs setq . 1048576
>
> Especially when setting, say, 23g quotas. What, you don't have 23g =3D=3D=
 24117248 memorized? :-) While doing this I stumbled across a feature and a=
 possible bug in the fs setq command.
>
> The feature is that 'fs setq' and maybe other things accept well-formed o=
ctal and hexadecimal numbers. Thus you can set a 1 gigabyte quota with any =
of these:
>
> =A0 $ fs setq . 0x100000
> =A0 $ fs setq . 04000000
> =A0 $ fs setq . 1048576
>
> And yes, negative quotas can be expressed in octal and hex.
>
> Ya learn something new every day.
>
> Steve_______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info
>



--=20
Derrick