pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


Experimental FILE_ATTRIBUTE_TEMPORARY support
Posted by Anonymous on Mon 30th Sep 2024 14:03
raw | new post

  1. # Experimental FILE_ATTRIBUTE_TEMPORARY support
  2. diff --git a/daemon/util.c b/daemon/util.c
  3. index 3da52f1..286bf6d 100644
  4. --- a/daemon/util.c
  5. +++ b/daemon/util.c
  6. @@ -145,7 +145,7 @@ bool_t verify_commit(
  7.  ULONG nfs_file_info_to_attributes(
  8.      IN const nfs41_file_info *info)
  9.  {
  10. -    ULONG attrs = 0;
  11. +    ULONG attrs = FILE_ATTRIBUTE_TEMPORARY;
  12.      if (info->type == NF4DIR)
  13.          attrs |= FILE_ATTRIBUTE_DIRECTORY;
  14.      else if (info->type == NF4LNK) {
  15. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  16. index 8143840..4bb3d64 100644
  17. --- a/sys/nfs41_driver.c
  18. +++ b/sys/nfs41_driver.c
  19. @@ -4459,6 +4459,9 @@ retry_on_link:
  20.                  !pVNetRootContext->read_only) || oldDeletePending)
  21.              nfs41_fcb->StandardInfo.DeletePending = TRUE;
  22.  
  23. +#if 1
  24. +        entry->u.Open.binfo.FileAttributes |= FILE_ATTRIBUTE_TEMPORARY;
  25. +#endif
  26.          RxFormInitPacket(InitPacket,
  27.              &entry->u.Open.binfo.FileAttributes,
  28.              &entry->u.Open.sinfo.NumberOfLinks,
  29. @@ -4477,6 +4480,13 @@ retry_on_link:
  30.  
  31.          RxFinishFcbInitialization(Fcb, RDBSS_STORAGE_NTC(StorageType),
  32.                                      &InitPacket);
  33. +
  34. +#if 1
  35. +        SetFlag(Fcb->FcbState, FCB_STATE_TEMPORARY);
  36. +        if (RxContext->pFobx->AssociatedFileObject) {
  37. +            SetFlag(RxContext->pFobx->AssociatedFileObject->Flags, FO_TEMPORARY_FILE);
  38. +        }
  39. +#endif
  40.      }
  41.  #ifdef DEBUG_OPEN
  42.      else
  43. @@ -6168,6 +6178,9 @@ static NTSTATUS nfs41_QueryFileInformation(
  44.          case FileBasicInformation:
  45.              RtlCopyMemory(&nfs41_fcb->BasicInfo, RxContext->Info.Buffer,
  46.                  sizeof(nfs41_fcb->BasicInfo));
  47. +#if 1
  48. +            nfs41_fcb->BasicInfo.FileAttributes |= FILE_ATTRIBUTE_TEMPORARY;
  49. +#endif
  50.  #ifdef DEBUG_FILE_QUERY
  51.              print_basic_info(1, &nfs41_fcb->BasicInfo);
  52.  #endif

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at