package mount import ( "errors" "github.com/seaweedfs/seaweedfs/weed/mount/page_writer" ) // refusingDirtyPages buffers the chunks below limit and refuses the pages of // any later one, the way the dirty pages fail a write they cannot keep. type refusingDirtyPages struct { page_writer.DirtyPages limit int64 } func (r *refusingDirtyPages) AddPage(offset int64, data []byte, isSequential bool, tsNs int64) (int, error) { if offset >= r.limit { return 0, errors.New("dirty pages refused the page") } return r.DirtyPages.AddPage(offset, data, isSequential, tsNs) }