Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update fd.go for glusterfs 6 changed API #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gfapi/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
//
// The gfapi.File implements the same interfaces as os.File, and can be used wherever os.File is used.
// XXX: Acutally verify this.
package gfapi //import "github.com/gluster/gogfapi/gfapi"
package gfapi //import "github.com/xuzhipeng12/gogfapi/gfapi"
10 changes: 5 additions & 5 deletions gfapi/fd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (fd *Fd) Fstat(stat *syscall.Stat_t) error {
//
// Returns error on failure
func (fd *Fd) Fsync() error {
ret, err := C.glfs_fsync(fd.fd)
ret, err := C.glfs_fsync(fd.fd, nil, nil)
if ret < 0 {
return err
}
Expand All @@ -56,7 +56,7 @@ func (fd *Fd) Fsync() error {
//
// Returns error on failure
func (fd *Fd) Ftruncate(size int64) error {
_, err := C.glfs_ftruncate(fd.fd, C.off_t(size))
_, err := C.glfs_ftruncate(fd.fd, C.off_t(size), nil, nil)

return err
}
Expand All @@ -65,7 +65,7 @@ func (fd *Fd) Ftruncate(size int64) error {
//
// Returns number of bytes read on success and error on failure
func (fd *Fd) Pread(b []byte, off int64) (int, error) {
n, err := C.glfs_pread(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0)
n, err := C.glfs_pread(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0, nil)

return int(n), err
}
Expand All @@ -74,7 +74,7 @@ func (fd *Fd) Pread(b []byte, off int64) (int, error) {
//
// Returns number of bytes written on success and error on failure
func (fd *Fd) Pwrite(b []byte, off int64) (int, error) {
n, err := C.glfs_pwrite(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0)
n, err := C.glfs_pwrite(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0, nil, nil)

return int(n), err
}
Expand Down Expand Up @@ -258,4 +258,4 @@ func (fd *Fd) Readdirnames(n int) ([]string, error) {
}

return names, nil
}
}