MCPcopy Create free account
hub / github.com/ceph/ceph / write

Method write

qa/tasks/cephfs/test_data_scan.py:342–365  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

340 ]
341
342 def write(self):
343 # Create a dir with a striped layout set on it
344 self._mount.run_shell(["mkdir", "stripey"])
345
346 self._mount.setfattr("./stripey", "ceph.dir.layout",
347 "stripe_unit={ss} stripe_count={sc} object_size={os} pool={pool}".format(
348 ss=self.ss, os=self.os, sc=self.sc, pool=self.pool
349 ))
350
351 # Write files, then flush metadata so that its layout gets written into an xattr
352 for i, n_bytes in enumerate(self.interesting_sizes):
353 self._mount.write_test_pattern("stripey/flushed_file_{0}".format(i), n_bytes)
354 # This is really just validating the validator
355 self._mount.validate_test_pattern("stripey/flushed_file_{0}".format(i), n_bytes)
356 self._filesystem.mds_asok(["flush", "journal"])
357
358 # Write another file in the same way, but this time don't flush the metadata,
359 # so that it won't have the layout xattr
360 self._mount.write_test_pattern("stripey/unflushed_file", 1024 * 512)
361 self._mount.validate_test_pattern("stripey/unflushed_file", 1024 * 512)
362
363 self._initial_state = {
364 "unflushed_ino": self._mount.path_to_ino("stripey/unflushed_file")
365 }
366
367 def flush(self):
368 # Pass because we already selectively flushed during write

Callers

nothing calls this directly

Calls 7

run_shellMethod · 0.80
setfattrMethod · 0.80
write_test_patternMethod · 0.80
validate_test_patternMethod · 0.80
mds_asokMethod · 0.80
path_to_inoMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected