System.Collections.Generic.List.Add(inode)

Here are the examples of the csharp api System.Collections.Generic.List.Add(inode) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

19 View Source File : PFSBuilder.cs
License : The Unlicense
Project Creator : marcussacana

void addDirInodes()
    {
      inodes.Add(properties.root.ino);
      foreach (var dir in allDirs.OrderBy(x => x.FullPath()))
      {
        var ino = MakeInode(
          Mode: InodeMode.dir | inode.RXOnly,
          Number: (uint)inodes.Count,
          Blocks: 1,
          Size: 65536,
          Flags: [email protected],
          Nlink: 2 // 1 link each for its own dirent and its . dirent
        );
        dir.ino = ino;
        dir.Dirents.Add(new PfsDirent { Name = ".", InodeNumber = ino.Number, Type = DirentType.Dot });
        dir.Dirents.Add(new PfsDirent { Name = "..", InodeNumber = dir.Parent.ino.Number, Type = DirentType.DotDot });

        var dirent = new PfsDirent { Name = dir.name, InodeNumber = (uint)inodes.Count, Type = DirentType.Directory };
        dir.Parent.Dirents.Add(dirent);
        dir.Parent.ino.Nlink++;
        inodes.Add(ino);
      }
    }

19 View Source File : PFSBuilder.cs
License : The Unlicense
Project Creator : marcussacana

void addDirInodes()
    {
      inodes.Add(properties.root.ino);
      foreach (var dir in allDirs.OrderBy(x => x.FullPath()))
      {
        var ino = MakeInode(
          Mode: InodeMode.dir | inode.RXOnly,
          Number: (uint)inodes.Count,
          Blocks: 1,
          Size: 65536,
          Flags: [email protected],
          Nlink: 2 // 1 link each for its own dirent and its . dirent
        );
        dir.ino = ino;
        dir.Dirents.Add(new PfsDirent { Name = ".", InodeNumber = ino.Number, Type = DirentType.Dot });
        dir.Dirents.Add(new PfsDirent { Name = "..", InodeNumber = dir.Parent.ino.Number, Type = DirentType.DotDot });

        var dirent = new PfsDirent { Name = dir.name, InodeNumber = (uint)inodes.Count, Type = DirentType.Directory };
        dir.Parent.Dirents.Add(dirent);
        dir.Parent.ino.Nlink++;
        inodes.Add(ino);
      }
    }

19 View Source File : PFSBuilder.cs
License : The Unlicense
Project Creator : marcussacana

void addFileInodes()
    {
      foreach (var file in allFiles.OrderBy(x => x.FullPath()))
      {
        var ino = MakeInode(
          Mode: InodeMode.file | inode.RXOnly,
          Size: file.Size,
          SizeCompressed: file.CompressedSize,
          Number: (uint)inodes.Count,
          Blocks: (uint)CeilDiv(file.Size, hdr.BlockSize),
          Flags: [email protected] | (file.Compress ? InodeFlags.compressed : 0)
        );
        if (properties.Sign) // HACK: Outer PFS images don't use readonly?
        {
          ino.Flags &= [email protected];
        }
        file.ino = ino;
        var dirent = new PfsDirent { Name = file.name, Type = DirentType.File, InodeNumber = (uint)inodes.Count };
        file.Parent.Dirents.Add(dirent);
        inodes.Add(ino);
      }
    }

19 View Source File : PFSBuilder.cs
License : The Unlicense
Project Creator : marcussacana

void SetupRootStructure(bool hasCollision)
    {
      var inodeNum = 0u;
      inodes.Add(super_root_ino = MakeInode(
        Mode: InodeMode.dir | inode.RXOnly,
        Blocks: 1,
        Size: 65536,
        SizeCompressed: 65536,
        Nlink: 1,
        Number: inodeNum++,
        Flags: [email protected] | [email protected]
      ));
      inodes.Add(fpt_ino = MakeInode(
        Mode: InodeMode.file | inode.RXOnly,
        Blocks: 1,
        Number: inodeNum++,
        Flags: [email protected] | [email protected]
      ));
      if(hasCollision)
      {
        inodes.Add(cr_ino = MakeInode(
          Mode: InodeMode.file | inode.RXOnly,
          Blocks: 1,
          Number: inodeNum++,
          Flags: [email protected] | [email protected]
        ));
      }
      var uroot_ino = MakeInode(
        Mode: InodeMode.dir | inode.RXOnly,
        Number: inodeNum++,
        Size: 65536,
        SizeCompressed: 65536,
        Blocks: 1,
        Flags: [email protected],
        Nlink: 3
      );

      super_root_dirents = new List<PfsDirent>
      {
        new PfsDirent { InodeNumber = fpt_ino.Number, Name = "flat_path_table", Type = DirentType.File },
      };
      if(hasCollision)
      {
        super_root_dirents.Add(
          new PfsDirent { InodeNumber = cr_ino.Number, Name = "collision_resolver", Type = DirentType.File });
      }
      super_root_dirents.Add(
        new PfsDirent { InodeNumber = uroot_ino.Number, Name = "uroot", Type = DirentType.Directory });

      properties.root.name = "uroot";
      properties.root.ino = uroot_ino;
      properties.root.Dirents = new List<PfsDirent>
      {
        new PfsDirent { Name = ".", Type = DirentType.Dot, InodeNumber = uroot_ino.Number },
        new PfsDirent { Name = "..", Type = DirentType.DotDot, InodeNumber = uroot_ino.Number }
      };
      if(properties.Sign) // HACK: Outer PFS lacks readonly flags
      {
        super_root_ino.Flags &= [email protected];
        fpt_ino.Flags &= [email protected];
        uroot_ino.Flags &= [email protected];
      }
    }