nfs4: Do not repeat OPENATTR requests if not supported
This commit is contained in:
@@ -27,6 +27,7 @@ FileSystem::FileSystem()
|
||||
fPrev(NULL),
|
||||
fOpenCount(0),
|
||||
fOpenOwnerSequence(0),
|
||||
fNamedAttrs(true),
|
||||
fPath(NULL),
|
||||
fRoot(NULL),
|
||||
fId(1)
|
||||
|
||||
@@ -62,6 +62,9 @@ public:
|
||||
inline uint32 OpenOwnerSequenceLock();
|
||||
inline void OpenOwnerSequenceUnlock(uint32 sequence);
|
||||
|
||||
inline bool NamedAttrs();
|
||||
inline void SetNamedAttrs(bool attrs);
|
||||
|
||||
FileSystem* fNext;
|
||||
FileSystem* fPrev;
|
||||
private:
|
||||
@@ -83,6 +86,7 @@ private:
|
||||
|
||||
uint32 fExpireType;
|
||||
uint32 fSupAttrs[2];
|
||||
bool fNamedAttrs;
|
||||
|
||||
FileSystemId fFsId;
|
||||
const char* fPath;
|
||||
@@ -205,5 +209,19 @@ FileSystem::OpenOwnerSequenceUnlock(uint32 sequence)
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
FileSystem::NamedAttrs()
|
||||
{
|
||||
return fNamedAttrs;
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
FileSystem::SetNamedAttrs(bool attrs)
|
||||
{
|
||||
fNamedAttrs = attrs;
|
||||
}
|
||||
|
||||
|
||||
#endif // FILESYSTEM_H
|
||||
|
||||
|
||||
@@ -62,10 +62,16 @@ Inode::OpenAttrDir(OpenDirCookie* cookie)
|
||||
status_t
|
||||
Inode::LoadAttrDirHandle()
|
||||
{
|
||||
if (!fFileSystem->NamedAttrs())
|
||||
return B_UNSUPPORTED;
|
||||
|
||||
if (fInfo.fAttrDir.fSize == 0) {
|
||||
FileHandle handle;
|
||||
|
||||
status_t result = NFS4Inode::OpenAttrDir(&handle);
|
||||
if (result == B_UNSUPPORTED)
|
||||
fFileSystem->SetNamedAttrs(false);
|
||||
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user