Re: How to use the class Filer in Ceph

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I haven't looked at the Filer code (or anything around it) in a while,
but if I were to guess, "in->snapid" is set to something which doesn't
exist.

Are you actually using the Filer in some new code that includes
inodes, or modifying the Client classes? Looking at how they
initialize things should help you through this.
Also, you could turn on messenger debugging to see exactly what your
program is sending to the OSDs and check if that looks right (and, if
necessary, turn on OSD debugging and see what's making it decide
ENOENT).
-Greg
Software Engineer #42 @ http://inktank.com | http://ceph.com


On Thu, Nov 21, 2013 at 9:30 PM, Luo Shaobo (DSI)
<luosb@xxxxxxxxxxxxxxxxx> wrote:
> Dear All,
>
>    Currently, I’m using the class Filer to operate the OSD directly. And below list the codes.
> The write_trunc routing return success, but I can’t read back the object, and I got r = -2,  -ENOENT.
> Would anyone help me to answer the question that how to use those functions?  Thanks!
>
> The input parameters are:
> in->ino = 0x10000000035;
> In->layout.fl_stripe_unit = stripe_unit = 4194304;
> In->layout.fl_stripe_count = stripe_count = 1;
> In->layout.fl_object_size = object_size = 4194304;
> In->layout.fl_pg_pool = 0;
> in->snaprealm = new SnapRealm(in->ino);
> in->snaprealm->build_snap_context();
>
> The writing code looks like this.
>     Mutex flock("MClient::_write flock");
>     Cond cond;
>     bool done = false;
>     Context *onfinish = new C_SafeCond(&flock, &cond, &done);
>     Context *onsafe = new C_Client_SyncCommit(this, in);
>
>     unsafe_sync_write++;
>     get_cap_ref(in, CEPH_CAP_FILE_BUFFER);  // released by onsafe callback
>
>     r = filer->write_trunc(in->ino, &in->layout, in->snaprealm->get_snap_context(),
>                                                    offset, size, bl, ceph_clock_now(cct), 0,
>                                                    in->truncate_size, in->truncate_seq,
>                                                    onfinish, onsafe);
>     if (r < 0)
>       goto done;
>
>     client_lock.Unlock();
>     flock.Lock();
>     while (!done)
>       cond.Wait(flock);
>  flock.Unlock();
>
> The reading code looks like this.
>
> Mutex flock("MClient::_read_sync flock");
> bool done = false;
>     Context *onfinish = new C_SafeCond(&flock, &cond, &done, &r);
>     bufferlist tbl;
>
>     int wanted = left;
>     filer->read_trunc(in->ino, &in->layout, in->snapid,
>                                       pos, left, &tbl, 0,
>                                       in->truncate_size, in->truncate_seq,
>                                       onfinish);
>     client_lock.Unlock();
>     flock.Lock();
>     while (!done)
>       cond.Wait(flock);
>  flock.Unlock();
>
> Thomas
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux