Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
84c827f9
Commit
84c827f9
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using fuseops.Header in memfs.
parent
591350f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
samples/memfs/memfs.go
samples/memfs/memfs.go
+15
-12
No files found.
samples/memfs/memfs.go
View file @
84c827f9
...
@@ -30,6 +30,10 @@ import (
...
@@ -30,6 +30,10 @@ import (
type
memFS
struct
{
type
memFS
struct
{
fuseutil
.
NotImplementedFileSystem
fuseutil
.
NotImplementedFileSystem
// The UID and GID that every inode receives.
uid
uint32
gid
uint32
/////////////////////////
/////////////////////////
// Dependencies
// Dependencies
/////////////////////////
/////////////////////////
...
@@ -74,6 +78,8 @@ func NewMemFS(
...
@@ -74,6 +78,8 @@ func NewMemFS(
fs
:=
&
memFS
{
fs
:=
&
memFS
{
clock
:
clock
,
clock
:
clock
,
inodes
:
make
([]
*
inode
,
fuseops
.
RootInodeID
+
1
),
inodes
:
make
([]
*
inode
,
fuseops
.
RootInodeID
+
1
),
uid
:
uid
,
gid
:
gid
,
}
}
// Set up the root inode.
// Set up the root inode.
...
@@ -268,13 +274,12 @@ func (fs *memFS) MkDir(
...
@@ -268,13 +274,12 @@ func (fs *memFS) MkDir(
return
return
}
}
// Set up attributes from the child, using the credentials of the calling
// Set up attributes from the child.
// process as owner (matching inode_init_owner, cf. http://goo.gl/5qavg8).
childAttrs
:=
fuseops
.
InodeAttributes
{
childAttrs
:=
fuseops
.
InodeAttributes
{
Nlink
:
1
,
Nlink
:
1
,
Mode
:
op
.
Mode
,
Mode
:
op
.
Mode
,
Uid
:
op
.
Header
()
.
U
id
,
Uid
:
fs
.
u
id
,
Gid
:
op
.
Header
()
.
G
id
,
Gid
:
fs
.
g
id
,
}
}
// Allocate a child.
// Allocate a child.
...
@@ -311,8 +316,7 @@ func (fs *memFS) CreateFile(
...
@@ -311,8 +316,7 @@ func (fs *memFS) CreateFile(
return
return
}
}
// Set up attributes from the child, using the credentials of the calling
// Set up attributes from the child.
// process as owner (matching inode_init_owner, cf. http://goo.gl/5qavg8).
now
:=
fs
.
clock
.
Now
()
now
:=
fs
.
clock
.
Now
()
childAttrs
:=
fuseops
.
InodeAttributes
{
childAttrs
:=
fuseops
.
InodeAttributes
{
Nlink
:
1
,
Nlink
:
1
,
...
@@ -321,8 +325,8 @@ func (fs *memFS) CreateFile(
...
@@ -321,8 +325,8 @@ func (fs *memFS) CreateFile(
Mtime
:
now
,
Mtime
:
now
,
Ctime
:
now
,
Ctime
:
now
,
Crtime
:
now
,
Crtime
:
now
,
Uid
:
op
.
Header
()
.
U
id
,
Uid
:
fs
.
u
id
,
Gid
:
op
.
Header
()
.
G
id
,
Gid
:
fs
.
g
id
,
}
}
// Allocate a child.
// Allocate a child.
...
@@ -361,8 +365,7 @@ func (fs *memFS) CreateSymlink(
...
@@ -361,8 +365,7 @@ func (fs *memFS) CreateSymlink(
return
return
}
}
// Set up attributes from the child, using the credentials of the calling
// Set up attributes from the child.
// process as owner (matching inode_init_owner, cf. http://goo.gl/5qavg8).
now
:=
fs
.
clock
.
Now
()
now
:=
fs
.
clock
.
Now
()
childAttrs
:=
fuseops
.
InodeAttributes
{
childAttrs
:=
fuseops
.
InodeAttributes
{
Nlink
:
1
,
Nlink
:
1
,
...
@@ -371,8 +374,8 @@ func (fs *memFS) CreateSymlink(
...
@@ -371,8 +374,8 @@ func (fs *memFS) CreateSymlink(
Mtime
:
now
,
Mtime
:
now
,
Ctime
:
now
,
Ctime
:
now
,
Crtime
:
now
,
Crtime
:
now
,
Uid
:
op
.
Header
()
.
U
id
,
Uid
:
fs
.
u
id
,
Gid
:
op
.
Header
()
.
G
id
,
Gid
:
fs
.
g
id
,
}
}
// Allocate a child.
// Allocate a child.
...
...
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