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
Kirill Smelkov
go-fuse
Commits
d4e694da
Commit
d4e694da
authored
May 18, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass destination attribute to File.GetAttr.
parent
83e93502
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
22 deletions
+23
-22
fuse/api.go
fuse/api.go
+1
-1
fuse/defaultfile.go
fuse/defaultfile.go
+2
-2
fuse/files.go
fuse/files.go
+9
-6
fuse/memnode.go
fuse/memnode.go
+4
-3
fuse/pathfs.go
fuse/pathfs.go
+1
-2
unionfs/unionfs.go
unionfs/unionfs.go
+6
-8
No files found.
fuse/api.go
View file @
d4e694da
...
...
@@ -170,7 +170,7 @@ type File interface {
// The methods below may be called on closed files, due to
// concurrency. In that case, you should return EBADF.
Truncate
(
size
uint64
)
Status
GetAttr
(
)
(
*
Attr
,
Status
)
GetAttr
(
out
*
Attr
)
(
Status
)
Chown
(
uid
uint32
,
gid
uint32
)
Status
Chmod
(
perms
uint32
)
Status
Utimens
(
atimeNs
int64
,
mtimeNs
int64
)
Status
...
...
fuse/defaultfile.go
View file @
d4e694da
...
...
@@ -35,8 +35,8 @@ func (f *DefaultFile) Release() {
}
func
(
f
*
DefaultFile
)
GetAttr
(
)
(
*
Attr
,
Status
)
{
return
nil
,
ENOSYS
func
(
f
*
DefaultFile
)
GetAttr
(
*
Attr
)
Status
{
return
ENOSYS
}
func
(
f
*
DefaultFile
)
Fsync
(
flags
int
)
(
code
Status
)
{
...
...
fuse/files.go
View file @
d4e694da
...
...
@@ -26,8 +26,10 @@ func (f *DataFile) String() string {
return
fmt
.
Sprintf
(
"DataFile(%x)"
,
f
.
data
[
:
l
])
}
func
(
f
*
DataFile
)
GetAttr
()
(
*
Attr
,
Status
)
{
return
&
Attr
{
Mode
:
S_IFREG
|
0644
,
Size
:
uint64
(
len
(
f
.
data
))},
OK
func
(
f
*
DataFile
)
GetAttr
(
out
*
Attr
)
Status
{
out
.
Mode
=
S_IFREG
|
0644
out
.
Size
=
uint64
(
len
(
f
.
data
))
return
OK
}
func
NewDataFile
(
data
[]
byte
)
*
DataFile
{
...
...
@@ -52,6 +54,8 @@ type DevNullFile struct {
DefaultFile
}
var
_
=
(
File
)((
*
DevNullFile
)(
nil
))
func
NewDevNullFile
()
*
DevNullFile
{
return
new
(
DevNullFile
)
}
...
...
@@ -134,15 +138,14 @@ func (f *LoopbackFile) Chown(uid uint32, gid uint32) Status {
return
ToStatus
(
f
.
File
.
Chown
(
int
(
uid
),
int
(
gid
)))
}
func
(
f
*
LoopbackFile
)
GetAttr
(
)
(
*
Attr
,
Status
)
{
func
(
f
*
LoopbackFile
)
GetAttr
(
a
*
Attr
)
Status
{
st
:=
syscall
.
Stat_t
{}
err
:=
syscall
.
Fstat
(
int
(
f
.
File
.
Fd
()),
&
st
)
if
err
!=
nil
{
return
nil
,
ToStatus
(
err
)
return
ToStatus
(
err
)
}
a
:=
&
Attr
{}
a
.
FromStat
(
&
st
)
return
a
,
OK
return
OK
}
////////////////////////////////////////////////////////////////
...
...
fuse/memnode.go
View file @
d4e694da
...
...
@@ -147,9 +147,10 @@ func (n *memNodeFile) InnerFile() File {
func
(
n
*
memNodeFile
)
Flush
()
Status
{
code
:=
n
.
LoopbackFile
.
Flush
()
fi
,
_
:=
n
.
LoopbackFile
.
GetAttr
()
n
.
node
.
info
.
Size
=
fi
.
Size
n
.
node
.
info
.
Blocks
=
fi
.
Blocks
var
a
Attr
n
.
LoopbackFile
.
GetAttr
(
&
a
)
n
.
node
.
info
.
Size
=
a
.
Size
n
.
node
.
info
.
Blocks
=
a
.
Blocks
return
code
}
...
...
fuse/pathfs.go
View file @
d4e694da
...
...
@@ -527,8 +527,7 @@ func (n *pathInode) GetAttr(out *Attr, file File, context *Context) (code Status
}
if
file
!=
nil
{
fi
,
code
=
file
.
GetAttr
()
*
out
=
*
fi
code
=
file
.
GetAttr
(
out
)
}
if
file
==
nil
||
code
==
ENOSYS
||
code
==
EBADF
{
...
...
unionfs/unionfs.go
View file @
d4e694da
...
...
@@ -1007,12 +1007,10 @@ func (fs *unionFsFile) SetInode(node *fuse.Inode) {
fs
.
node
=
node
}
func
(
fs
*
unionFsFile
)
GetAttr
()
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
fi
,
code
:=
fs
.
File
.
GetAttr
()
if
fi
!=
nil
{
f
:=
*
fi
fi
=
&
f
fi
.
Mode
|=
0200
}
return
fi
,
code
func
(
fs
*
unionFsFile
)
GetAttr
(
out
*
fuse
.
Attr
)
fuse
.
Status
{
code
:=
fs
.
File
.
GetAttr
(
out
)
if
code
.
Ok
()
{
out
.
Mode
|=
0200
}
return
code
}
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