removing unused Flags field in FCB context

This commit is contained in:
Olga Kornievskaia 2012-03-29 12:54:30 -04:00 committed by unknown
parent 092c39d9d6
commit 60e1d87a86

View file

@ -72,9 +72,6 @@ DRIVER_DISPATCH ( nfs41_FsdDispatch );
struct _MINIRDR_DISPATCH nfs41_ops; struct _MINIRDR_DISPATCH nfs41_ops;
PRDBSS_DEVICE_OBJECT nfs41_dev; PRDBSS_DEVICE_OBJECT nfs41_dev;
#define FCB_BASIC_INFO_CACHED 0x0001
#define FCB_STANDARD_INFO_CACHED 0x0010
#define DISABLE_CACHING 0 #define DISABLE_CACHING 0
#define ENABLE_READ_CACHING 1 #define ENABLE_READ_CACHING 1
#define ENABLE_WRITE_CACHING 2 #define ENABLE_WRITE_CACHING 2
@ -397,7 +394,6 @@ typedef struct _NFS41_V_NET_ROOT_EXTENSION {
typedef struct _NFS41_FCB { typedef struct _NFS41_FCB {
NODE_TYPE_CODE NodeTypeCode; NODE_TYPE_CODE NodeTypeCode;
NODE_BYTE_SIZE NodeByteSize; NODE_BYTE_SIZE NodeByteSize;
ULONG Flags;
FILE_BASIC_INFORMATION BasicInfo; FILE_BASIC_INFORMATION BasicInfo;
FILE_STANDARD_INFORMATION StandardInfo; FILE_STANDARD_INFORMATION StandardInfo;
BOOLEAN Renamed; BOOLEAN Renamed;
@ -3639,7 +3635,6 @@ NTSTATUS nfs41_Create(
sizeof(entry->u.Open.sinfo)); sizeof(entry->u.Open.sinfo));
nfs41_fcb->mode = entry->u.Open.mode; nfs41_fcb->mode = entry->u.Open.mode;
nfs41_fcb->changeattr = entry->u.Open.changeattr; nfs41_fcb->changeattr = entry->u.Open.changeattr;
nfs41_fcb->Flags = FCB_BASIC_INFO_CACHED | FCB_STANDARD_INFO_CACHED;
if (((params.CreateOptions & FILE_DELETE_ON_CLOSE) && if (((params.CreateOptions & FILE_DELETE_ON_CLOSE) &&
!pVNetRootContext->read_only) || oldDeletePending) !pVNetRootContext->read_only) || oldDeletePending)
nfs41_fcb->StandardInfo.DeletePending = TRUE; nfs41_fcb->StandardInfo.DeletePending = TRUE;
@ -4879,29 +4874,8 @@ NTSTATUS nfs41_QueryFileInformation(
status = STATUS_SUCCESS; status = STATUS_SUCCESS;
goto out; goto out;
} }
#ifdef FCB_ATTR_CACHING
case FileBasicInformation:
if(nfs41_fcb->Flags & FCB_BASIC_INFO_CACHED) {
RtlCopyMemory(RxContext->Info.Buffer, &nfs41_fcb->BasicInfo,
sizeof(nfs41_fcb->BasicInfo));
RxContext->Info.LengthRemaining -= sizeof(nfs41_fcb->BasicInfo);
status = STATUS_SUCCESS;
goto out;
}
break;
case FileStandardInformation:
if(nfs41_fcb->Flags & FCB_STANDARD_INFO_CACHED) {
RtlCopyMemory(RxContext->Info.Buffer, &nfs41_fcb->StandardInfo,
sizeof(nfs41_fcb->StandardInfo));
RxContext->Info.LengthRemaining -= sizeof(nfs41_fcb->StandardInfo);
status = STATUS_SUCCESS;
goto out;
}
break;
#else
case FileBasicInformation: case FileBasicInformation:
case FileStandardInformation: case FileStandardInformation:
#endif
case FileInternalInformation: case FileInternalInformation:
case FileAttributeTagInformation: case FileAttributeTagInformation:
break; break;
@ -4939,13 +4913,11 @@ NTSTATUS nfs41_QueryFileInformation(
case FileBasicInformation: case FileBasicInformation:
RtlCopyMemory(&nfs41_fcb->BasicInfo, RxContext->Info.Buffer, RtlCopyMemory(&nfs41_fcb->BasicInfo, RxContext->Info.Buffer,
sizeof(nfs41_fcb->BasicInfo)); sizeof(nfs41_fcb->BasicInfo));
nfs41_fcb->Flags |= FCB_BASIC_INFO_CACHED;
#ifdef DEBUG_FILE_QUERY #ifdef DEBUG_FILE_QUERY
print_basic_info(1, &nfs41_fcb->BasicInfo); print_basic_info(1, &nfs41_fcb->BasicInfo);
#endif #endif
break; break;
case FileStandardInformation: case FileStandardInformation:
#ifndef FCB_ATTR_CACHING
/* this a fix for RDBSS behaviour when it first calls ExtendForCache, /* this a fix for RDBSS behaviour when it first calls ExtendForCache,
* then it sends a file query irp for standard attributes and * then it sends a file query irp for standard attributes and
* expects to receive EndOfFile of value set by the ExtendForCache. * expects to receive EndOfFile of value set by the ExtendForCache.
@ -4975,13 +4947,11 @@ NTSTATUS nfs41_QueryFileInformation(
} }
std_info->DeletePending = nfs41_fcb->DeletePending; std_info->DeletePending = nfs41_fcb->DeletePending;
} }
#endif
if (nfs41_fcb->StandardInfo.DeletePending) if (nfs41_fcb->StandardInfo.DeletePending)
DeletePending = TRUE; DeletePending = TRUE;
RtlCopyMemory(&nfs41_fcb->StandardInfo, RxContext->Info.Buffer, RtlCopyMemory(&nfs41_fcb->StandardInfo, RxContext->Info.Buffer,
sizeof(nfs41_fcb->StandardInfo)); sizeof(nfs41_fcb->StandardInfo));
nfs41_fcb->StandardInfo.DeletePending = DeletePending; nfs41_fcb->StandardInfo.DeletePending = DeletePending;
nfs41_fcb->Flags |= FCB_STANDARD_INFO_CACHED;
#ifdef DEBUG_FILE_QUERY #ifdef DEBUG_FILE_QUERY
print_std_info(1, &nfs41_fcb->StandardInfo); print_std_info(1, &nfs41_fcb->StandardInfo);
#endif #endif
@ -5092,7 +5062,6 @@ NTSTATUS nfs41_SetFileInformation(
status = STATUS_INVALID_PARAMETER; status = STATUS_INVALID_PARAMETER;
goto out; goto out;
} }
nfs41_fcb->Flags = 0;
} }
break; break;
case FileLinkInformation: case FileLinkInformation:
@ -5112,7 +5081,6 @@ NTSTATUS nfs41_SetFileInformation(
status = STATUS_INVALID_PARAMETER; status = STATUS_INVALID_PARAMETER;
goto out; goto out;
} }
nfs41_fcb->Flags = 0;
} }
break; break;
case FileDispositionInformation: case FileDispositionInformation:
@ -5129,7 +5097,6 @@ NTSTATUS nfs41_SetFileInformation(
// we can delete directories right away // we can delete directories right away
if (nfs41_fcb->StandardInfo.Directory) if (nfs41_fcb->StandardInfo.Directory)
break; break;
nfs41_fcb->Flags = 0;
nfs41_fcb->StandardInfo.DeletePending = TRUE; nfs41_fcb->StandardInfo.DeletePending = TRUE;
if (RxContext->pFcb->OpenCount > 1) { if (RxContext->pFcb->OpenCount > 1) {
rinfo.ReplaceIfExists = 0; rinfo.ReplaceIfExists = 0;
@ -5154,7 +5121,6 @@ NTSTATUS nfs41_SetFileInformation(
} }
case FileBasicInformation: case FileBasicInformation:
case FileAllocationInformation: case FileAllocationInformation:
nfs41_fcb->Flags = 0;
break; break;
case FileEndOfFileInformation: case FileEndOfFileInformation:
{ {
@ -5162,7 +5128,6 @@ NTSTATUS nfs41_SetFileInformation(
(PFILE_END_OF_FILE_INFORMATION)RxContext->Info.Buffer; (PFILE_END_OF_FILE_INFORMATION)RxContext->Info.Buffer;
nfs41_fcb->StandardInfo.AllocationSize = nfs41_fcb->StandardInfo.AllocationSize =
nfs41_fcb->StandardInfo.EndOfFile = info->EndOfFile; nfs41_fcb->StandardInfo.EndOfFile = info->EndOfFile;
nfs41_fcb->Flags = 0;
break; break;
} }
default: default:
@ -5443,7 +5408,6 @@ NTSTATUS nfs41_Read(
#endif #endif
status = RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS; status = RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
RxContext->IoStatusBlock.Information = entry->u.ReadWrite.len; RxContext->IoStatusBlock.Information = entry->u.ReadWrite.len;
nfs41_fcb->Flags = 0;
if ((!BooleanFlagOn(LowIoContext->ParamsFor.ReadWrite.Flags, if ((!BooleanFlagOn(LowIoContext->ParamsFor.ReadWrite.Flags,
LOWIO_READWRITEFLAG_PAGING_IO) && LOWIO_READWRITEFLAG_PAGING_IO) &&
@ -5546,7 +5510,6 @@ NTSTATUS nfs41_Write(
entry->u.ReadWrite.offset; entry->u.ReadWrite.offset;
status = RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS; status = RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
RxContext->IoStatusBlock.Information = entry->u.ReadWrite.len; RxContext->IoStatusBlock.Information = entry->u.ReadWrite.len;
nfs41_fcb->Flags = 0;
nfs41_fcb->changeattr = entry->u.ReadWrite.ChangeTime; nfs41_fcb->changeattr = entry->u.ReadWrite.ChangeTime;
//re-enable write buffering //re-enable write buffering