client: unmount cleanup

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This commit is contained in:
Sage Weil 2011-12-07 21:05:40 -08:00
parent f3c90f8d16
commit 1545d03c5a

View File

@ -3292,18 +3292,12 @@ void Client::unmount()
put_inode(cwd);
cwd = NULL;
// NOTE: i'm assuming all caches are already flushing (because all files are closed).
// clean up any unclosed files
if (!fd_map.empty())
ldout(cct, 0) << "Warning: Some files were not closed prior to unmounting; closing them now" << dendl;
while (!fd_map.empty()) {
int fd = fd_map.begin()->first;
assert(fd_map.count(fd));
Fh *fh = fd_map[fd];
Fh *fh = fd_map.begin()->second;
fd_map.erase(fd_map.begin());
ldout(cct, 0) << " destroying lost open file " << fh << " on " << *fh->inode << dendl;
_release_fh(fh);
fd_map.erase(fd);
}
_ll_drop_pins();