)]}'
{"swift/common/utils.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f48313963574e81e061bcbef64c42239f115dbf0","unresolved":false,"context_lines":[{"line_number":785,"context_line":"        free_percent \u003d float(free_bytes) / float(size_bytes) * 100"},{"line_number":786,"context_line":"        return free_percent \u003e\u003d space_needed"},{"line_number":787,"context_line":"    else:"},{"line_number":788,"context_line":"        return free_bytes \u003e\u003d space_needed"},{"line_number":789,"context_line":""},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"class FallocateWrapper(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0ef1f196","line":788,"updated":"2018-07-02 04:30:49.000000000","message":"So this function obviously works differently then fallocate, as mentioned. In fallocate it\u0027ll have the size of the object then make sure the `fallocate_reserve` left after taking that value/size into account.\n\nAs this method is currently used it just checks to see if there is at least `fallocate_reserve` left, before allowing a PUT, POST or REPLICATE into a db server. \nI understand we don\u0027t know how much data is coming in. And honestly with a container/account POST or PUT especially one with an object there isn\u0027t that much data. REPLICATE on the other hand could be larger then the 1%.\n\nSo the way we\u0027re currently using this it seems to be more of a soft reserve and so quite different from object fallocate. I\u0027m not against it per say, I can\u0027t think of anything better, unless we can send a guessdomation of bytes. Maybe we just need to be more clear in the docs.","commit_id":"babe32f5cf33d188038088ab34530e71aa586251"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f48313963574e81e061bcbef64c42239f115dbf0","unresolved":false,"context_lines":[{"line_number":6698,"context_line":"        with mock.patch(\u0027os.statvfs\u0027, return_value\u003dfake_result):"},{"line_number":6699,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 0, False))"},{"line_number":6700,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 1, False))"},{"line_number":6701,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 7078252544, False))"},{"line_number":6702,"context_line":"            self.assertFalse(utils.fs_has_free_space(\"/\", 7078252545, False))"},{"line_number":6703,"context_line":"            self.assertFalse(utils.fs_has_free_space(\"/\", 2 ** 64, False))"},{"line_number":6704,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_6e750500","line":6701,"range":{"start_line":6701,"start_character":57,"end_line":6701,"end_character":67},"updated":"2018-07-02 04:30:49.000000000","message":"To make this easier for reviewers, not that the maths is hard, but maybe a comment just before this line like:\n\n  # free space left \u003d f_bavail * f_bsize \u003d 7078252544","commit_id":"babe32f5cf33d188038088ab34530e71aa586251"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f48313963574e81e061bcbef64c42239f115dbf0","unresolved":false,"context_lines":[{"line_number":6718,"context_line":"        with mock.patch(\u0027os.statvfs\u0027, return_value\u003dfake_result):"},{"line_number":6719,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 0, True))"},{"line_number":6720,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 1, True))"},{"line_number":6721,"context_line":"            self.assertTrue(utils.fs_has_free_space(\"/\", 60, True))"},{"line_number":6722,"context_line":"            self.assertFalse(utils.fs_has_free_space(\"/\", 61, True))"},{"line_number":6723,"context_line":"            self.assertFalse(utils.fs_has_free_space(\"/\", 100, True))"},{"line_number":6724,"context_line":"            self.assertFalse(utils.fs_has_free_space(\"/\", 110, True))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0e64914c","line":6721,"range":{"start_line":6721,"start_character":57,"end_line":6721,"end_character":59},"updated":"2018-07-02 04:30:49.000000000","message":"Same this this, or even just mention that there is 60% of free space specified by the stat.\n\n  # percentage of free space for the faked statvfs is 60%","commit_id":"babe32f5cf33d188038088ab34530e71aa586251"}]}
