diff mbox

[10/12] SQUASHME: pnfs-obj: objlayout wants to cache devices until unmount

Message ID 1306249685-23453-1-git-send-email-bharrosh@panasas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boaz Harrosh May 24, 2011, 3:08 p.m. UTC
Take an extra reference on a device insert. So devices keep
around in the cache until nfs_client release.
(This was the behavior of the old cache)

The extra reference will be removed in nfs4_deviceid_purge_client().
I tested this and it works perfectly.

TODO: Define an nfs4_get_deviceid()
 Currently accesing did->ref directly

TODO: nfs4_insert_deviceid_node should check if there are too many
      devices and start purging them. Say by time from last use.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/objlayout/objio_osd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Benny Halevy May 24, 2011, 5:17 p.m. UTC | #1
On 2011-05-24 18:08, Boaz Harrosh wrote:
> Take an extra reference on a device insert. So devices keep
> around in the cache until nfs_client release.
> (This was the behavior of the old cache)
> 
> The extra reference will be removed in nfs4_deviceid_purge_client().
> I tested this and it works perfectly.
> 
> TODO: Define an nfs4_get_deviceid()
>  Currently accesing did->ref directly

This is the right time to do it, why wait?

> 
> TODO: nfs4_insert_deviceid_node should check if there are too many
>       devices and start purging them. Say by time from last use.

yeah, an lru list would be helpful to prune the lists and get rid
of unused devices.  As we discussed before, this can be done
periodically, and all devices not used for a long enough interval can
be deleted.

Benny

> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  fs/nfs/objlayout/objio_osd.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
> index faacde2..8b05b16 100644
> --- a/fs/nfs/objlayout/objio_osd.c
> +++ b/fs/nfs/objlayout/objio_osd.c
> @@ -104,6 +104,7 @@ _dev_list_add(const struct nfs_server *nfss,
>  		de = n;
>  	}
>  
> +	atomic_inc(&de->id_node.ref);
>  	return de;
>  }
>  

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index faacde2..8b05b16 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -104,6 +104,7 @@  _dev_list_add(const struct nfs_server *nfss,
 		de = n;
 	}
 
+	atomic_inc(&de->id_node.ref);
 	return de;
 }