hw/9pfs: Add directory reclaim support

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
Aneesh Kumar K.V 2011-05-18 17:08:34 +05:30
parent 9b54ffaab2
commit 95f65511c3
2 changed files with 38 additions and 2 deletions

View file

@ -97,6 +97,12 @@ int v9fs_co_opendir(V9fsState *s, V9fsFidState *fidp)
err = 0;
}
});
if (!err) {
total_open_fd++;
if (total_open_fd > open_fd_hw) {
v9fs_reclaim_fd(s);
}
}
return err;
}
@ -111,5 +117,8 @@ int v9fs_co_closedir(V9fsState *s, DIR *dir)
err = -errno;
}
});
if (!err) {
total_open_fd--;
}
return err;
}