Doubt about function src/lib/edit.c - size_to_uint64

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Doubt about function src/lib/edit.c - size_to_uint64

Wanderlei Huttel
There is some limitation in the function " size_to_uint64" for not allowing terabyte unit? 
If not, could be included in the next release?

/*
 * Convert a size in bytes to uint64_t
 * Returns false: if error
           true:  if OK, and value stored in value
 */
bool size_to_uint64(char *str, int str_len, uint64_t *value)
{
   /* first item * not used */
   static const char *mod[]  = {"*", "k", "kb", "m", "mb",  "g", "gb",  NULL};
   return strunit_to_uint64(str, str_len, value, mod);
}

Best Regards

Wanderlei Hüttel

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about function src/lib/edit.c - size_to_uint64

Kern Sibbald
No, there is no limitation.  It was just not implemented (maybe at that time terabytes were not very common).  It is a reasonable thing to add to Bacula, but it would be nice if someone were to submit a patch, which is a bit more than simply adding a new entry in the *mod[] list.

Best regards,
Kern

On 05/12/2016 03:00 AM, Wanderlei Huttel wrote:
There is some limitation in the function " size_to_uint64" for not allowing terabyte unit? 
If not, could be included in the next release?

/*
 * Convert a size in bytes to uint64_t
 * Returns false: if error
           true:  if OK, and value stored in value
 */
bool size_to_uint64(char *str, int str_len, uint64_t *value)
{
   /* first item * not used */
   static const char *mod[]  = {"*", "k", "kb", "m", "mb",  "g", "gb",  NULL};
   return strunit_to_uint64(str, str_len, value, mod);
}

Best Regards

Wanderlei Hüttel


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j


_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about function src/lib/edit.c - size_to_uint64

Dan Langille
Is this perhaps related?

On 7.4.0 I get this from a status storage:

Device file: "Restore-Drive" (/usr/local/bacula/volumes) is not open.
    Available Space=1.578 PB
==

I do not have PB of space on this system.  Perhaps 5.6TB.

-- 
Dan Langille - BSDCan / PGCon




On May 12, 2016, at 4:48 AM, Kern Sibbald <[hidden email]> wrote:

No, there is no limitation.  It was just not implemented (maybe at that time terabytes were not very common).  It is a reasonable thing to add to Bacula, but it would be nice if someone were to submit a patch, which is a bit more than simply adding a new entry in the *mod[] list.

Best regards,
Kern

On 05/12/2016 03:00 AM, Wanderlei Huttel wrote:
There is some limitation in the function " size_to_uint64" for not allowing terabyte unit? 
If not, could be included in the next release?

/*
 * Convert a size in bytes to uint64_t
 * Returns false: if error
           true:  if OK, and value stored in value
 */
bool size_to_uint64(char *str, int str_len, uint64_t *value)
{
   /* first item * not used */
   static const char *mod[]  = {"*", "k", "kb", "m", "mb",  "g", "gb",  NULL};
   return strunit_to_uint64(str, str_len, value, mod);
}

Best Regards

Wanderlei Hüttel


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j


_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-devel