Esempio n. 1
0
void request_send(struct fuse_conn *fc, struct fuse_in *in,
		  struct fuse_out *out)
{
	struct fuse_req *req;

	out->h.error = -ERESTARTSYS;
	if(down_interruptible(&fc->outstanding))
		return;

	out->h.error = -ENOMEM;
	req = request_new();
	if(!req)
		return;

	req->in = in;
	req->out = out;
	req->issync = 1;

	spin_lock(&fuse_lock);
	out->h.error = -ENOTCONN;
	if(fc->file) {
		in->h.unique = get_unique(fc);		
		list_add_tail(&req->list, &fc->pending);
		wake_up(&fc->waitq);
		request_wait_answer(req);
		list_del(&req->list);
	}
	spin_unlock(&fuse_lock);
	request_free(req);

	up(&fc->outstanding);
}
static g_val_t user_metric_handler ( int metric_index )
{
    g_val_t val;

    /* The metric_index corresponds to the order in which
       the metrics appear in the metric_info array
    */
    switch (metric_index) {
    case 0:
        val.uint32 = get_users();
        return val;
    case 1:
        val.uint32 = get_unique();
        return val;
    }

    /* default case */
    val.uint32 = 0;
    return val;
}
Esempio n. 3
0
 static unique_cube<T> get_unique_crop( const cube<T>& c, const vec3s& s )
 {
     unique_cube<T> ret = get_unique(s);
     *ret = c.subcube(0,0,0,s[0]-1,s[1]-1,s[2]-1);
     return ret;
 }
Esempio n. 4
0
 static unique_cube<T> get_unique_copy( const cube<T>& c )
 {
     unique_cube<T> ret = get_unique( c.n_rows, c.n_cols, c.n_slices );
     *ret = c;
     return ret;
 }
Esempio n. 5
0
 static unique_cube<T> get_unique_zero( const vec3s& s )
 {
     unique_cube<T> ret = get_unique(s);
     ret->fill(0);
     return ret;
 }