/
fsop.go
745 lines (625 loc) · 20.5 KB
/
fsop.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
/*
* fsop.go
*
* Copyright 2017 Bill Zissimopoulos
*/
/*
* This file is part of Cgofuse.
*
* It is licensed under the MIT license. The full license text can be found
* in the License.txt file at the root of this project.
*/
// Package fuse allows the creation of user mode file systems in Go.
//
// A user mode file system is a user mode process that receives file system operations
// from the OS FUSE layer and satisfies them in user mode. A user mode file system
// implements the interface FileSystemInterface either directly or by embedding a
// FileSystemBase struct which provides a default (empty) implementation of all methods
// in FileSystemInterface.
//
// In order to expose the user mode file system to the OS, the file system must be hosted
// (mounted) by a FileSystemHost. The FileSystemHost Mount() method is used for this
// purpose.
package fuse
/*
#if !(defined(__APPLE__) || defined(__linux__) || defined(_WIN32))
#error platform not supported
#endif
#if defined(__APPLE__) || defined(__linux__)
#include <errno.h>
#include <fcntl.h>
#elif defined(_WIN32)
#define EPERM 1
#define ENOENT 2
#define ESRCH 3
#define EINTR 4
#define EIO 5
#define ENXIO 6
#define E2BIG 7
#define ENOEXEC 8
#define EBADF 9
#define ECHILD 10
#define EAGAIN 11
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
#define ENODEV 19
#define ENOTDIR 20
#define EISDIR 21
#define ENFILE 23
#define EMFILE 24
#define ENOTTY 25
#define EFBIG 27
#define ENOSPC 28
#define ESPIPE 29
#define EROFS 30
#define EMLINK 31
#define EPIPE 32
#define EDOM 33
#define EDEADLK 36
#define ENAMETOOLONG 38
#define ENOLCK 39
#define ENOSYS 40
#define ENOTEMPTY 41
#define EINVAL 22
#define ERANGE 34
#define EILSEQ 42
#define EADDRINUSE 100
#define EADDRNOTAVAIL 101
#define EAFNOSUPPORT 102
#define EALREADY 103
#define EBADMSG 104
#define ECANCELED 105
#define ECONNABORTED 106
#define ECONNREFUSED 107
#define ECONNRESET 108
#define EDESTADDRREQ 109
#define EHOSTUNREACH 110
#define EIDRM 111
#define EINPROGRESS 112
#define EISCONN 113
#define ELOOP 114
#define EMSGSIZE 115
#define ENETDOWN 116
#define ENETRESET 117
#define ENETUNREACH 118
#define ENOBUFS 119
#define ENODATA 120
#define ENOLINK 121
#define ENOMSG 122
#define ENOPROTOOPT 123
#define ENOSR 124
#define ENOSTR 125
#define ENOTCONN 126
#define ENOTRECOVERABLE 127
#define ENOTSOCK 128
#define ENOTSUP 129
#define EOPNOTSUPP 130
#define EOTHER 131
#define EOVERFLOW 132
#define EOWNERDEAD 133
#define EPROTO 134
#define EPROTONOSUPPORT 135
#define EPROTOTYPE 136
#define ETIME 137
#define ETIMEDOUT 138
#define ETXTBSY 139
#define EWOULDBLOCK 140
#include <fcntl.h>
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR
#define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT
#define O_EXCL _O_EXCL
#define O_TRUNC _O_TRUNC
#if !defined(O_ACCMODE)
#define O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
#endif
#endif
#if defined(__linux__) || defined(_WIN32)
// incantation needed for cgo to figure out "kind of name" for ENOATTR
#define ENOATTR ((int)ENODATA)
#endif
#if defined(__APPLE__) || defined(__linux__)
#include <sys/xattr.h>
#elif defined(_WIN32)
#define XATTR_CREATE 1
#define XATTR_REPLACE 2
#endif
*/
import "C"
import (
"strconv"
"time"
)
const (
E2BIG = int(C.E2BIG)
EACCES = int(C.EACCES)
EADDRINUSE = int(C.EADDRINUSE)
EADDRNOTAVAIL = int(C.EADDRNOTAVAIL)
EAFNOSUPPORT = int(C.EAFNOSUPPORT)
EAGAIN = int(C.EAGAIN)
EALREADY = int(C.EALREADY)
EBADF = int(C.EBADF)
EBADMSG = int(C.EBADMSG)
EBUSY = int(C.EBUSY)
ECANCELED = int(C.ECANCELED)
ECHILD = int(C.ECHILD)
ECONNABORTED = int(C.ECONNABORTED)
ECONNREFUSED = int(C.ECONNREFUSED)
ECONNRESET = int(C.ECONNRESET)
EDEADLK = int(C.EDEADLK)
EDESTADDRREQ = int(C.EDESTADDRREQ)
EDOM = int(C.EDOM)
EEXIST = int(C.EEXIST)
EFAULT = int(C.EFAULT)
EFBIG = int(C.EFBIG)
EHOSTUNREACH = int(C.EHOSTUNREACH)
EIDRM = int(C.EIDRM)
EILSEQ = int(C.EILSEQ)
EINPROGRESS = int(C.EINPROGRESS)
EINTR = int(C.EINTR)
EINVAL = int(C.EINVAL)
EIO = int(C.EIO)
EISCONN = int(C.EISCONN)
EISDIR = int(C.EISDIR)
ELOOP = int(C.ELOOP)
EMFILE = int(C.EMFILE)
EMLINK = int(C.EMLINK)
EMSGSIZE = int(C.EMSGSIZE)
ENAMETOOLONG = int(C.ENAMETOOLONG)
ENETDOWN = int(C.ENETDOWN)
ENETRESET = int(C.ENETRESET)
ENETUNREACH = int(C.ENETUNREACH)
ENFILE = int(C.ENFILE)
ENOATTR = int(C.ENOATTR)
ENOBUFS = int(C.ENOBUFS)
ENODATA = int(C.ENODATA)
ENODEV = int(C.ENODEV)
ENOENT = int(C.ENOENT)
ENOEXEC = int(C.ENOEXEC)
ENOLCK = int(C.ENOLCK)
ENOLINK = int(C.ENOLINK)
ENOMEM = int(C.ENOMEM)
ENOMSG = int(C.ENOMSG)
ENOPROTOOPT = int(C.ENOPROTOOPT)
ENOSPC = int(C.ENOSPC)
ENOSR = int(C.ENOSR)
ENOSTR = int(C.ENOSTR)
ENOSYS = int(C.ENOSYS)
ENOTCONN = int(C.ENOTCONN)
ENOTDIR = int(C.ENOTDIR)
ENOTEMPTY = int(C.ENOTEMPTY)
ENOTRECOVERABLE = int(C.ENOTRECOVERABLE)
ENOTSOCK = int(C.ENOTSOCK)
ENOTSUP = int(C.ENOTSUP)
ENOTTY = int(C.ENOTTY)
ENXIO = int(C.ENXIO)
EOPNOTSUPP = int(C.EOPNOTSUPP)
EOVERFLOW = int(C.EOVERFLOW)
EOWNERDEAD = int(C.EOWNERDEAD)
EPERM = int(C.EPERM)
EPIPE = int(C.EPIPE)
EPROTO = int(C.EPROTO)
EPROTONOSUPPORT = int(C.EPROTONOSUPPORT)
EPROTOTYPE = int(C.EPROTOTYPE)
ERANGE = int(C.ERANGE)
EROFS = int(C.EROFS)
ESPIPE = int(C.ESPIPE)
ESRCH = int(C.ESRCH)
ETIME = int(C.ETIME)
ETIMEDOUT = int(C.ETIMEDOUT)
ETXTBSY = int(C.ETXTBSY)
EWOULDBLOCK = int(C.EWOULDBLOCK)
EXDEV = int(C.EXDEV)
)
const (
O_RDONLY = int(C.O_RDONLY)
O_WRONLY = int(C.O_WRONLY)
O_RDWR = int(C.O_RDWR)
O_APPEND = int(C.O_APPEND)
O_CREAT = int(C.O_CREAT)
O_EXCL = int(C.O_EXCL)
O_TRUNC = int(C.O_TRUNC)
O_ACCMODE = int(C.O_ACCMODE)
)
const (
S_IFMT = 0170000
S_IFBLK = 0060000
S_IFCHR = 0020000
S_IFIFO = 0010000
S_IFREG = 0100000
S_IFDIR = 0040000
S_IFLNK = 0120000
S_IFSOCK = 0140000
S_IRWXU = 00700
S_IRUSR = 00400
S_IWUSR = 00200
S_IXUSR = 00100
S_IRWXG = 00070
S_IRGRP = 00040
S_IWGRP = 00020
S_IXGRP = 00010
S_IRWXO = 00007
S_IROTH = 00004
S_IWOTH = 00002
S_IXOTH = 00001
S_ISUID = 04000
S_ISGID = 02000
S_ISVTX = 01000
)
const (
XATTR_CREATE = int(C.XATTR_CREATE)
XATTR_REPLACE = int(C.XATTR_REPLACE)
)
// Timespec contains a time as the UNIX time in seconds and nanoseconds.
// This structure is analogous to the POSIX struct timespec.
type Timespec struct {
Sec int64
Nsec int64
}
// NewTimespec creates a Timespec from a time.Time.
func NewTimespec(t time.Time) Timespec {
return Timespec{t.Unix(), int64(t.Nanosecond())}
}
// Now creates a Timespec that contains the current time.
func Now() Timespec {
return NewTimespec(time.Now())
}
// Time returns the Timespec as a time.Time.
func (ts *Timespec) Time() time.Time {
return time.Unix(ts.Sec, ts.Nsec)
}
// Statfs_t contains file system information.
// This structure is analogous to the POSIX struct statvfs (NOT struct statfs).
// Not all fields are honored by all FUSE implementations.
type Statfs_t struct {
// File system block size.
Bsize uint64
// Fundamental file system block size.
Frsize uint64
// Total number of blocks on file system in units of Frsize.
Blocks uint64
// Total number of free blocks.
Bfree uint64
// Number of free blocks available to non-privileged process.
Bavail uint64
// Total number of file serial numbers.
Files uint64
// Total number of free file serial numbers.
Ffree uint64
// Number of file serial numbers available to non-privileged process.
Favail uint64
// File system ID. [IGNORED]
Fsid uint64
// Bit mask of Flag values. [IGNORED]
Flag uint64
// Maximum filename length.
Namemax uint64
}
// Stat_t contains file metadata information.
// This structure is analogous to the POSIX struct stat.
// Not all fields are honored by all FUSE implementations.
type Stat_t struct {
// Device ID of device containing file. [IGNORED]
Dev uint64
// File serial number. [IGNORED unless the use_ino mount option is given.]
Ino uint64
// Mode of file.
Mode uint32
// Number of hard links to the file.
Nlink uint32
// User ID of file.
Uid uint32
// Group ID of file.
Gid uint32
// Device ID (if file is character or block special).
Rdev uint64
// For regular files, the file size in bytes.
// For symbolic links, the length in bytes of the
// pathname contained in the symbolic link.
Size int64
// Last data access timestamp.
Atim Timespec
// Last data modification timestamp.
Mtim Timespec
// Last file status change timestamp.
Ctim Timespec
// A file system-specific preferred I/O block size for this object.
Blksize int64
// Number of blocks allocated for this object.
Blocks int64
// File creation (birth) timestamp. [OSX only]
Birthtim Timespec
}
/*
// Lock_t contains file locking information.
// This structure is analogous to the POSIX struct flock.
type Lock_t struct {
// Type of lock; F_RDLCK, F_WRLCK, F_UNLCK.
Type int16
// Flag for starting offset.
Whence int16
// Relative offset in bytes.
Start int64
// Size; if 0 then until EOF.
Len int64
// Process ID of the process holding the lock
Pid int
}
*/
// FileSystemInterface is the interface that a user mode interface must implement.
//
// The file system will receive an Init() call when the file system is created;
// the Init() call will happen prior to receiving any other file system calls.
// Note that there are no guarantees on the exact timing of when Init() is called.
// For example, it cannot be assumed that the file system is mounted at the time
// the Init() call is received.
//
// The file system will receive a Destroy() call when the file system is destroyed;
// the Destroy() call will always be the last call to be received by the file system.
// Note that depending on how the file system is terminated the file system may not
// receive the Destroy() call. For example, it will not receive the Destroy() call
// if the file system process is forcibly killed.
//
// Except for Init() and Destroy() all file system operations must return 0 on success
// or a FUSE error on failure. To return an error return the NEGATIVE value of a
// particular error. For example, to report "file not found" return -fuse.ENOENT.
type FileSystemInterface interface {
// Init is called when the file system is created.
Init()
// Destroy is called when the file system is destroyed.
Destroy()
// Statfs gets file system statistics.
Statfs(path string, stat *Statfs_t) int
// Mknod creates a file node.
Mknod(path string, mode uint32, dev uint64) int
// Mkdir creates a directory.
Mkdir(path string, mode uint32) int
// Unlink removes a file.
Unlink(path string) int
// Rmdir removes a directory.
Rmdir(path string) int
// Link creates a hard link to a file.
Link(oldpath string, newpath string) int
// Symlink creates a symbolic link.
Symlink(target string, newpath string) int
// Readlink reads the target of a symbolic link.
Readlink(path string) (int, string)
// Rename renames a file.
Rename(oldpath string, newpath string) int
// Chmod changes the permission bits of a file.
Chmod(path string, mode uint32) int
// Chown changes the owner and group of a file.
Chown(path string, uid uint32, gid uint32) int
// Utimens changes the access and modification times of a file.
Utimens(path string, tmsp []Timespec) int
// Access checks file access permissions.
Access(path string, mask uint32) int
// Create creates and opens a file.
Create(path string, flags int, mode uint32) (int, uint64)
// Open opens a file.
Open(path string, flags int) (int, uint64)
// Getattr gets file attributes.
Getattr(path string, stat *Stat_t, fh uint64) int
// Truncate changes the size of a file.
Truncate(path string, size int64, fh uint64) int
// Read reads data from a file.
Read(path string, buff []byte, ofst int64, fh uint64) int
// Write writes data to a file.
Write(path string, buff []byte, ofst int64, fh uint64) int
// Flush flushes cached file data.
Flush(path string, fh uint64) int
// Release closes an open file.
Release(path string, fh uint64) int
// Fsync synchronizes file contents.
Fsync(path string, datasync bool, fh uint64) int
// Lock performs a file locking operation.
//Lock(path string, cmd int, lock *Lock_t, fh uint64) int
// Opendir opens a directory.
Opendir(path string) (int, uint64)
// Readdir reads a directory.
Readdir(path string,
fill func(name string, stat *Stat_t, ofst int64) bool,
ofst int64,
fh uint64) int
// Releasedir closes an open directory.
Releasedir(path string, fh uint64) int
// Fsyncdir synchronizes directory contents.
Fsyncdir(path string, datasync bool, fh uint64) int
// Setxattr sets extended attributes.
Setxattr(path string, name string, value []byte, flags int) int
// Getxattr gets extended attributes.
Getxattr(path string, name string) (int, []byte)
// Removexattr removes extended attributes.
Removexattr(path string, name string) int
// Listxattr lists extended attributes.
Listxattr(path string, fill func(name string) bool) int
}
// Error encapsulates a FUSE error code. In some rare circumstances it is useful
// to signal an error to the FUSE layer by boxing the error code using Error and
// calling panic(). The FUSE layer will recover and report the boxed error code
// to the OS.
type Error int
func (self Error) Error() string {
return "fuse.Error(" + strconv.Itoa(int(self)) + ")"
}
var _ error = (*Error)(nil)
// FileSystemBase provides default implementations of the methods in FileSystemInterface.
// The default implementations are either empty or return -ENOSYS to signal that the
// file system does not implement a particular operation to the FUSE layer.
type FileSystemBase struct {
}
// Init is called when the file system is created.
// The FileSystemBase implementation does nothing.
func (*FileSystemBase) Init() {
}
// Destroy is called when the file system is destroyed.
// The FileSystemBase implementation does nothing.
func (*FileSystemBase) Destroy() {
}
// Statfs gets file system statistics.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Statfs(path string, stat *Statfs_t) int {
return -ENOSYS
}
// Mknod creates a file node.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Mknod(path string, mode uint32, dev uint64) int {
return -ENOSYS
}
// Mkdir creates a directory.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Mkdir(path string, mode uint32) int {
return -ENOSYS
}
// Unlink removes a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Unlink(path string) int {
return -ENOSYS
}
// Rmdir removes a directory.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Rmdir(path string) int {
return -ENOSYS
}
// Link creates a hard link to a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Link(oldpath string, newpath string) int {
return -ENOSYS
}
// Symlink creates a symbolic link.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Symlink(target string, newpath string) int {
return -ENOSYS
}
// Readlink reads the target of a symbolic link.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Readlink(path string) (int, string) {
return -ENOSYS, ""
}
// Rename renames a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Rename(oldpath string, newpath string) int {
return -ENOSYS
}
// Chmod changes the permission bits of a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Chmod(path string, mode uint32) int {
return -ENOSYS
}
// Chown changes the owner and group of a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Chown(path string, uid uint32, gid uint32) int {
return -ENOSYS
}
// Utimens changes the access and modification times of a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Utimens(path string, tmsp []Timespec) int {
return -ENOSYS
}
// Access checks file access permissions.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Access(path string, mask uint32) int {
return -ENOSYS
}
// Create creates and opens a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Create(path string, flags int, mode uint32) (int, uint64) {
return -ENOSYS, ^uint64(0)
}
// Open opens a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Open(path string, flags int) (int, uint64) {
return -ENOSYS, ^uint64(0)
}
// Getattr gets file attributes.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Getattr(path string, stat *Stat_t, fh uint64) int {
return -ENOSYS
}
// Truncate changes the size of a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Truncate(path string, size int64, fh uint64) int {
return -ENOSYS
}
// Read reads data from a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Read(path string, buff []byte, ofst int64, fh uint64) int {
return -ENOSYS
}
// Write writes data to a file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Write(path string, buff []byte, ofst int64, fh uint64) int {
return -ENOSYS
}
// Flush flushes cached file data.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Flush(path string, fh uint64) int {
return -ENOSYS
}
// Release closes an open file.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Release(path string, fh uint64) int {
return -ENOSYS
}
// Fsync synchronizes file contents.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Fsync(path string, datasync bool, fh uint64) int {
return -ENOSYS
}
/*
// Lock performs a file locking operation.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Lock(path string, cmd int, lock *Lock_t, fh uint64) int {
return -ENOSYS
}
*/
// Opendir opens a directory.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Opendir(path string) (int, uint64) {
return -ENOSYS, ^uint64(0)
}
// Readdir reads a directory.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Readdir(path string,
fill func(name string, stat *Stat_t, ofst int64) bool,
ofst int64,
fh uint64) int {
return -ENOSYS
}
// Releasedir closes an open directory.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Releasedir(path string, fh uint64) int {
return -ENOSYS
}
// Fsyncdir synchronizes directory contents.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Fsyncdir(path string, datasync bool, fh uint64) int {
return -ENOSYS
}
// Setxattr sets extended attributes.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Setxattr(path string, name string, value []byte, flags int) int {
return -ENOSYS
}
// Getxattr gets extended attributes.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Getxattr(path string, name string) (int, []byte) {
return -ENOSYS, nil
}
// Removexattr removes extended attributes.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Removexattr(path string, name string) int {
return -ENOSYS
}
// Listxattr lists extended attributes.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Listxattr(path string, fill func(name string) bool) int {
return -ENOSYS
}
var _ FileSystemInterface = (*FileSystemBase)(nil)