summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-11-14 08:41:55 -0500
committerIlya Dryomov <idryomov@redhat.com>2014-12-17 12:09:52 -0500
commit31c542a199d79f0f402c2f3e04229464510d47ec (patch)
treefa28ee0ee2f288f334cd141146eb79cbd1b693ce /fs/ceph/caps.c
parentfb01d1f8b0343f1b19be878cee89d089f06e9f38 (diff)
ceph: add inline data to pagecache
Request reply and cap message can contain inline data. add inline data to the page cache if there is Fc cap. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index b88ae601f309..6372eb9ce491 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2405,6 +2405,7 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc,
2405 bool queue_invalidate = false; 2405 bool queue_invalidate = false;
2406 bool queue_revalidate = false; 2406 bool queue_revalidate = false;
2407 bool deleted_inode = false; 2407 bool deleted_inode = false;
2408 bool fill_inline = false;
2408 2409
2409 dout("handle_cap_grant inode %p cap %p mds%d seq %d %s\n", 2410 dout("handle_cap_grant inode %p cap %p mds%d seq %d %s\n",
2410 inode, cap, mds, seq, ceph_cap_string(newcaps)); 2411 inode, cap, mds, seq, ceph_cap_string(newcaps));
@@ -2578,6 +2579,13 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc,
2578 } 2579 }
2579 BUG_ON(cap->issued & ~cap->implemented); 2580 BUG_ON(cap->issued & ~cap->implemented);
2580 2581
2582 if (inline_version > 0 && inline_version >= ci->i_inline_version) {
2583 ci->i_inline_version = inline_version;
2584 if (ci->i_inline_version != CEPH_INLINE_NONE &&
2585 (newcaps & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)))
2586 fill_inline = true;
2587 }
2588
2581 spin_unlock(&ci->i_ceph_lock); 2589 spin_unlock(&ci->i_ceph_lock);
2582 2590
2583 if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) { 2591 if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) {
@@ -2591,6 +2599,9 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc,
2591 wake = true; 2599 wake = true;
2592 } 2600 }
2593 2601
2602 if (fill_inline)
2603 ceph_fill_inline_data(inode, NULL, inline_data, inline_len);
2604
2594 if (queue_trunc) { 2605 if (queue_trunc) {
2595 ceph_queue_vmtruncate(inode); 2606 ceph_queue_vmtruncate(inode);
2596 ceph_queue_revalidate(inode); 2607 ceph_queue_revalidate(inode);