0a26bb20b1
As it happens, diskfile.read_metadata() and diskfile.write_metadata() can take either an open file or a filename as their first arguments (since xattr.[get|set]xattr() can), so we can clean up a couple places where we were opening a file just to call read_metadata() or write_metadata() on it. This results in 2 fewer system calls. Example strace output: /* read_metadata(filename) */ getxattr("/mnt/sdb1/1/node/sdb1/afile", "user.some.key", 0x0, 0) = 10 getxattr("/mnt/sdb1/1/node/sdb1/afile", "user.some.key", "some-value", 10) = 10 /* fp = open(filename); read_metadata(fp) */ open("/mnt/sdb1/1/node/sdb1/afile", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 fgetxattr(4, "user.some.key", 0x0, 0) = 10 fgetxattr(4, "user.some.key", "some-value", 10) = 10 Change-Id: I321d8663b9e9e47b8f3ee6c21a1b65b408bb80e6 |
||
---|---|---|
.. | ||
__init__.py | ||
common.py | ||
test_account_failures.py | ||
test_account_get_fake_responses_match.py | ||
test_container_failures.py | ||
test_empty_device_handoff.py | ||
test_object_async_update.py | ||
test_object_failures.py | ||
test_object_handoff.py | ||
test_replication_servers_working.py |