From: Marek Szyprowski Date: Wed, 25 Mar 2020 09:03:40 +0000 (+0100) Subject: net: nfs: show file offset and improve progress display X-Git-Tag: accepted/tizen/unified/20221108.163909~245 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a371a75a1ecbcbfd8c06ba75f783bd5e41ec1b6;p=platform%2Fkernel%2Fu-boot.git net: nfs: show file offset and improve progress display Always align progress display to the start of the column and show downloaded file offset. Signed-off-by: Marek Szyprowski Change-Id: Ia5e3185110e0dbfc89046854f8d612f6428af794 --- diff --git a/net/nfs.c b/net/nfs.c index 7d24195..ccd67a6 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -667,6 +667,7 @@ static int nfs_read_reply(uchar *pkt, unsigned len) struct rpc_t rpc_pkt; int rlen; uchar *data_ptr; + int offset = nfs_offset - net_boot_file_offset; debug("%s\n", __func__); @@ -688,10 +689,10 @@ static int nfs_read_reply(uchar *pkt, unsigned len) return -ntohl(rpc_pkt.u.reply.data[0]); } - if ((nfs_offset != 0) && !((nfs_offset) % + if ((offset != 0) && !((offset) % (NFS_READ_SIZE / 2 * 256 * HASHES_PER_LINE))) puts("\n\t "); - if (!(nfs_offset % ((NFS_READ_SIZE / 2) * 256))) + if (!(offset % ((NFS_READ_SIZE / 2) * 256))) putc('#'); if (supported_nfs_versions & NFSV2_FLAG) { @@ -714,7 +715,7 @@ static int nfs_read_reply(uchar *pkt, unsigned len) if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *)(&rpc_pkt) + rlen) > len) return -9999; - if (store_block(data_ptr, nfs_offset - net_boot_file_offset, rlen)) + if (store_block(data_ptr, offset, rlen)) return -9999; return rlen; @@ -911,7 +912,8 @@ void nfs_start(void) printf("; sending through gateway %pI4", &net_gateway); } - printf("\nFilename '%s/%s'.", nfs_path, nfs_filename); + printf("\nFilename '%s/%s', offset %u.", nfs_path, nfs_filename, + net_boot_file_offset); if (net_boot_file_expected_size_in_blocks) { printf(" Size is 0x%x Bytes = ",