]> git.notmuchmail.org Git - notmuch/blob - test/corpora/lkml/cur/1382298587.001738:2,
Import notmuch_0.28.2.orig.tar.gz
[notmuch] / test / corpora / lkml / cur / 1382298587.001738:2,
1 From: Suresh Jayaraman <sjayaraman@suse.de>
2 Subject: [RFC][PATCH 08/10] cifs: store pages into local cache
3 Date: Tue, 22 Jun 2010 20:54:00 +0530
4 Lines: 102
5 Message-ID: <1277220240-3674-1-git-send-email-sjayaraman@suse.de>
6 References: <yes>
7 Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
8         linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>
9 To: Steve French <smfrench@gmail.com>
10 X-From: linux-fsdevel-owner@vger.kernel.org Tue Jun 22 17:45:09 2010
11 Return-path: <linux-fsdevel-owner@vger.kernel.org>
12 Envelope-to: lnx-linux-fsdevel@lo.gmane.org
13 Received: from vger.kernel.org ([209.132.180.67])
14         by lo.gmane.org with esmtp (Exim 4.69)
15         (envelope-from <linux-fsdevel-owner@vger.kernel.org>)
16         id 1OR5ev-00007O-6e
17         for lnx-linux-fsdevel@lo.gmane.org; Tue, 22 Jun 2010 17:45:09 +0200
18 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
19         id S1755015Ab0FVPon (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>);
20         Tue, 22 Jun 2010 11:44:43 -0400
21 Received: from victor.provo.novell.com ([137.65.250.26]:58250 "EHLO
22         victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
23         with ESMTP id S1751265Ab0FVPok (ORCPT
24         <rfc822;groupwise-SJayaraman@novell.com:0:0>);
25         Tue, 22 Jun 2010 11:44:40 -0400
26 Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240])
27         by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:24:02 -0600
28 X-Mailer: git-send-email 1.6.4.2
29 In-Reply-To: <yes>
30 Sender: linux-fsdevel-owner@vger.kernel.org
31 Precedence: bulk
32 List-ID: <linux-fsdevel.vger.kernel.org>
33 X-Mailing-List: linux-fsdevel@vger.kernel.org
34 Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001764>
35
36 Store pages from an CIFS inode into the data storage object associated with
37 that inode.
38
39 Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
40 ---
41  fs/cifs/file.c    |    6 ++++++
42  fs/cifs/fscache.c |   13 +++++++++++++
43  fs/cifs/fscache.h |   11 +++++++++++
44  3 files changed, 30 insertions(+), 0 deletions(-)
45
46 diff --git a/fs/cifs/file.c b/fs/cifs/file.c
47 index 786ec04..39c1ce0 100644
48 --- a/fs/cifs/file.c
49 +++ b/fs/cifs/file.c
50 @@ -2060,6 +2060,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
51                                    we will hit it on next read */
52  
53                                 /* break; */
54 +                               /* send this page to FS-Cache */
55 +                               cifs_readpage_to_fscache(mapping->host, page);
56                         }
57                 } else {
58                         cFYI(1, "No bytes read (%d) at offset %lld . "
59 @@ -2117,6 +2119,10 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
60  
61         flush_dcache_page(page);
62         SetPageUptodate(page);
63 +
64 +       /* send this page to the cache */
65 +       cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page);
66 +
67         rc = 0;
68  
69  io_error:
70 diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c
71 index c09d3b8..13e47d5 100644
72 --- a/fs/cifs/fscache.c
73 +++ b/fs/cifs/fscache.c
74 @@ -145,6 +145,19 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
75         return 1;
76  }
77  
78 +void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
79 +{
80 +       int ret;
81 +
82 +       cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p\n",
83 +                       CIFS_I(inode)->fscache, page, inode);
84 +       ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
85 +       cFYI(1, "CIFS: fscache_write_page returned %d\n", ret);
86 +
87 +       if (ret != 0)
88 +               fscache_uncache_page(CIFS_I(inode)->fscache, page);
89 +}
90 +
91  void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
92  {
93         struct cifsInodeInfo *cifsi = CIFS_I(inode);
94 diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h
95 index 127cb0a..e34d8ab 100644
96 --- a/fs/cifs/fscache.h
97 +++ b/fs/cifs/fscache.h
98 @@ -50,6 +50,8 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *);
99  extern void __cifs_fscache_invalidate_page(struct page *, struct inode *);
100  extern int cifs_fscache_release_page(struct page *page, gfp_t gfp);
101  
102 +extern void __cifs_readpage_to_fscache(struct inode *, struct page *);
103 +
104  static inline void cifs_fscache_invalidate_page(struct page *page,
105                                                struct inode *inode)
106  {
107 @@ -57,6 +59,13 @@ static inline void cifs_fscache_invalidate_page(struct page *page,
108                 __cifs_fscache_invalidate_page(page, inode);
109  }
110  
111 +static inline void cifs_readpage_to_fscache(struct inode *inode,
112 +                                           struct page *page)
113 +{
114 +       if (PageFsCache(page))
115 +               __cifs_readpage_to_fscache(inode, page);
116 +}
117 +
118  #else /* CONFIG_CIFS_FSCACHE */
119  static inline int cifs_fscache_register(void) { return 0; }
120  static inline void cifs_fscache_unregister(void) {}
121 @@ -80,6 +89,8 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp)
122  
123  static inline int cifs_fscache_invalidate_page(struct page *page,
124                         struct inode *) {}
125 +static inline void cifs_readpage_to_fscache(struct inode *inode,
126 +                       struct page *page) {}
127  
128  #endif /* CONFIG_CIFS_FSCACHE */
129  
130 -- 
131 1.6.4.2
132
133 --
134 To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
135 the body of a message to majordomo@vger.kernel.org
136 More majordomo info at  http://vger.kernel.org/majordomo-info.html
137
138
139