All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ceph: update atime after read-operation.
@ 2013-07-02  5:45 ` majianpeng
  0 siblings, 0 replies; 3+ messages in thread
From: majianpeng @ 2013-07-02  5:45 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel, linux-kernel

Now ceph don't support updating atime after read-operation if the open
mode is CEPH_CAP_FILE_RD.There are two reasons:
1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD.
2:in mds,it only update the atime if the condition
"dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true.
But if we can read, we can update atime. This patch only modify client to
support.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 fs/ceph/file.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 87df15a..9daea70 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -672,6 +672,15 @@ again:
 out:
 	dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
 	     inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
+
+	if (ret >= 0) {
+		int dirty;
+		spin_lock(&ci->i_ceph_lock);
+		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD);
+		spin_unlock(&ci->i_ceph_lock);
+		if (dirty)
+			__mark_inode_dirty(inode, dirty);
+	}
 	ceph_put_cap_refs(ci, got);
 
 	if (checkeof && ret >= 0) {
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] ceph: update atime after read-operation.
@ 2013-07-02  5:45 ` majianpeng
  0 siblings, 0 replies; 3+ messages in thread
From: majianpeng @ 2013-07-02  5:45 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1217 bytes --]

Now ceph don't support updating atime after read-operation if the open
mode is CEPH_CAP_FILE_RD.There are two reasons:
1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD.
2:in mds,it only update the atime if the condition
"dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true.
But if we can read, we can update atime. This patch only modify client to
support.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 fs/ceph/file.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 87df15a..9daea70 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -672,6 +672,15 @@ again:
 out:
 	dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
 	     inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
+
+	if (ret >= 0) {
+		int dirty;
+		spin_lock(&ci->i_ceph_lock);
+		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD);
+		spin_unlock(&ci->i_ceph_lock);
+		if (dirty)
+			__mark_inode_dirty(inode, dirty);
+	}
 	ceph_put_cap_refs(ci, got);
 
 	if (checkeof && ret >= 0) {
-- 
1.8.1.2
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/3] ceph: update atime after read-operation.
  2013-07-02  5:45 ` majianpeng
  (?)
@ 2013-07-02 16:49 ` Sage Weil
  -1 siblings, 0 replies; 3+ messages in thread
From: Sage Weil @ 2013-07-02 16:49 UTC (permalink / raw)
  To: majianpeng; +Cc: ceph-devel, linux-kernel

On Tue, 2 Jul 2013, majianpeng wrote:
> Now ceph don't support updating atime after read-operation if the open
> mode is CEPH_CAP_FILE_RD.There are two reasons:
> 1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD.
> 2:in mds,it only update the atime if the condition
> "dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true.
> But if we can read, we can update atime. This patch only modify client to
> support.

Do we awnt to update atime if ret == 0?

Otherwise looks good.  Please make the changelog only describe the kernel 
change (in this patch) and not the MDS changes.

sage

> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  fs/ceph/file.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index 87df15a..9daea70 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -672,6 +672,15 @@ again:
>  out:
>  	dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
>  	     inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
> +
> +	if (ret >= 0) {
> +		int dirty;
> +		spin_lock(&ci->i_ceph_lock);
> +		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD);
> +		spin_unlock(&ci->i_ceph_lock);
> +		if (dirty)
> +			__mark_inode_dirty(inode, dirty);
> +	}
>  	ceph_put_cap_refs(ci, got);
>  
>  	if (checkeof && ret >= 0) {
> -- 
> 1.8.1.2
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-02 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02  5:45 [PATCH 2/3] ceph: update atime after read-operation majianpeng
2013-07-02  5:45 ` majianpeng
2013-07-02 16:49 ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.