Commit Graph

6 Commits

Author SHA1 Message Date
Sven Anderson 87041ee7d8 gofmt: reformat everything with new gofmt of go 1.19
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-02-20 20:50:24 +00:00
John Mulligan 807eafb9d5 cephfs: add ReadDirPlus function and associated types
Add the ReadDirPlus function call, wrapping ceph_readdirplus_r. Add
DirEntryPlus which is a DirEntry plus a getter for the statx field.
Add a test similar to the ReadDir test and (since it is possible to
induce an error with ceph_readdirplus_r) a test for the error handling
path to improve code coverage.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-19 16:35:58 -04:00
John Mulligan fde15e439e cephfs: add DType type and getter function for directory entries
CephFS returns Linux-style struct dirent that has a d_type field.
It appears to properly make use of the field. This change exposes
the field using a DType type and associated constants as well
as a DType() function for the DirEntry.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-30 12:54:37 -04:00
John Mulligan 9f6d4d48bb cephfs: add a RewindDir and List function for simpler dir listings
The RewindDir is used by List and can be used independently. It
resets the open dir to the "start".
The List function and the accompanying DirEntries type allow one
to simply grab all the dir entries at once. The Names method on the
DirEntries type allows the user to get the most commonly wanted items
from the dir entries in one shot.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-09 11:18:08 -04:00
John Mulligan fd275e2b9a cephfs: add ReadDir implementing ceph_readdir_r function
Adds a method to ReadDir that implements ceph_readdir_r returning
a single dir entry at at time.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-09 11:18:08 -04:00
John Mulligan e98648f76f cephfs: add Directory type and funcs to open and close it
Add the Directory type and the OpenDir function to get an open
Directory and a Close function to close/free it.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-09 11:18:08 -04:00