Commit 63490e89 authored by Aaron Jacobs's avatar Aaron Jacobs

Use the common response helper.

parent 7a82927f
...@@ -107,8 +107,7 @@ func (o *InitOp) Respond(err error) { ...@@ -107,8 +107,7 @@ func (o *InitOp) Respond(err error) {
resp.MaxReadahead = o.maxReadahead resp.MaxReadahead = o.maxReadahead
// Respond. // Respond.
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.InitRequest).Respond(&resp)
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -152,8 +151,7 @@ func (o *LookUpInodeOp) Respond(err error) { ...@@ -152,8 +151,7 @@ func (o *LookUpInodeOp) Respond(err error) {
resp := bazilfuse.LookupResponse{} resp := bazilfuse.LookupResponse{}
convertChildInodeEntry(&o.Entry, &resp) convertChildInodeEntry(&o.Entry, &resp)
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.LookupRequest).Respond(&resp)
} }
// Refresh the attributes for an inode whose ID was previously returned in a // Refresh the attributes for an inode whose ID was previously returned in a
...@@ -186,8 +184,7 @@ func (o *GetInodeAttributesOp) Respond(err error) { ...@@ -186,8 +184,7 @@ func (o *GetInodeAttributesOp) Respond(err error) {
AttrValid: convertExpirationTime(o.AttributesExpiration), AttrValid: convertExpirationTime(o.AttributesExpiration),
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.GetattrRequest).Respond(&resp)
} }
// Change attributes for an inode. // Change attributes for an inode.
...@@ -226,8 +223,7 @@ func (o *SetInodeAttributesOp) Respond(err error) { ...@@ -226,8 +223,7 @@ func (o *SetInodeAttributesOp) Respond(err error) {
AttrValid: convertExpirationTime(o.AttributesExpiration), AttrValid: convertExpirationTime(o.AttributesExpiration),
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.SetattrRequest).Respond(&resp)
} }
// Decrement the reference count for an inode ID previously issued by the file // Decrement the reference count for an inode ID previously issued by the file
...@@ -287,8 +283,7 @@ func (o *ForgetInodeOp) Respond(err error) { ...@@ -287,8 +283,7 @@ func (o *ForgetInodeOp) Respond(err error) {
return return
} }
o.Logf("-> (ForgetInodeOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.ForgetRequest).Respond()
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -330,8 +325,7 @@ func (o *MkDirOp) Respond(err error) { ...@@ -330,8 +325,7 @@ func (o *MkDirOp) Respond(err error) {
resp := bazilfuse.MkdirResponse{} resp := bazilfuse.MkdirResponse{}
convertChildInodeEntry(&o.Entry, &resp.LookupResponse) convertChildInodeEntry(&o.Entry, &resp.LookupResponse)
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.MkdirRequest).Respond(&resp)
} }
// Create a file inode and open it. // Create a file inode and open it.
...@@ -392,8 +386,7 @@ func (o *CreateFileOp) Respond(err error) { ...@@ -392,8 +386,7 @@ func (o *CreateFileOp) Respond(err error) {
} }
convertChildInodeEntry(&o.Entry, &resp.LookupResponse) convertChildInodeEntry(&o.Entry, &resp.LookupResponse)
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.CreateRequest).Respond(&resp)
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -424,8 +417,7 @@ func (o *RmDirOp) Respond(err error) { ...@@ -424,8 +417,7 @@ func (o *RmDirOp) Respond(err error) {
return return
} }
o.Logf("-> (RmDirOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.RemoveRequest).Respond()
} }
// Unlink a file from its parent. If this brings the inode's link count to // Unlink a file from its parent. If this brings the inode's link count to
...@@ -450,8 +442,7 @@ func (o *UnlinkOp) Respond(err error) { ...@@ -450,8 +442,7 @@ func (o *UnlinkOp) Respond(err error) {
return return
} }
o.Logf("-> (UnlinkOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.RemoveRequest).Respond()
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -496,8 +487,7 @@ func (o *OpenDirOp) Respond(err error) { ...@@ -496,8 +487,7 @@ func (o *OpenDirOp) Respond(err error) {
Handle: bazilfuse.HandleID(o.Handle), Handle: bazilfuse.HandleID(o.Handle),
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.OpenRequest).Respond(&resp)
} }
// Read entries from a directory previously opened with OpenDir. // Read entries from a directory previously opened with OpenDir.
...@@ -602,8 +592,7 @@ func (o *ReadDirOp) Respond(err error) { ...@@ -602,8 +592,7 @@ func (o *ReadDirOp) Respond(err error) {
Data: o.Data, Data: o.Data,
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.ReadRequest).Respond(&resp)
} }
// Release a previously-minted directory handle. The kernel sends this when // Release a previously-minted directory handle. The kernel sends this when
...@@ -631,8 +620,7 @@ func (o *ReleaseDirHandleOp) Respond(err error) { ...@@ -631,8 +620,7 @@ func (o *ReleaseDirHandleOp) Respond(err error) {
return return
} }
o.Logf("-> (ReleaseDirHandleOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.ReleaseRequest).Respond()
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -676,8 +664,7 @@ func (o *OpenFileOp) Respond(err error) { ...@@ -676,8 +664,7 @@ func (o *OpenFileOp) Respond(err error) {
Handle: bazilfuse.HandleID(o.Handle), Handle: bazilfuse.HandleID(o.Handle),
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.OpenRequest).Respond(&resp)
} }
// Read data from a file previously opened with CreateFile or OpenFile. // Read data from a file previously opened with CreateFile or OpenFile.
...@@ -721,8 +708,7 @@ func (o *ReadFileOp) Respond(err error) { ...@@ -721,8 +708,7 @@ func (o *ReadFileOp) Respond(err error) {
Data: o.Data, Data: o.Data,
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.ReadRequest).Respond(&resp)
} }
// Write data to a file previously opened with CreateFile or OpenFile. // Write data to a file previously opened with CreateFile or OpenFile.
...@@ -807,8 +793,7 @@ func (o *WriteFileOp) Respond(err error) { ...@@ -807,8 +793,7 @@ func (o *WriteFileOp) Respond(err error) {
Size: len(o.Data), Size: len(o.Data),
} }
o.Logf("-> %v", &resp) o.commonOp.respond(&resp)
o.r.(*bazilfuse.WriteRequest).Respond(&resp)
} }
// Synchronize the current contents of an open file to storage. // Synchronize the current contents of an open file to storage.
...@@ -843,8 +828,7 @@ func (o *SyncFileOp) Respond(err error) { ...@@ -843,8 +828,7 @@ func (o *SyncFileOp) Respond(err error) {
return return
} }
o.Logf("-> (SyncFileOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.FsyncRequest).Respond()
} }
// Flush the current state of an open file to storage upon closing a file // Flush the current state of an open file to storage upon closing a file
...@@ -910,8 +894,7 @@ func (o *FlushFileOp) Respond(err error) { ...@@ -910,8 +894,7 @@ func (o *FlushFileOp) Respond(err error) {
return return
} }
o.Logf("-> (FlushFileOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.FlushRequest).Respond()
} }
// Release a previously-minted file handle. The kernel calls this when there // Release a previously-minted file handle. The kernel calls this when there
...@@ -939,6 +922,5 @@ func (o *ReleaseFileHandleOp) Respond(err error) { ...@@ -939,6 +922,5 @@ func (o *ReleaseFileHandleOp) Respond(err error) {
return return
} }
o.Logf("-> (ReleaseFileHandleOp) OK") o.commonOp.respond(nil)
o.r.(*bazilfuse.ReleaseRequest).Respond()
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment