Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 1 | /* -*- mode: c; c-basic-offset: 8; -*- |
| 2 | * vim: noexpandtab sw=8 ts=8 sts=0: |
| 3 | * |
| 4 | * uptodate.c |
| 5 | * |
| 6 | * Tracking the up-to-date-ness of a local buffer_head with respect to |
| 7 | * the cluster. |
| 8 | * |
| 9 | * Copyright (C) 2002, 2004, 2005 Oracle. All rights reserved. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public |
| 13 | * License as published by the Free Software Foundation; either |
| 14 | * version 2 of the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public |
| 22 | * License along with this program; if not, write to the |
| 23 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 24 | * Boston, MA 021110-1307, USA. |
| 25 | * |
| 26 | * Standard buffer head caching flags (uptodate, etc) are insufficient |
| 27 | * in a clustered environment - a buffer may be marked up to date on |
| 28 | * our local node but could have been modified by another cluster |
| 29 | * member. As a result an additional (and performant) caching scheme |
| 30 | * is required. A further requirement is that we consume as little |
| 31 | * memory as possible - we never pin buffer_head structures in order |
| 32 | * to cache them. |
| 33 | * |
| 34 | * We track the existence of up to date buffers on the inodes which |
| 35 | * are associated with them. Because we don't want to pin |
| 36 | * buffer_heads, this is only a (strong) hint and several other checks |
| 37 | * are made in the I/O path to ensure that we don't use a stale or |
| 38 | * invalid buffer without going to disk: |
| 39 | * - buffer_jbd is used liberally - if a bh is in the journal on |
| 40 | * this node then it *must* be up to date. |
| 41 | * - the standard buffer_uptodate() macro is used to detect buffers |
| 42 | * which may be invalid (even if we have an up to date tracking |
| 43 | * item for them) |
| 44 | * |
| 45 | * For a full understanding of how this code works together, one |
| 46 | * should read the callers in dlmglue.c, the I/O functions in |
| 47 | * buffer_head_io.c and ocfs2_journal_access in journal.c |
| 48 | */ |
| 49 | |
| 50 | #include <linux/fs.h> |
| 51 | #include <linux/types.h> |
| 52 | #include <linux/slab.h> |
| 53 | #include <linux/highmem.h> |
| 54 | #include <linux/buffer_head.h> |
| 55 | #include <linux/rbtree.h> |
Joel Becker | 2b4e30f | 2008-09-03 20:03:41 -0700 | [diff] [blame] | 56 | #ifndef CONFIG_OCFS2_COMPAT_JBD |
| 57 | # include <linux/jbd2.h> |
| 58 | #else |
| 59 | # include <linux/jbd.h> |
| 60 | #endif |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 61 | |
| 62 | #define MLOG_MASK_PREFIX ML_UPTODATE |
| 63 | |
| 64 | #include <cluster/masklog.h> |
| 65 | |
| 66 | #include "ocfs2.h" |
| 67 | |
| 68 | #include "inode.h" |
| 69 | #include "uptodate.h" |
| 70 | |
| 71 | struct ocfs2_meta_cache_item { |
| 72 | struct rb_node c_node; |
| 73 | sector_t c_block; |
| 74 | }; |
| 75 | |
Christoph Lameter | e18b890 | 2006-12-06 20:33:20 -0800 | [diff] [blame] | 76 | static struct kmem_cache *ocfs2_uptodate_cachep = NULL; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 77 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 78 | u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 79 | { |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 80 | BUG_ON(!ci || !ci->ci_ops); |
| 81 | |
| 82 | return ci->ci_ops->co_owner(ci); |
| 83 | } |
| 84 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 85 | struct super_block *ocfs2_metadata_cache_get_super(struct ocfs2_caching_info *ci) |
| 86 | { |
| 87 | BUG_ON(!ci || !ci->ci_ops); |
| 88 | |
| 89 | return ci->ci_ops->co_get_super(ci); |
| 90 | } |
| 91 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 92 | static void ocfs2_metadata_cache_lock(struct ocfs2_caching_info *ci) |
| 93 | { |
| 94 | BUG_ON(!ci || !ci->ci_ops); |
| 95 | |
| 96 | ci->ci_ops->co_cache_lock(ci); |
| 97 | } |
| 98 | |
| 99 | static void ocfs2_metadata_cache_unlock(struct ocfs2_caching_info *ci) |
| 100 | { |
| 101 | BUG_ON(!ci || !ci->ci_ops); |
| 102 | |
| 103 | ci->ci_ops->co_cache_unlock(ci); |
| 104 | } |
| 105 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 106 | void ocfs2_metadata_cache_io_lock(struct ocfs2_caching_info *ci) |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 107 | { |
| 108 | BUG_ON(!ci || !ci->ci_ops); |
| 109 | |
| 110 | ci->ci_ops->co_io_lock(ci); |
| 111 | } |
| 112 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 113 | void ocfs2_metadata_cache_io_unlock(struct ocfs2_caching_info *ci) |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 114 | { |
| 115 | BUG_ON(!ci || !ci->ci_ops); |
| 116 | |
| 117 | ci->ci_ops->co_io_unlock(ci); |
| 118 | } |
| 119 | |
| 120 | |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 121 | static void ocfs2_metadata_cache_reset(struct ocfs2_caching_info *ci, |
| 122 | int clear) |
| 123 | { |
| 124 | ci->ci_flags |= OCFS2_CACHE_FL_INLINE; |
| 125 | ci->ci_num_cached = 0; |
| 126 | |
Joel Becker | 292dd27 | 2009-02-12 15:41:59 -0800 | [diff] [blame] | 127 | if (clear) { |
| 128 | ci->ci_created_trans = 0; |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 129 | ci->ci_last_trans = 0; |
Joel Becker | 292dd27 | 2009-02-12 15:41:59 -0800 | [diff] [blame] | 130 | } |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 131 | } |
| 132 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 133 | void ocfs2_metadata_cache_init(struct ocfs2_caching_info *ci, |
| 134 | const struct ocfs2_caching_operations *ops) |
| 135 | { |
| 136 | BUG_ON(!ops); |
| 137 | |
| 138 | ci->ci_ops = ops; |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 139 | ocfs2_metadata_cache_reset(ci, 1); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 140 | } |
| 141 | |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 142 | void ocfs2_metadata_cache_exit(struct ocfs2_caching_info *ci) |
| 143 | { |
| 144 | ocfs2_metadata_cache_purge(ci); |
| 145 | ocfs2_metadata_cache_reset(ci, 1); |
| 146 | } |
| 147 | |
| 148 | |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 149 | /* No lock taken here as 'root' is not expected to be visible to other |
| 150 | * processes. */ |
| 151 | static unsigned int ocfs2_purge_copied_metadata_tree(struct rb_root *root) |
| 152 | { |
| 153 | unsigned int purged = 0; |
| 154 | struct rb_node *node; |
| 155 | struct ocfs2_meta_cache_item *item; |
| 156 | |
| 157 | while ((node = rb_last(root)) != NULL) { |
| 158 | item = rb_entry(node, struct ocfs2_meta_cache_item, c_node); |
| 159 | |
| 160 | mlog(0, "Purge item %llu\n", |
| 161 | (unsigned long long) item->c_block); |
| 162 | |
| 163 | rb_erase(&item->c_node, root); |
| 164 | kmem_cache_free(ocfs2_uptodate_cachep, item); |
| 165 | |
| 166 | purged++; |
| 167 | } |
| 168 | return purged; |
| 169 | } |
| 170 | |
| 171 | /* Called from locking and called from ocfs2_clear_inode. Dump the |
| 172 | * cache for a given inode. |
| 173 | * |
| 174 | * This function is a few more lines longer than necessary due to some |
| 175 | * accounting done here, but I think it's worth tracking down those |
| 176 | * bugs sooner -- Mark */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 177 | void ocfs2_metadata_cache_purge(struct ocfs2_caching_info *ci) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 178 | { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 179 | unsigned int tree, to_purge, purged; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 180 | struct rb_root root = RB_ROOT; |
| 181 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 182 | BUG_ON(!ci || !ci->ci_ops); |
| 183 | |
| 184 | ocfs2_metadata_cache_lock(ci); |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 185 | tree = !(ci->ci_flags & OCFS2_CACHE_FL_INLINE); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 186 | to_purge = ci->ci_num_cached; |
| 187 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 188 | mlog(0, "Purge %u %s items from Owner %llu\n", to_purge, |
| 189 | tree ? "array" : "tree", |
| 190 | (unsigned long long)ocfs2_metadata_cache_owner(ci)); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 191 | |
| 192 | /* If we're a tree, save off the root so that we can safely |
| 193 | * initialize the cache. We do the work to free tree members |
| 194 | * without the spinlock. */ |
| 195 | if (tree) |
| 196 | root = ci->ci_cache.ci_tree; |
| 197 | |
Joel Becker | 66fb345 | 2009-02-12 15:24:40 -0800 | [diff] [blame] | 198 | ocfs2_metadata_cache_reset(ci, 0); |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 199 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 200 | |
| 201 | purged = ocfs2_purge_copied_metadata_tree(&root); |
| 202 | /* If possible, track the number wiped so that we can more |
| 203 | * easily detect counting errors. Unfortunately, this is only |
| 204 | * meaningful for trees. */ |
| 205 | if (tree && purged != to_purge) |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 206 | mlog(ML_ERROR, "Owner %llu, count = %u, purged = %u\n", |
| 207 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
| 208 | to_purge, purged); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | /* Returns the index in the cache array, -1 if not found. |
| 212 | * Requires ip_lock. */ |
| 213 | static int ocfs2_search_cache_array(struct ocfs2_caching_info *ci, |
| 214 | sector_t item) |
| 215 | { |
| 216 | int i; |
| 217 | |
| 218 | for (i = 0; i < ci->ci_num_cached; i++) { |
| 219 | if (item == ci->ci_cache.ci_array[i]) |
| 220 | return i; |
| 221 | } |
| 222 | |
| 223 | return -1; |
| 224 | } |
| 225 | |
| 226 | /* Returns the cache item if found, otherwise NULL. |
| 227 | * Requires ip_lock. */ |
| 228 | static struct ocfs2_meta_cache_item * |
| 229 | ocfs2_search_cache_tree(struct ocfs2_caching_info *ci, |
| 230 | sector_t block) |
| 231 | { |
| 232 | struct rb_node * n = ci->ci_cache.ci_tree.rb_node; |
| 233 | struct ocfs2_meta_cache_item *item = NULL; |
| 234 | |
| 235 | while (n) { |
| 236 | item = rb_entry(n, struct ocfs2_meta_cache_item, c_node); |
| 237 | |
| 238 | if (block < item->c_block) |
| 239 | n = n->rb_left; |
| 240 | else if (block > item->c_block) |
| 241 | n = n->rb_right; |
| 242 | else |
| 243 | return item; |
| 244 | } |
| 245 | |
| 246 | return NULL; |
| 247 | } |
| 248 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 249 | static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 250 | struct buffer_head *bh) |
| 251 | { |
| 252 | int index = -1; |
| 253 | struct ocfs2_meta_cache_item *item = NULL; |
| 254 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 255 | ocfs2_metadata_cache_lock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 256 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 257 | mlog(0, "Owner %llu, query block %llu (inline = %u)\n", |
| 258 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
Mark Fasheh | b0697053 | 2006-03-03 10:24:33 -0800 | [diff] [blame] | 259 | (unsigned long long) bh->b_blocknr, |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 260 | !!(ci->ci_flags & OCFS2_CACHE_FL_INLINE)); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 261 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 262 | if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 263 | index = ocfs2_search_cache_array(ci, bh->b_blocknr); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 264 | else |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 265 | item = ocfs2_search_cache_tree(ci, bh->b_blocknr); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 266 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 267 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 268 | |
| 269 | mlog(0, "index = %d, item = %p\n", index, item); |
| 270 | |
| 271 | return (index != -1) || (item != NULL); |
| 272 | } |
| 273 | |
| 274 | /* Warning: even if it returns true, this does *not* guarantee that |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 275 | * the block is stored in our inode metadata cache. |
| 276 | * |
| 277 | * This can be called under lock_buffer() |
| 278 | */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 279 | int ocfs2_buffer_uptodate(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 280 | struct buffer_head *bh) |
| 281 | { |
| 282 | /* Doesn't matter if the bh is in our cache or not -- if it's |
| 283 | * not marked uptodate then we know it can't have correct |
| 284 | * data. */ |
| 285 | if (!buffer_uptodate(bh)) |
| 286 | return 0; |
| 287 | |
| 288 | /* OCFS2 does not allow multiple nodes to be changing the same |
| 289 | * block at the same time. */ |
| 290 | if (buffer_jbd(bh)) |
| 291 | return 1; |
| 292 | |
| 293 | /* Ok, locally the buffer is marked as up to date, now search |
| 294 | * our cache to see if we can trust that. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 295 | return ocfs2_buffer_cached(ci, bh); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 296 | } |
| 297 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 298 | /* |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 299 | * Determine whether a buffer is currently out on a read-ahead request. |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 300 | * ci_io_sem should be held to serialize submitters with the logic here. |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 301 | */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 302 | int ocfs2_buffer_read_ahead(struct ocfs2_caching_info *ci, |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 303 | struct buffer_head *bh) |
| 304 | { |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 305 | return buffer_locked(bh) && ocfs2_buffer_cached(ci, bh); |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 306 | } |
| 307 | |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 308 | /* Requires ip_lock */ |
| 309 | static void ocfs2_append_cache_array(struct ocfs2_caching_info *ci, |
| 310 | sector_t block) |
| 311 | { |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 312 | BUG_ON(ci->ci_num_cached >= OCFS2_CACHE_INFO_MAX_ARRAY); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 313 | |
| 314 | mlog(0, "block %llu takes position %u\n", (unsigned long long) block, |
| 315 | ci->ci_num_cached); |
| 316 | |
| 317 | ci->ci_cache.ci_array[ci->ci_num_cached] = block; |
| 318 | ci->ci_num_cached++; |
| 319 | } |
| 320 | |
| 321 | /* By now the caller should have checked that the item does *not* |
| 322 | * exist in the tree. |
| 323 | * Requires ip_lock. */ |
| 324 | static void __ocfs2_insert_cache_tree(struct ocfs2_caching_info *ci, |
| 325 | struct ocfs2_meta_cache_item *new) |
| 326 | { |
| 327 | sector_t block = new->c_block; |
| 328 | struct rb_node *parent = NULL; |
| 329 | struct rb_node **p = &ci->ci_cache.ci_tree.rb_node; |
| 330 | struct ocfs2_meta_cache_item *tmp; |
| 331 | |
| 332 | mlog(0, "Insert block %llu num = %u\n", (unsigned long long) block, |
| 333 | ci->ci_num_cached); |
| 334 | |
| 335 | while(*p) { |
| 336 | parent = *p; |
| 337 | |
| 338 | tmp = rb_entry(parent, struct ocfs2_meta_cache_item, c_node); |
| 339 | |
| 340 | if (block < tmp->c_block) |
| 341 | p = &(*p)->rb_left; |
| 342 | else if (block > tmp->c_block) |
| 343 | p = &(*p)->rb_right; |
| 344 | else { |
| 345 | /* This should never happen! */ |
| 346 | mlog(ML_ERROR, "Duplicate block %llu cached!\n", |
| 347 | (unsigned long long) block); |
| 348 | BUG(); |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | rb_link_node(&new->c_node, parent, p); |
| 353 | rb_insert_color(&new->c_node, &ci->ci_cache.ci_tree); |
| 354 | ci->ci_num_cached++; |
| 355 | } |
| 356 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 357 | /* co_cache_lock() must be held */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 358 | static inline int ocfs2_insert_can_use_array(struct ocfs2_caching_info *ci) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 359 | { |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 360 | return (ci->ci_flags & OCFS2_CACHE_FL_INLINE) && |
| 361 | (ci->ci_num_cached < OCFS2_CACHE_INFO_MAX_ARRAY); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 362 | } |
| 363 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 364 | /* tree should be exactly OCFS2_CACHE_INFO_MAX_ARRAY wide. NULL the |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 365 | * pointers in tree after we use them - this allows caller to detect |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 366 | * when to free in case of error. |
| 367 | * |
| 368 | * The co_cache_lock() must be held. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 369 | static void ocfs2_expand_cache(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 370 | struct ocfs2_meta_cache_item **tree) |
| 371 | { |
| 372 | int i; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 373 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 374 | mlog_bug_on_msg(ci->ci_num_cached != OCFS2_CACHE_INFO_MAX_ARRAY, |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 375 | "Owner %llu, num cached = %u, should be %u\n", |
| 376 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
| 377 | ci->ci_num_cached, OCFS2_CACHE_INFO_MAX_ARRAY); |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 378 | mlog_bug_on_msg(!(ci->ci_flags & OCFS2_CACHE_FL_INLINE), |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 379 | "Owner %llu not marked as inline anymore!\n", |
| 380 | (unsigned long long)ocfs2_metadata_cache_owner(ci)); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 381 | |
| 382 | /* Be careful to initialize the tree members *first* because |
| 383 | * once the ci_tree is used, the array is junk... */ |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 384 | for (i = 0; i < OCFS2_CACHE_INFO_MAX_ARRAY; i++) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 385 | tree[i]->c_block = ci->ci_cache.ci_array[i]; |
| 386 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 387 | ci->ci_flags &= ~OCFS2_CACHE_FL_INLINE; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 388 | ci->ci_cache.ci_tree = RB_ROOT; |
| 389 | /* this will be set again by __ocfs2_insert_cache_tree */ |
| 390 | ci->ci_num_cached = 0; |
| 391 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 392 | for (i = 0; i < OCFS2_CACHE_INFO_MAX_ARRAY; i++) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 393 | __ocfs2_insert_cache_tree(ci, tree[i]); |
| 394 | tree[i] = NULL; |
| 395 | } |
| 396 | |
Mark Fasheh | b0697053 | 2006-03-03 10:24:33 -0800 | [diff] [blame] | 397 | mlog(0, "Expanded %llu to a tree cache: flags 0x%x, num = %u\n", |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 398 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
| 399 | ci->ci_flags, ci->ci_num_cached); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 400 | } |
| 401 | |
| 402 | /* Slow path function - memory allocation is necessary. See the |
| 403 | * comment above ocfs2_set_buffer_uptodate for more information. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 404 | static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 405 | sector_t block, |
| 406 | int expand_tree) |
| 407 | { |
| 408 | int i; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 409 | struct ocfs2_meta_cache_item *new = NULL; |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 410 | struct ocfs2_meta_cache_item *tree[OCFS2_CACHE_INFO_MAX_ARRAY] = |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 411 | { NULL, }; |
| 412 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 413 | mlog(0, "Owner %llu, block %llu, expand = %d\n", |
| 414 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
Mark Fasheh | b0697053 | 2006-03-03 10:24:33 -0800 | [diff] [blame] | 415 | (unsigned long long)block, expand_tree); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 416 | |
Sunil Mushran | afae00ab | 2006-04-12 14:37:00 -0700 | [diff] [blame] | 417 | new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_NOFS); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 418 | if (!new) { |
| 419 | mlog_errno(-ENOMEM); |
| 420 | return; |
| 421 | } |
| 422 | new->c_block = block; |
| 423 | |
| 424 | if (expand_tree) { |
| 425 | /* Do *not* allocate an array here - the removal code |
| 426 | * has no way of tracking that. */ |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 427 | for (i = 0; i < OCFS2_CACHE_INFO_MAX_ARRAY; i++) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 428 | tree[i] = kmem_cache_alloc(ocfs2_uptodate_cachep, |
Sunil Mushran | afae00ab | 2006-04-12 14:37:00 -0700 | [diff] [blame] | 429 | GFP_NOFS); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 430 | if (!tree[i]) { |
| 431 | mlog_errno(-ENOMEM); |
| 432 | goto out_free; |
| 433 | } |
| 434 | |
| 435 | /* These are initialized in ocfs2_expand_cache! */ |
| 436 | } |
| 437 | } |
| 438 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 439 | ocfs2_metadata_cache_lock(ci); |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 440 | if (ocfs2_insert_can_use_array(ci)) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 441 | mlog(0, "Someone cleared the tree underneath us\n"); |
| 442 | /* Ok, items were removed from the cache in between |
| 443 | * locks. Detect this and revert back to the fast path */ |
| 444 | ocfs2_append_cache_array(ci, block); |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 445 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 446 | goto out_free; |
| 447 | } |
| 448 | |
| 449 | if (expand_tree) |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 450 | ocfs2_expand_cache(ci, tree); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 451 | |
| 452 | __ocfs2_insert_cache_tree(ci, new); |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 453 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 454 | |
| 455 | new = NULL; |
| 456 | out_free: |
| 457 | if (new) |
| 458 | kmem_cache_free(ocfs2_uptodate_cachep, new); |
| 459 | |
| 460 | /* If these were used, then ocfs2_expand_cache re-set them to |
| 461 | * NULL for us. */ |
| 462 | if (tree[0]) { |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 463 | for (i = 0; i < OCFS2_CACHE_INFO_MAX_ARRAY; i++) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 464 | if (tree[i]) |
| 465 | kmem_cache_free(ocfs2_uptodate_cachep, |
| 466 | tree[i]); |
| 467 | } |
| 468 | } |
| 469 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 470 | /* Item insertion is guarded by co_io_lock(), so the insertion path takes |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 471 | * advantage of this by not rechecking for a duplicate insert during |
| 472 | * the slow case. Additionally, if the cache needs to be bumped up to |
| 473 | * a tree, the code will not recheck after acquiring the lock -- |
| 474 | * multiple paths cannot be expanding to a tree at the same time. |
| 475 | * |
| 476 | * The slow path takes into account that items can be removed |
| 477 | * (including the whole tree wiped and reset) when this process it out |
| 478 | * allocating memory. In those cases, it reverts back to the fast |
| 479 | * path. |
| 480 | * |
| 481 | * Note that this function may actually fail to insert the block if |
| 482 | * memory cannot be allocated. This is not fatal however (but may |
Mark Fasheh | aa95887 | 2006-04-21 13:49:02 -0700 | [diff] [blame] | 483 | * result in a performance penalty) |
| 484 | * |
| 485 | * Readahead buffers can be passed in here before the I/O request is |
| 486 | * completed. |
| 487 | */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 488 | void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 489 | struct buffer_head *bh) |
| 490 | { |
| 491 | int expand; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 492 | |
| 493 | /* The block may very well exist in our cache already, so avoid |
| 494 | * doing any more work in that case. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 495 | if (ocfs2_buffer_cached(ci, bh)) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 496 | return; |
| 497 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 498 | mlog(0, "Owner %llu, inserting block %llu\n", |
| 499 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
Mark Fasheh | b0697053 | 2006-03-03 10:24:33 -0800 | [diff] [blame] | 500 | (unsigned long long)bh->b_blocknr); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 501 | |
| 502 | /* No need to recheck under spinlock - insertion is guarded by |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 503 | * co_io_lock() */ |
| 504 | ocfs2_metadata_cache_lock(ci); |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 505 | if (ocfs2_insert_can_use_array(ci)) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 506 | /* Fast case - it's an array and there's a free |
| 507 | * spot. */ |
| 508 | ocfs2_append_cache_array(ci, bh->b_blocknr); |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 509 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 510 | return; |
| 511 | } |
| 512 | |
| 513 | expand = 0; |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 514 | if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 515 | /* We need to bump things up to a tree. */ |
| 516 | expand = 1; |
| 517 | } |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 518 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 519 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 520 | __ocfs2_set_buffer_uptodate(ci, bh->b_blocknr, expand); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | /* Called against a newly allocated buffer. Most likely nobody should |
| 524 | * be able to read this sort of metadata while it's still being |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 525 | * allocated, but this is careful to take co_io_lock() anyway. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 526 | void ocfs2_set_new_buffer_uptodate(struct ocfs2_caching_info *ci, |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 527 | struct buffer_head *bh) |
| 528 | { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 529 | /* This should definitely *not* exist in our cache */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 530 | BUG_ON(ocfs2_buffer_cached(ci, bh)); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 531 | |
| 532 | set_buffer_uptodate(bh); |
| 533 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 534 | ocfs2_metadata_cache_io_lock(ci); |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 535 | ocfs2_set_buffer_uptodate(ci, bh); |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 536 | ocfs2_metadata_cache_io_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | /* Requires ip_lock. */ |
| 540 | static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci, |
| 541 | int index) |
| 542 | { |
| 543 | sector_t *array = ci->ci_cache.ci_array; |
| 544 | int bytes; |
| 545 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 546 | BUG_ON(index < 0 || index >= OCFS2_CACHE_INFO_MAX_ARRAY); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 547 | BUG_ON(index >= ci->ci_num_cached); |
| 548 | BUG_ON(!ci->ci_num_cached); |
| 549 | |
| 550 | mlog(0, "remove index %d (num_cached = %u\n", index, |
| 551 | ci->ci_num_cached); |
| 552 | |
| 553 | ci->ci_num_cached--; |
| 554 | |
| 555 | /* don't need to copy if the array is now empty, or if we |
| 556 | * removed at the tail */ |
| 557 | if (ci->ci_num_cached && index < ci->ci_num_cached) { |
| 558 | bytes = sizeof(sector_t) * (ci->ci_num_cached - index); |
| 559 | memmove(&array[index], &array[index + 1], bytes); |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | /* Requires ip_lock. */ |
| 564 | static void ocfs2_remove_metadata_tree(struct ocfs2_caching_info *ci, |
| 565 | struct ocfs2_meta_cache_item *item) |
| 566 | { |
| 567 | mlog(0, "remove block %llu from tree\n", |
| 568 | (unsigned long long) item->c_block); |
| 569 | |
| 570 | rb_erase(&item->c_node, &ci->ci_cache.ci_tree); |
| 571 | ci->ci_num_cached--; |
| 572 | } |
| 573 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 574 | static void ocfs2_remove_block_from_cache(struct ocfs2_caching_info *ci, |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 575 | sector_t block) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 576 | { |
| 577 | int index; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 578 | struct ocfs2_meta_cache_item *item = NULL; |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 579 | |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 580 | ocfs2_metadata_cache_lock(ci); |
| 581 | mlog(0, "Owner %llu, remove %llu, items = %u, array = %u\n", |
| 582 | (unsigned long long)ocfs2_metadata_cache_owner(ci), |
Mark Fasheh | b0697053 | 2006-03-03 10:24:33 -0800 | [diff] [blame] | 583 | (unsigned long long) block, ci->ci_num_cached, |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 584 | ci->ci_flags & OCFS2_CACHE_FL_INLINE); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 585 | |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 586 | if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) { |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 587 | index = ocfs2_search_cache_array(ci, block); |
| 588 | if (index != -1) |
| 589 | ocfs2_remove_metadata_array(ci, index); |
| 590 | } else { |
| 591 | item = ocfs2_search_cache_tree(ci, block); |
| 592 | if (item) |
| 593 | ocfs2_remove_metadata_tree(ci, item); |
| 594 | } |
Joel Becker | 6e5a3d7 | 2009-02-10 19:00:37 -0800 | [diff] [blame] | 595 | ocfs2_metadata_cache_unlock(ci); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 596 | |
| 597 | if (item) |
| 598 | kmem_cache_free(ocfs2_uptodate_cachep, item); |
| 599 | } |
| 600 | |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 601 | /* |
| 602 | * Called when we remove a chunk of metadata from an inode. We don't |
| 603 | * bother reverting things to an inlined array in the case of a remove |
| 604 | * which moves us back under the limit. |
| 605 | */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 606 | void ocfs2_remove_from_cache(struct ocfs2_caching_info *ci, |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 607 | struct buffer_head *bh) |
| 608 | { |
| 609 | sector_t block = bh->b_blocknr; |
| 610 | |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 611 | ocfs2_remove_block_from_cache(ci, block); |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | /* Called when we remove xattr clusters from an inode. */ |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 615 | void ocfs2_remove_xattr_clusters_from_cache(struct ocfs2_caching_info *ci, |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 616 | sector_t block, |
| 617 | u32 c_len) |
| 618 | { |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 619 | struct super_block *sb = ocfs2_metadata_cache_get_super(ci); |
| 620 | unsigned int i, b_len = ocfs2_clusters_to_blocks(sb, 1) * c_len; |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 621 | |
| 622 | for (i = 0; i < b_len; i++, block++) |
Joel Becker | 8cb471e | 2009-02-10 20:00:41 -0800 | [diff] [blame] | 623 | ocfs2_remove_block_from_cache(ci, block); |
Tao Ma | ac11c82 | 2008-08-18 17:38:47 +0800 | [diff] [blame] | 624 | } |
| 625 | |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 626 | int __init init_ocfs2_uptodate_cache(void) |
| 627 | { |
| 628 | ocfs2_uptodate_cachep = kmem_cache_create("ocfs2_uptodate", |
| 629 | sizeof(struct ocfs2_meta_cache_item), |
Paul Mundt | 20c2df8 | 2007-07-20 10:11:58 +0900 | [diff] [blame] | 630 | 0, SLAB_HWCACHE_ALIGN, NULL); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 631 | if (!ocfs2_uptodate_cachep) |
| 632 | return -ENOMEM; |
| 633 | |
| 634 | mlog(0, "%u inlined cache items per inode.\n", |
Joel Becker | 47460d6 | 2009-02-10 16:05:07 -0800 | [diff] [blame] | 635 | OCFS2_CACHE_INFO_MAX_ARRAY); |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 636 | |
| 637 | return 0; |
| 638 | } |
| 639 | |
Adrian Bunk | 0c6c98f | 2006-01-07 20:07:02 +0100 | [diff] [blame] | 640 | void exit_ocfs2_uptodate_cache(void) |
Mark Fasheh | ccd979b | 2005-12-15 14:31:24 -0800 | [diff] [blame] | 641 | { |
| 642 | if (ocfs2_uptodate_cachep) |
| 643 | kmem_cache_destroy(ocfs2_uptodate_cachep); |
| 644 | } |