MCPcopy Index your code
hub / github.com/syncthing/syncthing / WriteAt

Method WriteAt

lib/model/sharedpullerstate.go:108–112  ·  view source on GitHub ↗

WriteAt itself is goroutine safe, thus just needs to acquire a read-lock to prevent closing concurrently (see SyncClose).

(p []byte, off int64)

Source from the content-addressed store, hash-verified

106// WriteAt itself is goroutine safe, thus just needs to acquire a read-lock to
107// prevent closing concurrently (see SyncClose).
108func (w *lockedWriterAt) WriteAt(p []byte, off int64) (n int, err error) {
109 w.mut.RLock()
110 defer w.mut.RUnlock()
111 return w.fd.WriteAt(p, off)
112}
113
114// SyncClose ensures that no more writes are happening before going ahead and
115// syncing and closing the fd, thus needs to acquire a write-lock.

Callers 2

writeEncryptionTrailerFunction · 0.45
limitedWriteAtMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected