aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/fscache.h
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2010-07-05 08:43:25 -0400
committerSteve French <sfrench@us.ibm.com>2010-08-02 08:40:37 -0400
commit56698236e1294848c63d4768673865ae5a9c69e0 (patch)
treece6d43104a236595763759fe68c26ca3089abdd1 /fs/cifs/fscache.h
parent9dc06558c223bbc08290917ac44c25963bc09e43 (diff)
cifs: read pages from FS-Cache
Read pages from a FS-Cache data storage object into a CIFS inode. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/fscache.h')
-rw-r--r--fs/cifs/fscache.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h
index 1a00d70bca97..79164c66797e 100644
--- a/fs/cifs/fscache.h
+++ b/fs/cifs/fscache.h
@@ -32,7 +32,6 @@ extern const struct fscache_cookie_def cifs_fscache_server_index_def;
32extern const struct fscache_cookie_def cifs_fscache_super_index_def; 32extern const struct fscache_cookie_def cifs_fscache_super_index_def;
33extern const struct fscache_cookie_def cifs_fscache_inode_object_def; 33extern const struct fscache_cookie_def cifs_fscache_inode_object_def;
34 34
35
36extern int cifs_fscache_register(void); 35extern int cifs_fscache_register(void);
37extern void cifs_fscache_unregister(void); 36extern void cifs_fscache_unregister(void);
38 37
@@ -50,6 +49,11 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *);
50 49
51extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); 50extern void __cifs_fscache_invalidate_page(struct page *, struct inode *);
52extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); 51extern int cifs_fscache_release_page(struct page *page, gfp_t gfp);
52extern int __cifs_readpage_from_fscache(struct inode *, struct page *);
53extern int __cifs_readpages_from_fscache(struct inode *,
54 struct address_space *,
55 struct list_head *,
56 unsigned *);
53 57
54extern void __cifs_readpage_to_fscache(struct inode *, struct page *); 58extern void __cifs_readpage_to_fscache(struct inode *, struct page *);
55 59
@@ -60,6 +64,26 @@ static inline void cifs_fscache_invalidate_page(struct page *page,
60 __cifs_fscache_invalidate_page(page, inode); 64 __cifs_fscache_invalidate_page(page, inode);
61} 65}
62 66
67static inline int cifs_readpage_from_fscache(struct inode *inode,
68 struct page *page)
69{
70 if (CIFS_I(inode)->fscache)
71 return __cifs_readpage_from_fscache(inode, page);
72
73 return -ENOBUFS;
74}
75
76static inline int cifs_readpages_from_fscache(struct inode *inode,
77 struct address_space *mapping,
78 struct list_head *pages,
79 unsigned *nr_pages)
80{
81 if (CIFS_I(inode)->fscache)
82 return __cifs_readpages_from_fscache(inode, mapping, pages,
83 nr_pages);
84 return -ENOBUFS;
85}
86
63static inline void cifs_readpage_to_fscache(struct inode *inode, 87static inline void cifs_readpage_to_fscache(struct inode *inode,
64 struct page *page) 88 struct page *page)
65{ 89{
@@ -90,6 +114,20 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp)
90 114
91static inline int cifs_fscache_invalidate_page(struct page *page, 115static inline int cifs_fscache_invalidate_page(struct page *page,
92 struct inode *) {} 116 struct inode *) {}
117static inline int
118cifs_readpage_from_fscache(struct inode *inode, struct page *page)
119{
120 return -ENOBUFS;
121}
122
123static inline int cifs_readpages_from_fscache(struct inode *inode,
124 struct address_space *mapping,
125 struct list_head *pages,
126 unsigned *nr_pages)
127{
128 return -ENOBUFS;
129}
130
93static inline void cifs_readpage_to_fscache(struct inode *inode, 131static inline void cifs_readpage_to_fscache(struct inode *inode,
94 struct page *page) {} 132 struct page *page) {}
95 133