diff options
| author | Anand V. Avati <avati@blackhole.gluster.com> | 2009-10-16 07:30:23 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-16 06:22:10 -0700 | 
| commit | cb76cadb74a36e220a2b6a886c0c8068abdad0c7 (patch) | |
| tree | 16136a771cda80b982018c2cf09249307c05d7ee /xlators/cluster/dht/src/dht-helper.c | |
| parent | fa4e9d639b95b557ae64dab38c4c3ff8a0ec0d7a (diff) | |
distribute,nufa: layout handling changes
changes to make revalidate not fail but instead perform fresh lookup
and swap inode context (layout) safely
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 315 (generation number support)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/cluster/dht/src/dht-helper.c')
| -rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 21 | 
1 files changed, 18 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 3ef528ff2e4..1b49046ce19 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -108,7 +108,7 @@ dht_deitransform (xlator_t *this, uint64_t y, xlator_t **subvol_p,  void -dht_local_wipe (dht_local_t *local) +dht_local_wipe (xlator_t *this, dht_local_t *local)  {  	if (!local)  		return; @@ -122,8 +122,10 @@ dht_local_wipe (dht_local_t *local)  	if (local->inode)  		inode_unref (local->inode); -	if (local->layout) -		FREE (local->layout); +	if (local->layout) { +		dht_layout_unref (this, local->layout); +                local->layout = NULL; +        }  	loc_wipe (&local->linkfile.loc); @@ -141,6 +143,11 @@ dht_local_wipe (dht_local_t *local)  	if (local->xattr_req)  		dict_unref (local->xattr_req); +        if (local->selfheal.layout) { +                dht_layout_unref (this, local->selfheal.layout); +                local->selfheal.layout = NULL; +        } +  	FREE (local);  } @@ -230,6 +237,10 @@ dht_subvol_get_hashed (xlator_t *this, loc_t *loc)          }  out: +        if (layout) { +                dht_layout_unref (this, layout); +        } +          return subvol;  } @@ -250,6 +261,10 @@ dht_subvol_get_cached (xlator_t *this, inode_t *inode)  	subvol = layout->list[0].xlator;  out: +        if (layout) { +                dht_layout_unref (this, layout); +        } +          return subvol;  }  | 
