src/dbfs/fileop.c
changeset 36 56427f22e969
parent 35 4f10421681d2
child 40 03017f5f0087
equal deleted inserted replaced
35:4f10421681d2 36:56427f22e969
    39 
    39 
    40     // is it a dir?
    40     // is it a dir?
    41     if (_dbfs_mode(type) != S_IFREG)
    41     if (_dbfs_mode(type) != S_IFREG)
    42         EERROR(err = EINVAL, "wrong type: %s", type);
    42         EERROR(err = EINVAL, "wrong type: %s", type);
    43     
    43     
    44     INFO("[dbfs.open %p:%p] -> ino=%lu, type=%s", fop, fop->base.req, (unsigned long int) fop->base.ino, type);
    44     INFO("\t[dbfs.open %p:%p] -> ino=%lu, type=%s", fop, fop->base.req, (unsigned long int) fop->base.ino, type);
    45     
    45     
    46     // open_fn done, do the open_reply
    46     // open_fn done, do the open_reply
    47     if ((err = dbfs_op_open_reply(&fop->base)))
    47     if ((err = dbfs_op_open_reply(&fop->base)))
    48         goto error;
    48         goto error;
    49 
    49 
   140         
   140         
   141     // get the data
   141     // get the data
   142     if (evsql_result_binary(res, 0, 0, &buf, &size, 0))
   142     if (evsql_result_binary(res, 0, 0, &buf, &size, 0))
   143         SERROR(err = EIO);
   143         SERROR(err = EIO);
   144 
   144 
   145     INFO("[dbfs.read %p:%p] -> size=%zu", fop, fop->base.req, size);
   145     INFO("\t[dbfs.read %p:%p] -> size=%zu", fop, fop->base.req, size);
   146         
   146         
   147     // send it
   147     // send it
   148     if ((err = fuse_reply_buf(fop->base.req, buf, size)))
   148     if ((err = fuse_reply_buf(fop->base.req, buf, size)))
   149         EERROR(err, "fuse_reply_buf");
   149         EERROR(err, "fuse_reply_buf");
   150     
   150     
   219         
   219         
   220     // get the size
   220     // get the size
   221     if (evsql_result_uint32(res, 0, 0, &size, 0))
   221     if (evsql_result_uint32(res, 0, 0, &size, 0))
   222         SERROR(err = EIO);
   222         SERROR(err = EIO);
   223 
   223 
   224     INFO("[dbfs.write %p:%p] -> size=%lu", fop, fop->base.req, (long unsigned int) size);
   224     INFO("\t[dbfs.write %p:%p] -> size=%lu", fop, fop->base.req, (long unsigned int) size);
   225         
   225         
   226     // send it
   226     // send it
   227     if ((err = fuse_reply_write(fop->base.req, size)))
   227     if ((err = fuse_reply_write(fop->base.req, size)))
   228         EERROR(err, "fuse_reply_write");
   228         EERROR(err, "fuse_reply_write");
   229     
   229