| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.io2; |
| |
| /// Objective information about a filesystem node. |
| /// See [`Node.GetAttributes`] and [`Node.UpdateAttributes`]. |
| /// |
| /// The attributes of a node should be stable, independent of the |
| /// specific protocol used to access it. |
| /// |
| /// If a particular attribute is not applicable or not supported, |
| /// filesystems should leave the corresponding field absent. |
| table NodeAttributes { |
| /// Describes the kinds of representations supported by the node. |
| /// Note: This is not the result of the connection-time negotiation, |
| /// which is conveyed via `representation`. |
| /// |
| /// This attribute is read-only. |
| 1: NodeProtocolSet protocols; |
| |
| /// Describes the kinds of operations supported by the node. |
| /// Note: This is distinct from the rights used at connection time. |
| /// |
| /// This attribute is read-only. |
| 2: Abilities abilities; |
| |
| /// Node size, in bytes. |
| /// |
| /// This attribute is read-only. |
| 3: uint64 content_size; |
| |
| /// Space needed to store the node (possibly larger than size), in bytes. |
| /// |
| /// This attribute is read-only. |
| 4: uint64 storage_size; |
| |
| /// Number of hard links to the node. It must be at least one. |
| /// |
| /// This attribute is read-only. |
| 5: uint64 link_count; |
| |
| /// Time of creation in nanoseconds since the Unix epoch, UTC. |
| /// It may be updated manually after creation. |
| 6: uint64 creation_time; |
| |
| /// Time of last modification in nanoseconds since the Unix epoch, UTC. |
| 7: uint64 modification_time; |
| }; |
| |
| /// When calling [`Node.GetAttributes`], set the corresponding bit to one |
| /// to query that particular attribute. |
| /// The elements here correspond one-to-one with [`NodeAttributes`]. |
| bits NodeAttributesQuery : uint64 { |
| /// Requests [`NodeAttributes.protocols`]. |
| PROTOCOLS = 0x1; |
| |
| /// Requests [`NodeAttributes.abilities`]. |
| ABILITIES = 0x2; |
| |
| /// Requests [`NodeAttributes.content_size`]. |
| CONTENT_SIZE = 0x4; |
| |
| /// Requests [`NodeAttributes.storage_size`]. |
| STORAGE_SIZE = 0x8; |
| |
| /// Requests [`NodeAttributes.link_count`]. |
| LINK_COUNT = 0x10; |
| |
| /// Requests [`NodeAttributes.creation_time`]. |
| CREATION_TIME = 0x20; |
| |
| /// Requests [`NodeAttributes.modification_time`]. |
| MODIFICATION_TIME = 0x40; |
| }; |