Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
e00427dc
Commit
e00427dc
authored
Feb 25, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move LoopbackFile.Allocate to linux specific code.
parent
e90b7f3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
fuse/files.go
fuse/files.go
+0
-10
fuse/files_linux.go
fuse/files_linux.go
+15
-0
No files found.
fuse/files.go
View file @
e00427dc
...
...
@@ -193,16 +193,6 @@ func (f *LoopbackFile) GetAttr(a *Attr) Status {
return
OK
}
func
(
f
*
LoopbackFile
)
Allocate
(
off
uint64
,
sz
uint64
,
mode
uint32
)
Status
{
f
.
lock
.
Lock
()
err
:=
syscall
.
Fallocate
(
int
(
f
.
File
.
Fd
()),
mode
,
int64
(
off
),
int64
(
sz
))
f
.
lock
.
Unlock
()
if
err
!=
nil
{
return
ToStatus
(
err
)
}
return
OK
}
////////////////////////////////////////////////////////////////
// ReadOnlyFile is a wrapper that denies writable operations
...
...
fuse/files_linux.go
0 → 100644
View file @
e00427dc
package
fuse
import
(
"syscall"
)
func
(
f
*
LoopbackFile
)
Allocate
(
off
uint64
,
sz
uint64
,
mode
uint32
)
Status
{
f
.
lock
.
Lock
()
err
:=
syscall
.
Fallocate
(
int
(
f
.
File
.
Fd
()),
mode
,
int64
(
off
),
int64
(
sz
))
f
.
lock
.
Unlock
()
if
err
!=
nil
{
return
ToStatus
(
err
)
}
return
OK
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment