Merge tag 'spi-fix-v5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[linux-2.6-microblaze.git] / fs / afs / cmservice.c
index 380ad5a..a4e9e6e 100644 (file)
@@ -118,8 +118,6 @@ bool afs_cm_incoming_call(struct afs_call *call)
 {
        _enter("{%u, CB.OP %u}", call->service_id, call->operation_ID);
 
-       call->epoch = rxrpc_kernel_get_epoch(call->net->socket, call->rxcall);
-
        switch (call->operation_ID) {
        case CBCallBack:
                call->type = &afs_SRXCBCallBack;
@@ -149,49 +147,6 @@ bool afs_cm_incoming_call(struct afs_call *call)
        }
 }
 
-/*
- * Record a probe to the cache manager from a server.
- */
-static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server)
-{
-       _enter("");
-
-       if (test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags) &&
-           !test_bit(AFS_SERVER_FL_PROBING, &server->flags)) {
-               if (server->cm_epoch == call->epoch)
-                       return 0;
-
-               if (!server->probe.said_rebooted) {
-                       pr_notice("kAFS: FS rebooted %pU\n", &server->uuid);
-                       server->probe.said_rebooted = true;
-               }
-       }
-
-       spin_lock(&server->probe_lock);
-
-       if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
-               server->cm_epoch = call->epoch;
-               server->probe.cm_epoch = call->epoch;
-               goto out;
-       }
-
-       if (server->probe.cm_probed &&
-           call->epoch != server->probe.cm_epoch &&
-           !server->probe.said_inconsistent) {
-               pr_notice("kAFS: FS endpoints inconsistent %pU\n",
-                         &server->uuid);
-               server->probe.said_inconsistent = true;
-       }
-
-       if (!server->probe.cm_probed || call->epoch == server->cm_epoch)
-               server->probe.cm_epoch = server->cm_epoch;
-
-out:
-       server->probe.cm_probed = true;
-       spin_unlock(&server->probe_lock);
-       return 0;
-}
-
 /*
  * Find the server record by peer address and record a probe to the cache
  * manager from a server.
@@ -210,7 +165,7 @@ static int afs_find_cm_server_by_peer(struct afs_call *call)
        }
 
        call->server = server;
-       return afs_record_cm_probe(call, server);
+       return 0;
 }
 
 /*
@@ -231,7 +186,7 @@ static int afs_find_cm_server_by_uuid(struct afs_call *call,
        }
 
        call->server = server;
-       return afs_record_cm_probe(call, server);
+       return 0;
 }
 
 /*
@@ -268,7 +223,9 @@ static void SRXAFSCB_CallBack(struct work_struct *work)
         * to maintain cache coherency.
         */
        if (call->server) {
-               trace_afs_server(call->server, atomic_read(&call->server->usage),
+               trace_afs_server(call->server,
+                                atomic_read(&call->server->ref),
+                                atomic_read(&call->server->active),
                                 afs_server_trace_callback);
                afs_break_callbacks(call->server, call->count, call->request);
        }
@@ -295,7 +252,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                call->unmarshall++;
 
                /* extract the FID array and its count in two steps */
-               /* fall through */
+               fallthrough;
        case 1:
                _debug("extract FID count");
                ret = afs_extract_data(call, true);
@@ -305,8 +262,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                call->count = ntohl(call->tmp);
                _debug("FID count: %u", call->count);
                if (call->count > AFSCBMAX)
-                       return afs_protocol_error(call, -EBADMSG,
-                                                 afs_eproto_cb_fid_count);
+                       return afs_protocol_error(call, afs_eproto_cb_fid_count);
 
                call->buffer = kmalloc(array3_size(call->count, 3, 4),
                                       GFP_KERNEL);
@@ -315,7 +271,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                afs_extract_to_buf(call, call->count * 3 * 4);
                call->unmarshall++;
 
-               /* Fall through */
+               fallthrough;
        case 2:
                _debug("extract FID array");
                ret = afs_extract_data(call, true);
@@ -341,7 +297,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                call->unmarshall++;
 
                /* extract the callback array and its count in two steps */
-               /* fall through */
+               fallthrough;
        case 3:
                _debug("extract CB count");
                ret = afs_extract_data(call, true);
@@ -351,13 +307,12 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                call->count2 = ntohl(call->tmp);
                _debug("CB count: %u", call->count2);
                if (call->count2 != call->count && call->count2 != 0)
-                       return afs_protocol_error(call, -EBADMSG,
-                                                 afs_eproto_cb_count);
+                       return afs_protocol_error(call, afs_eproto_cb_count);
                call->iter = &call->def_iter;
                iov_iter_discard(&call->def_iter, READ, call->count2 * 3 * 4);
                call->unmarshall++;
 
-               /* Fall through */
+               fallthrough;
        case 4:
                _debug("extract discard %zu/%u",
                       iov_iter_count(call->iter), call->count2 * 3 * 4);
@@ -436,7 +391,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
                afs_extract_to_buf(call, 11 * sizeof(__be32));
                call->unmarshall++;
 
-               /* Fall through */
+               fallthrough;
        case 1:
                _debug("extract UUID");
                ret = afs_extract_data(call, false);
@@ -509,7 +464,8 @@ static int afs_deliver_cb_probe(struct afs_call *call)
 }
 
 /*
- * allow the fileserver to quickly find out if the fileserver has been rebooted
+ * Allow the fileserver to quickly find out if the cache manager has been
+ * rebooted.
  */
 static void SRXAFSCB_ProbeUuid(struct work_struct *work)
 {
@@ -547,7 +503,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
                afs_extract_to_buf(call, 11 * sizeof(__be32));
                call->unmarshall++;
 
-               /* Fall through */
+               fallthrough;
        case 1:
                _debug("extract UUID");
                ret = afs_extract_data(call, false);
@@ -581,7 +537,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
 
        if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
                return afs_io_error(call, afs_io_error_cm_reply);
-       return afs_find_cm_server_by_uuid(call, call->request);
+       return afs_find_cm_server_by_peer(call);
 }
 
 /*
@@ -662,7 +618,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
                call->unmarshall++;
 
                /* extract the FID array and its count in two steps */
-               /* Fall through */
+               fallthrough;
        case 1:
                _debug("extract FID count");
                ret = afs_extract_data(call, true);
@@ -672,8 +628,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
                call->count = ntohl(call->tmp);
                _debug("FID count: %u", call->count);
                if (call->count > YFSCBMAX)
-                       return afs_protocol_error(call, -EBADMSG,
-                                                 afs_eproto_cb_fid_count);
+                       return afs_protocol_error(call, afs_eproto_cb_fid_count);
 
                size = array_size(call->count, sizeof(struct yfs_xdr_YFSFid));
                call->buffer = kmalloc(size, GFP_KERNEL);
@@ -682,7 +637,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
                afs_extract_to_buf(call, size);
                call->unmarshall++;
 
-               /* Fall through */
+               fallthrough;
        case 2:
                _debug("extract FID array");
                ret = afs_extract_data(call, false);