diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-05-18 17:08:34 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-25 20:16:42 +0530 |
commit | 95f65511c36fe4e2b319de4551f8a5657a63b67f (patch) | |
tree | e19d21e72100bbbda5015778ae4fdf802c44c02f /hw/9pfs/codir.c | |
parent | 9b54ffaab2e7cd09e7da47a9dc9b8f746ebcfe1b (diff) |
hw/9pfs: Add directory reclaim support
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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; } |