while (t.have_op()) {
int op = t.get_op();
switch (op) {
+ case Transaction::OP_TOUCH:
+ {
+ coll_t cid;
+ t.get_cid(cid);
+ pobject_t oid;
+ t.get_oid(oid);
+ _touch(cid, oid);
+ }
+ break;
+
case Transaction::OP_WRITE:
{
coll_t cid;
}
+int FileStore::_touch(coll_t cid, pobject_t oid)
+{
+ char fn[200];
+ get_coname(cid, oid, fn);
+
+ dout(20) << "touch " << fn << dendl;
+
+ int flags = O_WRONLY|O_CREAT;
+ int fd = ::open(fn, flags, 0644);
+ if (fd >= 0) {
+ ::close(fd);
+ return 0;
+ } else
+ return -errno;
+}
+
int FileStore::_write(coll_t cid, pobject_t oid,
__u64 offset, size_t len,
const bufferlist& bl)
int stat(coll_t cid, pobject_t oid, struct stat *st);
int read(coll_t cid, pobject_t oid, __u64 offset, size_t len, bufferlist& bl);
- int _remove(coll_t cid, pobject_t oid);
- int _truncate(coll_t cid, pobject_t oid, __u64 size);
+ int _touch(coll_t cid, pobject_t oid);
int _write(coll_t cid, pobject_t oid, __u64 offset, size_t len, const bufferlist& bl);
int _zero(coll_t cid, pobject_t oid, __u64 offset, size_t len);
+ int _truncate(coll_t cid, pobject_t oid, __u64 size);
int _clone(coll_t cid, pobject_t oldoid, pobject_t newoid);
int _clone_range(coll_t cid, pobject_t oldoid, pobject_t newoid, __u64 off, __u64 len);
int _do_clone_range(int from, int to, __u64 off, __u64 len);
+ int _remove(coll_t cid, pobject_t oid);
void sync();
void sync(Context *onsafe);