addToCache add fd to cache
(fd *os.File, cleanPath string)
| 106 | |
| 107 | // addToCache add fd to cache |
| 108 | func (fdm *FdManager) AddToCache(fd *os.File, cleanPath string) { |
| 109 | fdInfo := &FdInfo{ |
| 110 | fd: fd, |
| 111 | using: 1, |
| 112 | path: cleanPath, |
| 113 | } |
| 114 | fdm.fdList.addNode(fdInfo) |
| 115 | fdm.size++ |
| 116 | fdm.Cache[cleanPath] = fdInfo |
| 117 | } |
| 118 | |
| 119 | // reduceUsing when RWManager object close, it will go through this method let fdm know it return the fd to cache |
| 120 | func (fdm *FdManager) ReduceUsing(path string) { |