diff options
Diffstat (limited to 'hw/9pfs/codir.c')
-rw-r--r-- | hw/9pfs/codir.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 86adc87adc..f17f927c10 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -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; } |