getBlocks fetches all the blocks for a given inode and returns a list of blockInfo objects.
(e sqlExecutor, inodeID uint64)
| 117 | // getBlocks fetches all the blocks for a given inode and returns |
| 118 | // a list of blockInfo objects. |
| 119 | func getBlocks(e sqlExecutor, inodeID uint64) ([]blockInfo, error) { |
| 120 | stmt := `SELECT block, data FROM fs_block WHERE id = ?` |
| 121 | rows, err := e.Query(stmt, inodeID) |
| 122 | if err != nil { |
| 123 | return nil, err |
| 124 | } |
| 125 | return buildBlockInfos(rows) |
| 126 | } |
| 127 | |
| 128 | // getBlocksBetween fetches blocks with IDs [start, end] for a given inode |
| 129 | // and returns a list of blockInfo objects. |