From: Artem Bityutskiy Date: Wed, 28 Nov 2012 09:35:24 +0000 (+0200) Subject: Fiemap: amend things about the default buffer size X-Git-Tag: v1.0~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8e03578ab79ad532521f7a8ee317fb8ef93154f;p=tools%2Fbmap-tools.git Fiemap: amend things about the default buffer size Introduce a constant for the default buffer size. Change the constructor interface - now None 'buf_size' means the default buffer size, which is a nicer interface. Change-Id: I1bc7dca57e9d36e4a9d6e8cc402b3f5038bcf460 Signed-off-by: Artem Bityutskiy --- diff --git a/bmaptools/Fiemap.py b/bmaptools/Fiemap.py index f0f55fa..8144903 100644 --- a/bmaptools/Fiemap.py +++ b/bmaptools/Fiemap.py @@ -29,6 +29,8 @@ _FIEMAP_IOCTL = 0xC020660B # Minimum buffer which is required for 'class Fiemap' to operate MIN_BUFFER_SIZE = _FIEMAP_SIZE + _FIEMAP_EXTENT_SIZE +# The default buffer size for 'class Fiemap' +DEFAULT_BUFFER_SIZE = 256 * 1024 class Error(Exception): """ A class for exceptions generated by this module. We currently support @@ -51,7 +53,7 @@ class Fiemap: self._f_image_needs_close = True - def __init__(self, image, buf_size = 256 * 1024): + def __init__(self, image, buf_size = DEFAULT_BUFFER_SIZE): """ Initialize a class instance. The 'image' argument is full path to the file to operate on, or a file object to operate on.