diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-06-20 01:51:09 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-06-20 02:38:07 +0000 |
commit | 16e31f8dce64323fdef6151a30756ce2bc770a88 (patch) | |
tree | 9dd368a9b0e0cd80283652e5477b6fc1ab0e9722 /mgmt.c | |
parent | 91cb86eb03d828bda8a4ac9cd0c3edbac73418af (diff) | |
download | cmogstored-wip-1.3.tar.gz |
Simply releasing the descriptor triggering ENOSPC/ENOMEM errors from epoll_ctl and kevent is not good enough, as those descriptors may have other descriptors (e.g. files to be served) hanging off of them.
Diffstat (limited to 'mgmt.c')
-rw-r--r-- | mgmt.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -82,6 +82,16 @@ MOG_NOINLINE static void mgmt_close(struct mog_fd *mfd) mog_fd_put(mfd); } +/* called if epoll/kevent is out-of-space */ +void mog_mgmt_drop(struct mog_fd *mfd) +{ + struct mog_mgmt *mgmt = &mfd->as.mgmt; + + if (mgmt->forward && mgmt->forward != MOG_IOSTAT) + mog_file_close(mgmt->forward); + mgmt_close(mfd); +} + void mog_mgmt_writev(struct mog_mgmt *mgmt, struct iovec *iov, int iovcnt) { struct mog_fd *mfd = mog_fd_of(mgmt); |