blob: 56a3999cefae4fe1b445e87a0d6488265a4984d1 [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
David Chinner2a82b8b2007-07-11 11:09:12 +10002/*
3 * Copyright (c) 2006-2007 Silicon Graphics, Inc.
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +10004 * Copyright (c) 2014 Christoph Hellwig.
David Chinner2a82b8b2007-07-11 11:09:12 +10005 * All Rights Reserved.
David Chinner2a82b8b2007-07-11 11:09:12 +10006 */
7#include "xfs.h"
Dave Chinnera4fbe6a2013-10-23 10:51:50 +11008#include "xfs_format.h"
Dave Chinner239880e2013-10-23 10:50:10 +11009#include "xfs_log_format.h"
10#include "xfs_trans_resv.h"
Dave Chinner239880e2013-10-23 10:50:10 +110011#include "xfs_sb.h"
12#include "xfs_mount.h"
Darrick J. Wong3ab78df2016-08-03 11:15:38 +100013#include "xfs_defer.h"
David Chinner2a82b8b2007-07-11 11:09:12 +100014#include "xfs_inode.h"
David Chinner2a82b8b2007-07-11 11:09:12 +100015#include "xfs_bmap.h"
Dave Chinner68988112013-08-12 20:49:42 +100016#include "xfs_bmap_util.h"
David Chinner2a82b8b2007-07-11 11:09:12 +100017#include "xfs_alloc.h"
David Chinner2a82b8b2007-07-11 11:09:12 +100018#include "xfs_mru_cache.h"
19#include "xfs_filestream.h"
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000020#include "xfs_trace.h"
Darrick J. Wong3fd129b2016-09-19 10:30:52 +100021#include "xfs_ag_resv.h"
Brian Foster3e3673e2018-07-11 22:26:14 -070022#include "xfs_trans.h"
David Chinner2a82b8b2007-07-11 11:09:12 +100023
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +100024struct xfs_fstrm_item {
25 struct xfs_mru_cache_elem mru;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +100026 xfs_agnumber_t ag; /* AG in use for this directory */
27};
28
29enum xfs_fstrm_alloc {
30 XFS_PICK_USERDATA = 1,
31 XFS_PICK_LOWSPACE = 2,
32};
David Chinner2a82b8b2007-07-11 11:09:12 +100033
Christoph Hellwig0664ce82010-07-20 17:31:01 +100034/*
35 * Allocation group filestream associations are tracked with per-ag atomic
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +100036 * counters. These counters allow xfs_filestream_pick_ag() to tell whether a
Christoph Hellwig0664ce82010-07-20 17:31:01 +100037 * particular AG already has active filestreams associated with it. The mount
38 * point's m_peraglock is used to protect these counters from per-ag array
39 * re-allocation during a growfs operation. When xfs_growfs_data_private() is
40 * about to reallocate the array, it calls xfs_filestream_flush() with the
41 * m_peraglock held in write mode.
42 *
43 * Since xfs_mru_cache_flush() guarantees that all the free functions for all
44 * the cache elements have finished executing before it returns, it's safe for
45 * the free functions to use the atomic counters without m_peraglock protection.
46 * This allows the implementation of xfs_fstrm_free_func() to be agnostic about
47 * whether it was called with the m_peraglock held in read mode, write mode or
48 * not held at all. The race condition this addresses is the following:
49 *
50 * - The work queue scheduler fires and pulls a filestream directory cache
51 * element off the LRU end of the cache for deletion, then gets pre-empted.
52 * - A growfs operation grabs the m_peraglock in write mode, flushes all the
53 * remaining items from the cache and reallocates the mount point's per-ag
54 * array, resetting all the counters to zero.
55 * - The work queue thread resumes and calls the free function for the element
56 * it started cleaning up earlier. In the process it decrements the
57 * filestreams counter for an AG that now has no references.
58 *
59 * With a shrinkfs feature, the above scenario could panic the system.
60 *
61 * All other uses of the following macros should be protected by either the
62 * m_peraglock held in read mode, or the cache's internal locking exposed by the
63 * interval between a call to xfs_mru_cache_lookup() and a call to
64 * xfs_mru_cache_done(). In addition, the m_peraglock must be held in read mode
65 * when new elements are added to the cache.
66 *
67 * Combined, these locking rules ensure that no associations will ever exist in
68 * the cache that reference per-ag array elements that have since been
69 * reallocated.
70 */
Christoph Hellwigb94acd42014-04-23 07:11:52 +100071int
Christoph Hellwig0664ce82010-07-20 17:31:01 +100072xfs_filestream_peek_ag(
73 xfs_mount_t *mp,
74 xfs_agnumber_t agno)
75{
76 struct xfs_perag *pag;
77 int ret;
78
79 pag = xfs_perag_get(mp, agno);
80 ret = atomic_read(&pag->pagf_fstrms);
81 xfs_perag_put(pag);
82 return ret;
83}
84
85static int
86xfs_filestream_get_ag(
87 xfs_mount_t *mp,
88 xfs_agnumber_t agno)
89{
90 struct xfs_perag *pag;
91 int ret;
92
93 pag = xfs_perag_get(mp, agno);
94 ret = atomic_inc_return(&pag->pagf_fstrms);
95 xfs_perag_put(pag);
96 return ret;
97}
98
99static void
100xfs_filestream_put_ag(
101 xfs_mount_t *mp,
102 xfs_agnumber_t agno)
103{
104 struct xfs_perag *pag;
105
106 pag = xfs_perag_get(mp, agno);
107 atomic_dec(&pag->pagf_fstrms);
108 xfs_perag_put(pag);
109}
David Chinner2a82b8b2007-07-11 11:09:12 +1000110
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000111static void
112xfs_fstrm_free_func(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700113 void *data,
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000114 struct xfs_mru_cache_elem *mru)
115{
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700116 struct xfs_mount *mp = data;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000117 struct xfs_fstrm_item *item =
118 container_of(mru, struct xfs_fstrm_item, mru);
119
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700120 xfs_filestream_put_ag(mp, item->ag);
121 trace_xfs_filestream_free(mp, mru->key, item->ag);
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000122
Christoph Hellwig1919add2014-04-23 07:11:51 +1000123 kmem_free(item);
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000124}
125
David Chinner2a82b8b2007-07-11 11:09:12 +1000126/*
127 * Scan the AGs starting at startag looking for an AG that isn't in use and has
128 * at least minlen blocks free.
129 */
130static int
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000131xfs_filestream_pick_ag(
132 struct xfs_inode *ip,
133 xfs_agnumber_t startag,
134 xfs_agnumber_t *agp,
135 int flags,
136 xfs_extlen_t minlen)
David Chinner2a82b8b2007-07-11 11:09:12 +1000137{
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000138 struct xfs_mount *mp = ip->i_mount;
139 struct xfs_fstrm_item *item;
140 struct xfs_perag *pag;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000141 xfs_extlen_t longest, free = 0, minfree, maxfree = 0;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000142 xfs_agnumber_t ag, max_ag = NULLAGNUMBER;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000143 int err, trylock, nscan;
144
Dave Chinnerc19b3b052016-02-09 16:54:58 +1100145 ASSERT(S_ISDIR(VFS_I(ip)->i_mode));
David Chinner2a82b8b2007-07-11 11:09:12 +1000146
147 /* 2% of an AG's blocks must be free for it to be chosen. */
148 minfree = mp->m_sb.sb_agblocks / 50;
149
150 ag = startag;
151 *agp = NULLAGNUMBER;
152
153 /* For the first pass, don't sleep trying to init the per-AG. */
154 trylock = XFS_ALLOC_FLAG_TRYLOCK;
155
156 for (nscan = 0; 1; nscan++) {
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700157 trace_xfs_filestream_scan(mp, ip->i_ino, ag);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000158
Dave Chinner4196ac02010-01-11 11:47:42 +0000159 pag = xfs_perag_get(mp, ag);
David Chinner2a82b8b2007-07-11 11:09:12 +1000160
161 if (!pag->pagf_init) {
162 err = xfs_alloc_pagf_init(mp, NULL, ag, trylock);
Dave Chinner4196ac02010-01-11 11:47:42 +0000163 if (err && !trylock) {
164 xfs_perag_put(pag);
David Chinner2a82b8b2007-07-11 11:09:12 +1000165 return err;
Dave Chinner4196ac02010-01-11 11:47:42 +0000166 }
David Chinner2a82b8b2007-07-11 11:09:12 +1000167 }
168
169 /* Might fail sometimes during the 1st pass with trylock set. */
170 if (!pag->pagf_init)
171 goto next_ag;
172
173 /* Keep track of the AG with the most free blocks. */
174 if (pag->pagf_freeblks > maxfree) {
175 maxfree = pag->pagf_freeblks;
176 max_ag = ag;
177 }
178
179 /*
180 * The AG reference count does two things: it enforces mutual
181 * exclusion when examining the suitability of an AG in this
182 * loop, and it guards against two filestreams being established
183 * in the same AG as each other.
184 */
185 if (xfs_filestream_get_ag(mp, ag) > 1) {
186 xfs_filestream_put_ag(mp, ag);
187 goto next_ag;
188 }
189
Eric Sandeena1f69412018-04-06 10:09:42 -0700190 longest = xfs_alloc_longest_free_extent(pag,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +1000191 xfs_alloc_min_freelist(mp, pag),
192 xfs_ag_resv_needed(pag, XFS_AG_RESV_NONE));
David Chinner2a82b8b2007-07-11 11:09:12 +1000193 if (((minlen && longest >= minlen) ||
194 (!minlen && pag->pagf_freeblks >= minfree)) &&
195 (!pag->pagf_metadata || !(flags & XFS_PICK_USERDATA) ||
196 (flags & XFS_PICK_LOWSPACE))) {
197
198 /* Break out, retaining the reference on the AG. */
199 free = pag->pagf_freeblks;
Dave Chinner4196ac02010-01-11 11:47:42 +0000200 xfs_perag_put(pag);
David Chinner2a82b8b2007-07-11 11:09:12 +1000201 *agp = ag;
202 break;
203 }
204
205 /* Drop the reference on this AG, it's not usable. */
206 xfs_filestream_put_ag(mp, ag);
207next_ag:
Dave Chinner4196ac02010-01-11 11:47:42 +0000208 xfs_perag_put(pag);
David Chinner2a82b8b2007-07-11 11:09:12 +1000209 /* Move to the next AG, wrapping to AG 0 if necessary. */
210 if (++ag >= mp->m_sb.sb_agcount)
211 ag = 0;
212
213 /* If a full pass of the AGs hasn't been done yet, continue. */
214 if (ag != startag)
215 continue;
216
217 /* Allow sleeping in xfs_alloc_pagf_init() on the 2nd pass. */
218 if (trylock != 0) {
219 trylock = 0;
220 continue;
221 }
222
223 /* Finally, if lowspace wasn't set, set it for the 3rd pass. */
224 if (!(flags & XFS_PICK_LOWSPACE)) {
225 flags |= XFS_PICK_LOWSPACE;
226 continue;
227 }
228
229 /*
230 * Take the AG with the most free space, regardless of whether
231 * it's already in use by another filestream.
232 */
233 if (max_ag != NULLAGNUMBER) {
234 xfs_filestream_get_ag(mp, max_ag);
David Chinner2a82b8b2007-07-11 11:09:12 +1000235 free = maxfree;
236 *agp = max_ag;
237 break;
238 }
239
240 /* take AG 0 if none matched */
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000241 trace_xfs_filestream_pick(ip, *agp, free, nscan);
David Chinner2a82b8b2007-07-11 11:09:12 +1000242 *agp = 0;
243 return 0;
244 }
245
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000246 trace_xfs_filestream_pick(ip, *agp, free, nscan);
David Chinner2a82b8b2007-07-11 11:09:12 +1000247
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000248 if (*agp == NULLAGNUMBER)
David Chinner2a82b8b2007-07-11 11:09:12 +1000249 return 0;
David Chinner2a82b8b2007-07-11 11:09:12 +1000250
Dave Chinner24513372014-06-25 14:58:08 +1000251 err = -ENOMEM;
Christoph Hellwig1919add2014-04-23 07:11:51 +1000252 item = kmem_alloc(sizeof(*item), KM_MAYFAIL);
David Chinner2a82b8b2007-07-11 11:09:12 +1000253 if (!item)
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000254 goto out_put_ag;
David Chinner2a82b8b2007-07-11 11:09:12 +1000255
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000256 item->ag = *agp;
David Chinner2a82b8b2007-07-11 11:09:12 +1000257
Christoph Hellwig22328d72014-04-23 07:11:51 +1000258 err = xfs_mru_cache_insert(mp->m_filestream, ip->i_ino, &item->mru);
David Chinner2a82b8b2007-07-11 11:09:12 +1000259 if (err) {
Dave Chinner24513372014-06-25 14:58:08 +1000260 if (err == -EEXIST)
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000261 err = 0;
262 goto out_free_item;
David Chinner2a82b8b2007-07-11 11:09:12 +1000263 }
264
David Chinner2a82b8b2007-07-11 11:09:12 +1000265 return 0;
David Chinner2a82b8b2007-07-11 11:09:12 +1000266
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000267out_free_item:
Christoph Hellwig1919add2014-04-23 07:11:51 +1000268 kmem_free(item);
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000269out_put_ag:
270 xfs_filestream_put_ag(mp, *agp);
David Chinner2a82b8b2007-07-11 11:09:12 +1000271 return err;
272}
273
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000274static struct xfs_inode *
275xfs_filestream_get_parent(
276 struct xfs_inode *ip)
David Chinner2a82b8b2007-07-11 11:09:12 +1000277{
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000278 struct inode *inode = VFS_I(ip), *dir = NULL;
279 struct dentry *dentry, *parent;
280
281 dentry = d_find_alias(inode);
282 if (!dentry)
283 goto out;
284
285 parent = dget_parent(dentry);
286 if (!parent)
287 goto out_dput;
288
David Howells2b0143b2015-03-17 22:25:59 +0000289 dir = igrab(d_inode(parent));
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000290 dput(parent);
291
292out_dput:
293 dput(dentry);
294out:
295 return dir ? XFS_I(dir) : NULL;
David Chinner2a82b8b2007-07-11 11:09:12 +1000296}
297
298/*
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000299 * Find the right allocation group for a file, either by finding an
300 * existing file stream or creating a new one.
301 *
302 * Returns NULLAGNUMBER in case of an error.
David Chinner2a82b8b2007-07-11 11:09:12 +1000303 */
304xfs_agnumber_t
305xfs_filestream_lookup_ag(
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000306 struct xfs_inode *ip)
David Chinner2a82b8b2007-07-11 11:09:12 +1000307{
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000308 struct xfs_mount *mp = ip->i_mount;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000309 struct xfs_inode *pip = NULL;
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000310 xfs_agnumber_t startag, ag = NULLAGNUMBER;
Christoph Hellwig22328d72014-04-23 07:11:51 +1000311 struct xfs_mru_cache_elem *mru;
David Chinner2a82b8b2007-07-11 11:09:12 +1000312
Dave Chinnerc19b3b052016-02-09 16:54:58 +1100313 ASSERT(S_ISREG(VFS_I(ip)->i_mode));
David Chinner2a82b8b2007-07-11 11:09:12 +1000314
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000315 pip = xfs_filestream_get_parent(ip);
316 if (!pip)
Eric Sandeenb26384d2015-03-25 14:54:25 +1100317 return NULLAGNUMBER;
David Chinner2a82b8b2007-07-11 11:09:12 +1000318
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000319 mru = xfs_mru_cache_lookup(mp->m_filestream, pip->i_ino);
Christoph Hellwig22328d72014-04-23 07:11:51 +1000320 if (mru) {
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000321 ag = container_of(mru, struct xfs_fstrm_item, mru)->ag;
Christoph Hellwig22328d72014-04-23 07:11:51 +1000322 xfs_mru_cache_done(mp->m_filestream);
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000323
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700324 trace_xfs_filestream_lookup(mp, ip->i_ino, ag);
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000325 goto out;
David Chinner2a82b8b2007-07-11 11:09:12 +1000326 }
327
328 /*
329 * Set the starting AG using the rotor for inode32, otherwise
330 * use the directory inode's AG.
331 */
332 if (mp->m_flags & XFS_MOUNT_32BITINODES) {
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000333 xfs_agnumber_t rotorstep = xfs_rotorstep;
David Chinner2a82b8b2007-07-11 11:09:12 +1000334 startag = (mp->m_agfrotor / rotorstep) % mp->m_sb.sb_agcount;
335 mp->m_agfrotor = (mp->m_agfrotor + 1) %
336 (mp->m_sb.sb_agcount * rotorstep);
337 } else
338 startag = XFS_INO_TO_AGNO(mp, pip->i_ino);
339
Christoph Hellwig3b8d9072014-04-23 07:11:52 +1000340 if (xfs_filestream_pick_ag(pip, startag, &ag, 0, 0))
341 ag = NULLAGNUMBER;
342out:
343 IRELE(pip);
344 return ag;
David Chinner2a82b8b2007-07-11 11:09:12 +1000345}
346
347/*
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000348 * Pick a new allocation group for the current file and its file stream.
349 *
350 * This is called when the allocator can't find a suitable extent in the
351 * current AG, and we have to move the stream into a new AG with more space.
David Chinner2a82b8b2007-07-11 11:09:12 +1000352 */
353int
354xfs_filestream_new_ag(
Dave Chinner68988112013-08-12 20:49:42 +1000355 struct xfs_bmalloca *ap,
356 xfs_agnumber_t *agp)
David Chinner2a82b8b2007-07-11 11:09:12 +1000357{
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000358 struct xfs_inode *ip = ap->ip, *pip;
359 struct xfs_mount *mp = ip->i_mount;
360 xfs_extlen_t minlen = ap->length;
361 xfs_agnumber_t startag = 0;
Dave Chinner292378e2016-09-26 08:21:28 +1000362 int flags = 0;
363 int err = 0;
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000364 struct xfs_mru_cache_elem *mru;
David Chinner2a82b8b2007-07-11 11:09:12 +1000365
David Chinner2a82b8b2007-07-11 11:09:12 +1000366 *agp = NULLAGNUMBER;
367
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000368 pip = xfs_filestream_get_parent(ip);
369 if (!pip)
370 goto exit;
371
372 mru = xfs_mru_cache_remove(mp->m_filestream, pip->i_ino);
Christoph Hellwig22328d72014-04-23 07:11:51 +1000373 if (mru) {
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000374 struct xfs_fstrm_item *item =
375 container_of(mru, struct xfs_fstrm_item, mru);
376 startag = (item->ag + 1) % mp->m_sb.sb_agcount;
David Chinner2a82b8b2007-07-11 11:09:12 +1000377 }
378
Dave Chinner292378e2016-09-26 08:21:28 +1000379 if (xfs_alloc_is_userdata(ap->datatype))
380 flags |= XFS_PICK_USERDATA;
Brian Foster3e3673e2018-07-11 22:26:14 -0700381 if (ap->tp->t_dfops->dop_low)
Dave Chinner292378e2016-09-26 08:21:28 +1000382 flags |= XFS_PICK_LOWSPACE;
David Chinner2a82b8b2007-07-11 11:09:12 +1000383
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000384 err = xfs_filestream_pick_ag(pip, startag, agp, flags, minlen);
David Chinner2a82b8b2007-07-11 11:09:12 +1000385
386 /*
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000387 * Only free the item here so we skip over the old AG earlier.
David Chinner2a82b8b2007-07-11 11:09:12 +1000388 */
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000389 if (mru)
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700390 xfs_fstrm_free_func(mp, mru);
David Chinner2a82b8b2007-07-11 11:09:12 +1000391
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000392 IRELE(pip);
David Chinner2a82b8b2007-07-11 11:09:12 +1000393exit:
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000394 if (*agp == NULLAGNUMBER)
David Chinner2a82b8b2007-07-11 11:09:12 +1000395 *agp = 0;
David Chinner2a82b8b2007-07-11 11:09:12 +1000396 return err;
397}
398
David Chinner2a82b8b2007-07-11 11:09:12 +1000399void
400xfs_filestream_deassociate(
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000401 struct xfs_inode *ip)
David Chinner2a82b8b2007-07-11 11:09:12 +1000402{
Christoph Hellwig22328d72014-04-23 07:11:51 +1000403 xfs_mru_cache_delete(ip->i_mount->m_filestream, ip->i_ino);
David Chinner2a82b8b2007-07-11 11:09:12 +1000404}
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000405
406int
407xfs_filestream_mount(
408 xfs_mount_t *mp)
409{
410 /*
411 * The filestream timer tunable is currently fixed within the range of
412 * one second to four minutes, with five seconds being the default. The
413 * group count is somewhat arbitrary, but it'd be nice to adhere to the
414 * timer tunable to within about 10 percent. This requires at least 10
415 * groups.
416 */
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700417 return xfs_mru_cache_create(&mp->m_filestream, mp,
418 xfs_fstrm_centisecs * 10, 10, xfs_fstrm_free_func);
Christoph Hellwig2cd2ef62014-04-23 07:11:51 +1000419}
420
421void
422xfs_filestream_unmount(
423 xfs_mount_t *mp)
424{
425 xfs_mru_cache_destroy(mp->m_filestream);
426}