Commit Graph

12 Commits

Author SHA1 Message Date
Riya Singhal 2852a13c88 cephfs: made ENOENT a public error
this commit renames ErrNoEntry of cephfs
to ErrNotExist and making it public allowing
other projects to access this.

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
2023-11-09 15:10:14 +00:00
John Mulligan 33e84bc9c5 cephfs: use FormatErrorCode for formatting cephfs errors
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-08-10 13:03:24 -04:00
John Mulligan 1ecac966de cephfs: rename error types Errno method to ErrorCode
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-08-10 13:03:24 -04:00
John Mulligan a9738e7d45 cephfs: add file SetXattr and GetXattr functions
Add SetXattr implementing ceph_fsetxattr.
Add GetXattr implementing ceph_fgetxattr.
Add test function to exercise both.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-07-24 13:42:35 -04:00
John Mulligan 65227dd4d4 cephfs: add a getErrorIfNegative helper func
Works like the ones already in the other packages.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-07-24 13:42:35 -04:00
John Mulligan bf0e4723e2 cephfs: add error for function args that must have data
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-07-24 09:54:04 -04:00
Sven Anderson 8b45a01b7d cephfs: make CephFSError type unexported
In order to avoid external dependencies on implementation details,
this change replaces CephFSError with the unexported cephFSError. In case
some application really needs access to the integer value, it can use
the pattern
  var errno interface{ Errno() int }
  if errors.As(err, errno) { ... errno.Errno() ... }

Signed-off-by: Sven Anderson <sven@redhat.com>
2020-07-17 13:47:32 -04:00
John Mulligan d4079e3949 cephfs: add path based Statx function implmenting ceph_statx
Add a Statx wrapper for ceph_statx.
Add a type wrapping the statx status info that exposes the various
fields from the C-struct.
Add a type wrapping struct timespec, based on golang's x/sys, for the
time fields in the struct.
Note that the ceph struct is not the same as the linux statx struct.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-07 13:44:19 -04:00
John Mulligan 1899072b27 cephfs: add additional error handling and state checks to file funcs
Now, the close function is idempotent wrt being called multiple times
on a valid file. Additionally, check the state of the file in various
functions to produce sensible errors, matching those cephfs itself
returns, if the object was not constructed properly.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-28 17:49:49 +02:00
John Mulligan 854a834b1c cephfs: implement file IO functions for open/close/read/write/seek
Implement core file I/O functions based on a file handle wrapper.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-28 17:49:49 +02:00
Sven Anderson e8da761769 update various parts of the code to use the retry lib.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: Sven Anderson <sven@redhat.com>
2020-04-20 15:08:36 -04:00
John Mulligan f584aef60f cephfs: consolidate error types & values in an errors.go file
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-06 17:10:09 -04:00