|
@@ -34,7 +34,6 @@
|
|
|
|
|
|
struct xfs_fstrm_item {
|
|
struct xfs_fstrm_item {
|
|
struct xfs_mru_cache_elem mru;
|
|
struct xfs_mru_cache_elem mru;
|
|
- struct xfs_inode *ip;
|
|
|
|
xfs_agnumber_t ag; /* AG in use for this directory */
|
|
xfs_agnumber_t ag; /* AG in use for this directory */
|
|
};
|
|
};
|
|
|
|
|
|
@@ -122,14 +121,15 @@ xfs_filestream_put_ag(
|
|
|
|
|
|
static void
|
|
static void
|
|
xfs_fstrm_free_func(
|
|
xfs_fstrm_free_func(
|
|
|
|
+ void *data,
|
|
struct xfs_mru_cache_elem *mru)
|
|
struct xfs_mru_cache_elem *mru)
|
|
{
|
|
{
|
|
|
|
+ struct xfs_mount *mp = data;
|
|
struct xfs_fstrm_item *item =
|
|
struct xfs_fstrm_item *item =
|
|
container_of(mru, struct xfs_fstrm_item, mru);
|
|
container_of(mru, struct xfs_fstrm_item, mru);
|
|
|
|
|
|
- xfs_filestream_put_ag(item->ip->i_mount, item->ag);
|
|
|
|
-
|
|
|
|
- trace_xfs_filestream_free(item->ip, item->ag);
|
|
|
|
|
|
+ xfs_filestream_put_ag(mp, item->ag);
|
|
|
|
+ trace_xfs_filestream_free(mp, mru->key, item->ag);
|
|
|
|
|
|
kmem_free(item);
|
|
kmem_free(item);
|
|
}
|
|
}
|
|
@@ -165,7 +165,7 @@ xfs_filestream_pick_ag(
|
|
trylock = XFS_ALLOC_FLAG_TRYLOCK;
|
|
trylock = XFS_ALLOC_FLAG_TRYLOCK;
|
|
|
|
|
|
for (nscan = 0; 1; nscan++) {
|
|
for (nscan = 0; 1; nscan++) {
|
|
- trace_xfs_filestream_scan(ip, ag);
|
|
|
|
|
|
+ trace_xfs_filestream_scan(mp, ip->i_ino, ag);
|
|
|
|
|
|
pag = xfs_perag_get(mp, ag);
|
|
pag = xfs_perag_get(mp, ag);
|
|
|
|
|
|
@@ -265,7 +265,6 @@ next_ag:
|
|
goto out_put_ag;
|
|
goto out_put_ag;
|
|
|
|
|
|
item->ag = *agp;
|
|
item->ag = *agp;
|
|
- item->ip = ip;
|
|
|
|
|
|
|
|
err = xfs_mru_cache_insert(mp->m_filestream, ip->i_ino, &item->mru);
|
|
err = xfs_mru_cache_insert(mp->m_filestream, ip->i_ino, &item->mru);
|
|
if (err) {
|
|
if (err) {
|
|
@@ -333,7 +332,7 @@ xfs_filestream_lookup_ag(
|
|
ag = container_of(mru, struct xfs_fstrm_item, mru)->ag;
|
|
ag = container_of(mru, struct xfs_fstrm_item, mru)->ag;
|
|
xfs_mru_cache_done(mp->m_filestream);
|
|
xfs_mru_cache_done(mp->m_filestream);
|
|
|
|
|
|
- trace_xfs_filestream_lookup(ip, ag);
|
|
|
|
|
|
+ trace_xfs_filestream_lookup(mp, ip->i_ino, ag);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -399,7 +398,7 @@ xfs_filestream_new_ag(
|
|
* Only free the item here so we skip over the old AG earlier.
|
|
* Only free the item here so we skip over the old AG earlier.
|
|
*/
|
|
*/
|
|
if (mru)
|
|
if (mru)
|
|
- xfs_fstrm_free_func(mru);
|
|
|
|
|
|
+ xfs_fstrm_free_func(mp, mru);
|
|
|
|
|
|
IRELE(pip);
|
|
IRELE(pip);
|
|
exit:
|
|
exit:
|
|
@@ -426,8 +425,8 @@ xfs_filestream_mount(
|
|
* timer tunable to within about 10 percent. This requires at least 10
|
|
* timer tunable to within about 10 percent. This requires at least 10
|
|
* groups.
|
|
* groups.
|
|
*/
|
|
*/
|
|
- return xfs_mru_cache_create(&mp->m_filestream, xfs_fstrm_centisecs * 10,
|
|
|
|
- 10, xfs_fstrm_free_func);
|
|
|
|
|
|
+ return xfs_mru_cache_create(&mp->m_filestream, mp,
|
|
|
|
+ xfs_fstrm_centisecs * 10, 10, xfs_fstrm_free_func);
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|