Permalink
Browse files

[nfs] - add nfs support (incl. write allowed like smb)

- using dyloaded libnfs - incl. connection tracking for delayed unload feature
  • Loading branch information...
1 parent 9ed84f2 commit 9ec9cab31a5b838efadb0fe34e14c92ed52cfdb2 @Memphiz Memphiz committed Jun 11, 2011
@@ -602,6 +602,8 @@
C8D0B2AF1265A9A800F0C0AC /* SystemGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */; };
C8D0B2B01265A9A800F0C0AC /* SystemGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */; };
C8EC5D0E1369519D00CCC10D /* XBMC_keytable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8EC5D0C1369519D00CCC10D /* XBMC_keytable.cpp */; };
+ DF0DF15B13A3ADA7008ED511 /* FileNFS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0DF15713A3ADA7008ED511 /* FileNFS.cpp */; };
+ DF0DF15C13A3ADA7008ED511 /* NFSDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0DF15913A3ADA7008ED511 /* NFSDirectory.cpp */; };
E306D12E0DDF7B590052C2AD /* XBMCHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E306D12C0DDF7B590052C2AD /* XBMCHelper.cpp */; };
E33206380D5070AA00435CE3 /* DVDDemuxVobsub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E33206370D5070AA00435CE3 /* DVDDemuxVobsub.cpp */; };
E33466A60D2E5103005A65EC /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E33466A50D2E5103005A65EC /* IOKit.framework */; };
@@ -2518,6 +2520,10 @@
C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemGlobals.cpp; sourceTree = "<group>"; };
C8EC5D0C1369519D00CCC10D /* XBMC_keytable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBMC_keytable.cpp; sourceTree = "<group>"; };
C8EC5D0D1369519D00CCC10D /* XBMC_keytable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_keytable.h; sourceTree = "<group>"; };
+ DF0DF15713A3ADA7008ED511 /* FileNFS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileNFS.cpp; sourceTree = "<group>"; };
+ DF0DF15813A3ADA7008ED511 /* FileNFS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileNFS.h; sourceTree = "<group>"; };
+ DF0DF15913A3ADA7008ED511 /* NFSDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NFSDirectory.cpp; sourceTree = "<group>"; };
+ DF0DF15A13A3ADA7008ED511 /* NFSDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFSDirectory.h; sourceTree = "<group>"; };
E306D12C0DDF7B590052C2AD /* XBMCHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBMCHelper.cpp; sourceTree = "<group>"; };
E306D12D0DDF7B590052C2AD /* XBMCHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMCHelper.h; sourceTree = "<group>"; };
E33206370D5070AA00435CE3 /* DVDDemuxVobsub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDDemuxVobsub.cpp; sourceTree = "<group>"; };
@@ -5521,6 +5527,10 @@
E38E16940D25F9FA00618676 /* filesystem */ = {
isa = PBXGroup;
children = (
+ DF0DF15713A3ADA7008ED511 /* FileNFS.cpp */,
+ DF0DF15813A3ADA7008ED511 /* FileNFS.h */,
+ DF0DF15913A3ADA7008ED511 /* NFSDirectory.cpp */,
+ DF0DF15A13A3ADA7008ED511 /* NFSDirectory.h */,
7C84A59C12FA3C1600CD1714 /* SourcesDirectory.cpp */,
7C84A59D12FA3C1600CD1714 /* SourcesDirectory.h */,
7C2D6AE20F35453E00DD2E85 /* SpecialProtocol.cpp */,
@@ -8063,6 +8073,11 @@
F558F27B13ABD56600631E12 /* DirtyRegionSolvers.cpp in Sources */,
F558F27F13ABD57400631E12 /* DirtyRegionTracker.cpp in Sources */,
F558F29613ABD7DF00631E12 /* GUIWindowDebugInfo.cpp in Sources */,
+ 7C0A7F7C13A9E69A00AFC2BD /* DirtyRegionSolvers.cpp in Sources */,
+ 7C0A7F7D13A9E69A00AFC2BD /* DirtyRegionTracker.cpp in Sources */,
+ 7C0A7F8213A9E6C600AFC2BD /* GUIWindowDebugInfo.cpp in Sources */,
+ DF0DF15B13A3ADA7008ED511 /* FileNFS.cpp in Sources */,
+ DF0DF15C13A3ADA7008ED511 /* NFSDirectory.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -759,6 +759,11 @@ bool CFileItem::IsOnDVD() const
return URIUtils::IsOnDVD(m_strPath) || m_iDriveType == CMediaSource::SOURCE_TYPE_DVD;
}
+bool CFileItem::IsNfs() const
+{
+ return URIUtils::IsNfs(m_strPath);
+}
+
bool CFileItem::IsOnLAN() const
{
return URIUtils::IsOnLAN(m_strPath);
@@ -1999,6 +2004,7 @@ void CFileItemList::Stack()
// 1. rars and zips may be on slow sources? is this supposed to be allowed?
if( !item->IsRemote()
|| item->IsSmb()
+ || item->IsNfs()
|| URIUtils::IsInRAR(item->m_strPath)
|| URIUtils::IsInZIP(item->m_strPath)
)
View
@@ -116,6 +116,7 @@ class CFileItem :
bool IsOnDVD() const;
bool IsOnLAN() const;
bool IsHD() const;
+ bool IsNfs() const;
bool IsRemote() const;
bool IsSmb() const;
bool IsURL() const;
View
@@ -1145,8 +1145,8 @@ bool CUtil::CreateDirectoryEx(const CStdString& strPath)
// return true if directory already exist
if (CDirectory::Exists(strPath)) return true;
- // we currently only allow HD and smb paths
- if (!URIUtils::IsHD(strPath) && !URIUtils::IsSmb(strPath))
+ // we currently only allow HD and smb and nfs paths
+ if (!URIUtils::IsHD(strPath) && !URIUtils::IsSmb(strPath) && !URIUtils::IsNfs(strPath))
{
CLog::Log(LOGERROR,"%s called with an unsupported path: %s", __FUNCTION__, strPath.c_str());
return false;
@@ -1865,11 +1865,13 @@ bool CUtil::MakeShortenPath(CStdString StrInput, CStdString& StrOutput, int iTex
bool CUtil::SupportsFileOperations(const CStdString& strPath)
{
- // currently only hd and smb support delete and rename
+ // currently only hd and smb and nfssupport delete and rename
if (URIUtils::IsHD(strPath))
return true;
if (URIUtils::IsSmb(strPath))
return true;
+ if (URIUtils::IsNfs(strPath))
+ return true;
if (URIUtils::IsMythTV(strPath))
{
/*
@@ -93,6 +93,9 @@
#ifdef HAS_FILESYSTEM_SFTP
#include "SFTPDirectory.h"
#endif
+#ifdef HAS_FILESYSTEM_NFS
+#include "NFSDirectory.h"
+#endif
using namespace XFILE;
@@ -184,6 +187,10 @@ IDirectory* CFactoryDirectory::Create(const CStdString& strPath)
#ifdef HAS_ZEROCONF
if (strProtocol == "zeroconf") return new CZeroconfDirectory();
#endif
+#ifdef HAS_FILESYSTEM_NFS
+ if (strProtocol == "nfs") return new CNFSDirectory();
+#endif
+
}
CLog::Log(LOGWARNING, "%s - Unsupported protocol(%s) in %s", __FUNCTION__, strProtocol.c_str(), url.Get().c_str() );
@@ -62,6 +62,10 @@
#ifdef HAS_FILESYSTEM_SFTP
#include "FileSFTP.h"
#endif
+#ifdef HAS_FILESYSTEM_NFS
+#include "FileNFS.h"
+#endif
+
#include "FileMusicDatabase.h"
#include "FileSpecialProtocol.h"
#include "MultiPathFile.h"
@@ -154,6 +158,10 @@ IFile* CFileFactory::CreateLoader(const CURL& url)
#ifdef HAS_FILESYSTEM_VTP
else if (strProtocol == "vtp") return new CVTPFile();
#endif
+#ifdef HAS_FILESYSTEM_NFS
+ else if (strProtocol == "nfs") return new CFileNFS();
+#endif
+
}
CLog::Log(LOGWARNING, "%s - Unsupported protocol(%s) in %s", __FUNCTION__, strProtocol.c_str(), url.Get().c_str() );
Oops, something went wrong.

0 comments on commit 9ec9cab

Please sign in to comment.