2 * Ceph cache definitions.
4 * Copyright (C) 2013 by Adfin Solutions, Inc. All Rights Reserved.
5 * Written by Milosz Tanski (milosz@adfin.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to:
18 * Free Software Foundation
19 * 51 Franklin Street, Fifth Floor
20 * Boston, MA 02111-1301 USA
27 #ifdef CONFIG_CEPH_FSCACHE
29 int ceph_fscache_register(void);
30 void ceph_fscache_unregister(void);
32 int ceph_fscache_register_fs(struct ceph_fs_client
* fsc
);
33 void ceph_fscache_unregister_fs(struct ceph_fs_client
* fsc
);
35 void ceph_fscache_inode_init(struct ceph_inode_info
*ci
);
36 void ceph_fscache_register_inode_cookie(struct ceph_fs_client
* fsc
,
37 struct ceph_inode_info
* ci
);
38 void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info
* ci
);
40 int ceph_readpage_from_fscache(struct inode
*inode
, struct page
*page
);
41 int ceph_readpages_from_fscache(struct inode
*inode
,
42 struct address_space
*mapping
,
43 struct list_head
*pages
,
45 void ceph_readpage_to_fscache(struct inode
*inode
, struct page
*page
);
46 void ceph_invalidate_fscache_page(struct inode
* inode
, struct page
*page
);
47 void ceph_queue_revalidate(struct inode
*inode
);
49 static inline void ceph_fscache_invalidate(struct inode
*inode
)
51 fscache_invalidate(ceph_inode(inode
)->fscache
);
54 static inline int ceph_release_fscache_page(struct page
*page
, gfp_t gfp
)
56 struct inode
* inode
= page
->mapping
->host
;
57 struct ceph_inode_info
*ci
= ceph_inode(inode
);
58 return fscache_maybe_release_page(ci
->fscache
, page
, gfp
);
63 static inline int ceph_fscache_register(void)
68 static inline void ceph_fscache_unregister(void)
72 static inline int ceph_fscache_register_fs(struct ceph_fs_client
* fsc
)
77 static inline void ceph_fscache_unregister_fs(struct ceph_fs_client
* fsc
)
81 static inline void ceph_fscache_inode_init(struct ceph_inode_info
*ci
)
85 static inline void ceph_fscache_register_inode_cookie(struct ceph_fs_client
* parent_fsc
,
86 struct ceph_inode_info
* ci
)
90 static inline void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info
* ci
)
94 static inline int ceph_readpage_from_fscache(struct inode
* inode
,
100 static inline int ceph_readpages_from_fscache(struct inode
*inode
,
101 struct address_space
*mapping
,
102 struct list_head
*pages
,
108 static inline void ceph_readpage_to_fscache(struct inode
*inode
,
113 static inline void ceph_fscache_invalidate(struct inode
*inode
)
117 static inline void ceph_invalidate_fscache_page(struct inode
*inode
,
122 static inline int ceph_release_fscache_page(struct page
*page
, gfp_t gfp
)
127 static inline void ceph_fscache_readpages_cancel(struct inode
*inode
,
128 struct list_head
*pages
)
132 static inline void ceph_queue_revalidate(struct inode
*inode
)
This page took 0.044689 seconds and 5 git commands to generate.