]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
afs: Make struct afs_read::remain 64-bit
authorDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:46 +0000 (16:27 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:46 +0000 (16:27 +0000)
Make struct afs_read::remain 64-bit so that it can handle huge transfers if
we ever request them or the server decides to give us a bit extra data (the
other fields there are already 64-bit).

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
fs/afs/fsclient.c
fs/afs/internal.h

index 4314f9e63a2c68380cf67662183feaf79b713fed..0778c5b6b59b4b0caef46a01b5536ffe5c11587e 100644 (file)
@@ -321,7 +321,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
        void *buffer;
        int ret;
 
-       _enter("{%u,%zu/%u;%u/%llu}",
+       _enter("{%u,%zu/%u;%llu/%llu}",
               call->unmarshall, call->offset, call->count,
               req->remain, req->actual_len);
 
@@ -379,7 +379,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 
                /* extract the returned data */
        case 3:
-               _debug("extract data %u/%llu %zu/%u",
+               _debug("extract data %llu/%llu %zu/%u",
                       req->remain, req->actual_len, call->offset, call->count);
 
                buffer = kmap(req->pages[req->index]);
@@ -405,9 +405,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
                /* Discard any excess data the server gave us */
        begin_discard:
        case 4:
-               size = min_t(size_t, sizeof(afs_discard_buffer), req->remain);
+               size = min_t(loff_t, sizeof(afs_discard_buffer), req->remain);
                call->count = size;
-               _debug("extract discard %u/%llu %zu/%u",
+               _debug("extract discard %llu/%llu %zu/%u",
                       req->remain, req->actual_len, call->offset, call->count);
 
                call->offset = 0;
index 832555003d0396bcf753502b548113a07e38b7d4..a6901360fb81d435bf47a85b781a89a1056fd900 100644 (file)
@@ -133,8 +133,8 @@ struct afs_read {
        loff_t                  pos;            /* Where to start reading */
        loff_t                  len;            /* How much we're asking for */
        loff_t                  actual_len;     /* How much we're actually getting */
+       loff_t                  remain;         /* Amount remaining */
        atomic_t                usage;
-       unsigned int            remain;         /* Amount remaining */
        unsigned int            index;          /* Which page we're reading into */
        unsigned int            nr_pages;
        void (*page_done)(struct afs_call *, struct afs_read *);