updateNode updates an existing node descriptor.
(e sqlExecutor, node *Node)
| 80 | |
| 81 | // updateNode updates an existing node descriptor. |
| 82 | func updateNode(e sqlExecutor, node *Node) error { |
| 83 | inode := node.toJSON() |
| 84 | const sql = ` |
| 85 | UPDATE fs_inode SET inode = ? WHERE id = ?; |
| 86 | ` |
| 87 | if _, err := e.Exec(sql, inode, node.ID); err != nil { |
| 88 | return err |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | // getBlockData returns the block data for a single block. |
| 94 | func getBlockData(e sqlExecutor, inodeID uint64, block int) ([]byte, error) { |