Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
nfs4j
Commits
089aecd6
Commit
089aecd6
authored
Nov 01, 2011
by
Tigran Mkrtchyan
☕
Browse files
vfs: make FsStat is a part of vfs interface
parent
a50ff968
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/org/dcache/chimera/nfs/v3/NfsServerV3.java
View file @
089aecd6
...
...
@@ -131,7 +131,6 @@ import java.util.concurrent.TimeUnit;
import
org.dcache.chimera.ChimeraFsException
;
import
org.dcache.chimera.FileNotFoundHimeraFsException
;
import
org.dcache.chimera.FsStat
;
import
org.dcache.chimera.IOHimeraFsException
;
import
org.dcache.chimera.UnixPermission
;
import
org.dcache.chimera.nfs.ChimeraNFSException
;
...
...
@@ -158,6 +157,7 @@ import org.slf4j.LoggerFactory;
import
static
org
.
dcache
.
chimera
.
nfs
.
v3
.
HimeraNfsUtils
.
defaultPostOpAttr
;
import
static
org
.
dcache
.
chimera
.
nfs
.
v3
.
HimeraNfsUtils
.
defaultWccData
;
import
org.dcache.chimera.nfs.vfs.FsStat
;
public
class
NfsServerV3
extends
nfs3_protServerStub
{
...
...
src/org/dcache/chimera/nfs/v4/OperationGETATTR.java
View file @
089aecd6
...
...
@@ -93,9 +93,9 @@ import java.util.concurrent.TimeUnit;
import
org.dcache.xdr.XdrAble
;
import
org.dcache.xdr.XdrBuffer
;
import
org.dcache.xdr.XdrEncodingStream
;
import
org.dcache.chimera.FsStat
;
import
org.dcache.chimera.UnixPermission
;
import
org.dcache.chimera.nfs.v4.xdr.nfs_resop4
;
import
org.dcache.chimera.nfs.vfs.FsStat
;
import
org.dcache.chimera.nfs.vfs.Inode
;
import
org.dcache.chimera.nfs.vfs.VirtualFileSystem
;
import
org.slf4j.Logger
;
...
...
src/org/dcache/chimera/nfs/vfs/ChimeraVfs.java
View file @
089aecd6
...
...
@@ -23,7 +23,6 @@ import java.util.Arrays;
import
java.util.List
;
import
org.dcache.chimera.DirectoryStreamHelper
;
import
org.dcache.chimera.FsInode
;
import
org.dcache.chimera.FsStat
;
import
org.dcache.chimera.HimeraDirectoryEntry
;
import
org.dcache.chimera.JdbcFs
;
import
org.dcache.chimera.UnixPermission
;
...
...
@@ -143,7 +142,11 @@ public class ChimeraVfs implements VirtualFileSystem {
@Override
public
FsStat
getFsStat
()
throws
IOException
{
return
_fs
.
getFsStat
();
org
.
dcache
.
chimera
.
FsStat
fsStat
=
_fs
.
getFsStat
();
return
new
FsStat
(
fsStat
.
getTotalSpace
(),
fsStat
.
getTotalFiles
(),
fsStat
.
getUsedSpace
(),
fsStat
.
getUsedFiles
());
}
private
FsInode
toFsInode
(
Inode
inode
)
throws
IOException
{
...
...
src/org/dcache/chimera/nfs/vfs/FsStat.java
0 → 100644
View file @
089aecd6
/*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package
org.dcache.chimera.nfs.vfs
;
/**
* File system stat information.
*/
/* Immutable */
public
class
FsStat
{
private
final
long
_totalSpace
;
private
final
long
_totalFiles
;
private
final
long
_usedSpace
;
private
final
long
_usedFiles
;
public
FsStat
(
long
totalSpace
,
long
totalFiles
,
long
usedSpace
,
long
usedFiles
)
{
_totalSpace
=
totalSpace
;
_totalFiles
=
totalFiles
;
_usedSpace
=
usedSpace
;
_usedFiles
=
usedFiles
;
}
public
long
getTotalFiles
()
{
return
_totalFiles
;
}
public
long
getTotalSpace
()
{
return
_totalSpace
;
}
/**
* @return total number of files. If a file has multiple replicas only one
* replica is counted.
*/
public
long
getUsedFiles
()
{
return
_usedFiles
;
}
/**
* @return total number of bytes off all files. If a file has a multiple
* replicas only one replica is counted.
*/
public
long
getUsedSpace
()
{
return
_usedSpace
;
}
}
\ No newline at end of file
src/org/dcache/chimera/nfs/vfs/VirtualFileSystem.java
View file @
089aecd6
...
...
@@ -18,7 +18,6 @@ package org.dcache.chimera.nfs.vfs;
import
java.io.IOException
;
import
java.util.List
;
import
org.dcache.chimera.FsStat
;
public
interface
VirtualFileSystem
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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