Shorter op IDs.

geesefs-0-30-9
Aaron Jacobs 2015-04-29 11:53:17 +10:00
parent a524c3fd67
commit 3e4a8fd488
1 changed files with 7 additions and 5 deletions

View File

@ -30,7 +30,9 @@ type Connection struct {
logger *log.Logger logger *log.Logger
wrapped *bazilfuse.Conn wrapped *bazilfuse.Conn
opsInFlight sync.WaitGroup opsInFlight sync.WaitGroup
nextOpID uint64
// For logging purposes only.
nextOpID uint32
} }
// Responsibility for closing the wrapped connection is transferred to the // Responsibility for closing the wrapped connection is transferred to the
@ -46,10 +48,10 @@ func newConnection(
return return
} }
// Log information for an operation with the given unique ID. calldepth is the // Log information for an operation with the given ID. calldepth is the depth
// depth to use when recovering file:line information with runtime.Caller. // to use when recovering file:line information with runtime.Caller.
func (c *Connection) log( func (c *Connection) log(
opID uint64, opID uint32,
calldepth int, calldepth int,
format string, format string,
v ...interface{}) { v ...interface{}) {
@ -65,7 +67,7 @@ func (c *Connection) log(
// Format the actual message to be printed. // Format the actual message to be printed.
msg := fmt.Sprintf( msg := fmt.Sprintf(
"Op 0x%016x %v:%v] %v", "Op 0x%08x %v:%v] %v",
opID, opID,
path.Base(file), path.Base(file),
line, line,