63
66
dht_layout_get (xlator_t *this, inode_t *inode)
68
ret = inode_ctx_get (inode, this, &layout);
70
return (dht_layout_t *)(long)layout;
68
dht_conf_t *conf = NULL;
69
uint64_t layout_int = 0;
70
dht_layout_t *layout = NULL;
74
LOCK (&conf->layout_lock);
76
ret = inode_ctx_get (inode, this, &layout_int);
78
layout = (dht_layout_t *) (unsigned long) layout_int;
82
UNLOCK (&conf->layout_lock);
89
dht_layout_set (xlator_t *this, inode_t *inode, dht_layout_t *layout)
91
dht_conf_t *conf = NULL;
94
dht_layout_t *old_layout;
95
uint64_t old_layout_int;
98
LOCK (&conf->layout_lock);
100
oldret = inode_ctx_get (inode, this, &old_layout_int);
103
ret = inode_ctx_put (inode, this, (uint64_t) (unsigned long)
106
UNLOCK (&conf->layout_lock);
109
old_layout = (dht_layout_t *) (unsigned long) old_layout_int;
110
dht_layout_unref (this, old_layout);
118
dht_layout_unref (xlator_t *this, dht_layout_t *layout)
120
dht_conf_t *conf = NULL;
126
conf = this->private;
127
LOCK (&conf->layout_lock);
131
UNLOCK (&conf->layout_lock);
139
dht_layout_ref (xlator_t *this, dht_layout_t *layout)
141
dht_conf_t *conf = NULL;
146
conf = this->private;
147
LOCK (&conf->layout_lock);
151
UNLOCK (&conf->layout_lock);
602
dht_layout_inode_set (xlator_t *this, xlator_t *subvol, inode_t *inode)
685
dht_layout_preset (xlator_t *this, xlator_t *subvol, inode_t *inode)
604
687
dht_layout_t *layout = NULL;
689
dht_conf_t *conf = NULL;
691
conf = this->private;
607
693
layout = dht_layout_for_subvol (this, subvol);
616
inode_ctx_put (inode, this, (uint64_t)(long)layout);
702
LOCK (&conf->layout_lock);
704
inode_ctx_put (inode, this, (uint64_t)(long)layout);
706
UNLOCK (&conf->layout_lock);