Code/comment formatting changes only.

Code/comment formatting changes only.

--- subversion/libsvn_client/copy.c
+++ subversion/libsvn_client/copy.c
@@ -599,13 +599,13 @@
 }

-/* Starting with the path DIR relative to the root of RA_SESSION, work up
- * through DIR's parents until an existing node is found. Push each
- * nonexistent path onto the array NEW_DIRS, allocating in POOL.
- * Raise an error if the existing node is not a directory.
- *
- * ### The multiple requests for HEAD revision (SVN_INVALID_REVNUM) make
- * this implementation susceptible to race conditions. */
+/* Starting with the path DIR relative to the RA_SESSION's session
+   URL, work up through DIR's parents until an existing node is found.
+   Push each nonexistent path onto the array NEW_DIRS, allocating in
+   POOL.  Raise an error if the existing node is not a directory.
+
+   ### Multiple requests for HEAD (SVN_INVALID_REVNUM) make this
+   ### implementation susceptible to race conditions.  */
 static svn_error_t *
 find_absent_parents1(svn_ra_session_t *ra_session,
                      const char *dir,
@@ -631,22 +631,23 @@

   if (kind != svn_node_dir)
     return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
-                _("Path '%s' already exists, but is not a directory"),
-                dir);
+                             _("Path '%s' already exists, but is not a "
+                               "directory"), dir);

   svn_pool_destroy(iterpool);
   return SVN_NO_ERROR;
 }

-/* Starting with the URL *TOP_DST_URL which is also the root of RA_SESSION,
- * work up through its parents until an existing node is found. Push each
- * nonexistent URL onto the array NEW_DIRS, allocating in POOL.
- * Raise an error if the existing node is not a directory.
- *
- * Set *TOP_DST_URL and the RA session's root to the existing node's URL.
- *
- * ### The multiple requests for HEAD revision (SVN_INVALID_REVNUM) make
- * this implementation susceptible to race conditions. */
+/* Starting with the URL *TOP_DST_URL which is also the root of
+   RA_SESSION, work up through its parents until an existing node is
+   found. Push each nonexistent URL onto the array NEW_DIRS,
+   allocating in POOL.  Raise an error if the existing node is not a
+   directory.
+
+   Set *TOP_DST_URL and the RA session's root to the existing node's URL.
+
+   ### Multiple requests for HEAD (SVN_INVALID_REVNUM) make this
+   ### implementation susceptible to race conditions.  */
 static svn_error_t *
 find_absent_parents2(svn_ra_session_t *ra_session,
                      const char **top_dst_url,


Include stdexcept to get declaration of std::runtime_error.

--- storage/src/vespa/storage/persistence/testandsethelper.h
+++ storage/src/vespa/storage/persistence/testandsethelper.h
@@ -5,6 +5,7 @@

 #include <vespa/storageapi/message/persistence.h>
 #include <vespa/persistence/spi/result.h>
+#include <stdexcept>

 namespace document::select { class Node; }
 namespace document { class FieldSet; }


Version 0.5.2

Version 0.5.2

Signed-off-by: Daniel Lezcano <e9fa45941f2ebe89c1b9d6c5f339ab42eadb8567@linaro.org>


Fix bitfields header

Fix bitfields header

--- lib/bitfields.h
+++ lib/bitfields.h
@@ -1,5 +1,6 @@
 #pragma once
 #include <string>
+#include <stdint.h>

 namespace Util{
   bool stringToBool(std::string & str);


* subversion/libsvn_client/diff.c

* subversion/libsvn_client/diff.c

  (diff_file_changed): Use symbolic values instead of hardcoded
    ones.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@844985 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_client/diff.c
+++ subversion/libsvn_client/diff.c
@@ -266,7 +266,8 @@
       svn_config_t *cfg = apr_hash_get (diff_cmd_baton->config,
                                         SVN_CONFIG_CATEGORY_CONFIG,
                                         APR_HASH_KEY_STRING);
-      svn_config_get (cfg, &diff_cmd, "helpers", "diff-cmd", NULL);
+      svn_config_get (cfg, &diff_cmd, SVN_CONFIG_SECTION_HELPERS,
+                      SVN_CONFIG_OPTION_DIFF_CMD, NULL);
     }

   if (diff_cmd)


Followup to r11479 to fix issue 1943.  Make merge_cmd_baton.added_path
track the last dir added to a versioned dir.

* subversion/libsvn_client/diff.c
  (struct merge_cmd_baton): Tweak comment.
  (merge_dir_added): Simplify setting of added_dir.

--- subversion/libsvn_client/diff.c
+++ subversion/libsvn_client/diff.c
@@ -629,8 +629,8 @@
   svn_boolean_t force;
   svn_boolean_t dry_run;
   const char *added_path;             /* Set to the dir path whenever the
-                                         added dir is not a child of the
-                                         current added_path (dry-run only) */
+                                         dir is added as a child of a
+                                         versioned dir (dry-run only) */
   const char *target;                 /* Working copy target of merge */
   const char *url;                    /* The second URL in the merge */
   const char *path;                   /* The wc path of the second target, this
@@ -1015,9 +1015,7 @@
                                merge_b->pool));

         }
-      if (merge_b->dry_run
-          && (! merge_b->added_path
-              || ! svn_path_is_child (merge_b->added_path, path, subpool)))
+      if (merge_b->dry_run)
         merge_b->added_path = apr_pstrdup (merge_b->pool, path);
       if (state)
         *state = svn_wc_notify_state_changed;
@@ -1035,9 +1033,7 @@
                                  merge_b->ctx->cancel_baton,
                                  NULL, NULL, /* no notification func! */
                                  merge_b->pool));
-          if (merge_b->dry_run
-              && (! merge_b->added_path
-                  || ! svn_path_is_child (merge_b->added_path, path, subpool)))
+          if (merge_b->dry_run)
             merge_b->added_path = apr_pstrdup (merge_b->pool, path);
           if (state)
             *state = svn_wc_notify_state_changed;


Update bridge.h

Update bridge.h

--- objc_classes/aux/bridge.h
+++ objc_classes/aux/bridge.h
@@ -18,4 +18,8 @@
 @property (nonatomic) double mg_y;
 @property (nonatomic) double mg_z;

+@property (nonatomic) double sp_yaw;
+@property (nonatomic) double sp_pitch;
+@property (nonatomic) double sp_roll;
+
 @end


Make "svn diff" print distinct labels for the two files.
Initial solution for issue #1080.  Not calling it resolved, but at
least with distinct labels we're not as losing as before.

* subversion/libsvn_client/diff.c
  (struct diff_cmd_baton): New fields orig_path_1 and orig_path_2.
  (svn_client_diff): Initialize new fields.
  (diff_file_changed): Use distinct paths for the labels, if the
  revision numbers are the same.

--- subversion/libsvn_client/diff.c
+++ subversion/libsvn_client/diff.c
@@ -134,6 +134,13 @@
   apr_file_t *outfile;
   apr_file_t *errfile;

+  /* The original targets passed to the diff command.  We may need
+     these to construct distinctive diff labels when comparing the
+     same relative path in the same revision, under different anchors
+     (for example, when comparing a trunk against a branch). */
+  const char *orig_path_1;
+  const char *orig_path_2;
+
   /* These are the numeric representations of the revisions passed to
      svn_client_diff, either may be SVN_INVALID_REVNUM.  We need these
      because some of the svn_wc_diff_callbacks_t don't get revision
@@ -204,8 +211,53 @@
   SVN_ERR (svn_io_file_printf (outfile, "Index: %s\n%s\n",
                                path, equal_string));

-  label1 = diff_label (path, rev1, subpool);
-  label2 = diff_label (path, rev2, subpool);
+  if (rev1 == rev2)
+    {
+      /* ### Holy cow.  Due to anchor/target weirdness, we can't
+         simply join diff_cmd_baton->orig_path_1 with path, ditto for
+         orig_path_2.  That will work when they're directory URLs, but
+         not for file URLs.  Nor can we just use anchor1 and anchor2
+         from do_diff(), at least not without some more logic here.
+         What a nightmare.
+
+         For now, to distinguish the two paths, we'll just put the
+         unique portions of the original targets in parentheses before
+         the received path, with ellipses for handwaving.  This makes
+         the labels a bit clumsy, but at least distinctive.  Better
+         solutions are possible, they'll just take more thought. */
+      const char *path1 = diff_cmd_baton->orig_path_1;
+      const char *path2 = diff_cmd_baton->orig_path_2;
+      int i;
+
+      for (i = 0; path1[i] && path2[i] && (path1[i] == path2[i]); i++)
+        ;
+
+      path1 = path1 + i;
+      path2 = path2 + i;
+
+      if (path1[0] == '\0')
+        path1 = apr_psprintf (subpool, "%s", path);
+      else if (path1[0] == '/')
+        path1 = apr_psprintf (subpool, "(...%s) %s", path1, path);
+      else
+        path1 = apr_psprintf (subpool, "(.../%s) %s", path1, path);
+
+      if (path2[0] == '\0')
+        path2 = apr_psprintf (subpool, "%s", path);
+      else if (path2[0] == '/')
+        path2 = apr_psprintf (subpool, "(...%s) %s", path2, path);
+      else
+        path2 = apr_psprintf (subpool, "(.../%s) %s", path2, path);
+
+      label1 = diff_label (path1, rev1, subpool);
+      label2 = diff_label (path2, rev2, subpool);
+    }
+  else
+    {
+      label1 = diff_label (path, rev1, subpool);
+      label2 = diff_label (path, rev2, subpool);
+    }
+
   SVN_ERR (svn_io_run_diff (".", args, nargs, label1, label2,
                             tmpfile1, tmpfile2,
                             &exitcode, outfile, errfile, subpool));
@@ -1315,6 +1367,9 @@
   diff_callbacks.dir_deleted = diff_dir_deleted;
   diff_callbacks.props_changed = diff_props_changed;

+  diff_cmd_baton.orig_path_1 = path1;
+  diff_cmd_baton.orig_path_2 = path2;
+
   diff_cmd_baton.options = options;
   diff_cmd_baton.pool = pool;
   diff_cmd_baton.outfile = outfile;


* diff.c (do_diff): Fix some error handling, courtesy of gcc
-Wunreachable-code.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@842050 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_client/diff.c
+++ subversion/libsvn_client/diff.c
@@ -878,8 +878,8 @@
       path_str.len = path1->len;
       if (svn_path_is_url (&path_str))
         {
-          return svn_error_create (SVN_ERR_INCORRECT_PARAMS, 0, NULL, pool,
-                                   "do_diff: path isn't a working-copy path.");
+          err = svn_error_create (SVN_ERR_INCORRECT_PARAMS, 0, NULL, pool,
+                                  "do_diff: path isn't a working-copy path.");
           goto polite_error;
         }

@@ -902,8 +902,8 @@
       path_str.len = path2->len;
       if (svn_path_is_url (&path_str))
         {
-          return svn_error_create (SVN_ERR_INCORRECT_PARAMS, 0, NULL, pool,
-                                   "do_diff: path isn't a working-copy path.");
+          err = svn_error_create (SVN_ERR_INCORRECT_PARAMS, 0, NULL, pool,
+                                  "do_diff: path isn't a working-copy path.");
           goto polite_error;
         }


* subversion/libsvn_client/util.c
  (fetch_kind_func): Following up on r1449490, unbreak compilation.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1449491 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_client/util.c
+++ subversion/libsvn_client/util.c
@@ -383,7 +383,7 @@
     }

   /* Reads the WORKING kind. Not the BASE kind */
-  SVN_ERR(svn_wc_read_kind2(kind, scb->wc_ctx, local_abspath, FALSE,
+  SVN_ERR(svn_wc_read_kind2(kind, scb->wc_ctx, local_abspath, TRUE, FALSE,
                             scratch_pool));

   return SVN_NO_ERROR;


Ensure that in a fsfs repository that the callers of svn_fs_txn_commit()
and svn_repos_fs_txn_commit() are informed that the commit succeeded
regardless of any errors after the commit is globally visible.

I looked at the BDB implementation and from a cursory review, it looks
like it is fine.

* subversion/libsvn_fs_fs/fs_fs.c
  (commit_body):
    Set the revision pointer value to the newly committed revision
    number immediately after the 'current' file is atomically moved
    into place, do not set it after the transaction is deleted because
    the deletion could fail (not that this is likely).

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1051751 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_fs_fs/fs_fs.c
+++ subversion/libsvn_fs_fs/fs_fs.c
@@ -6219,12 +6219,18 @@
   /* Update the 'current' file. */
   SVN_ERR(write_final_current(cb->fs, cb->txn->id, new_rev, start_node_id,
                               start_copy_id, pool));
+
+  /* At this point the new revision is committed and globally visible
+     so let the caller know it succeeded by giving it the new revision
+     number, which fulfills svn_fs_commit_txn() contract.  Any errors
+     after this point do not change the fact that a new revision was
+     created. */
+  *cb->new_rev_p = new_rev;
+
   ffd->youngest_rev_cache = new_rev;

   /* Remove this transaction directory. */
   SVN_ERR(svn_fs_fs__purge_txn(cb->fs, cb->txn->id, pool));
-
-  *cb->new_rev_p = new_rev;

   return SVN_NO_ERROR;
 }


add sig0 comment

add sig0 comment

--- lib/dns/sec/dst/dst_api.c
+++ lib/dns/sec/dst/dst_api.c
@@ -19,7 +19,7 @@

 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.108 2003/09/30 05:56:18 marka Exp $
+ * $Id: dst_api.c,v 1.109 2003/09/30 06:18:11 marka Exp $
  */

 #include <config.h>
@@ -920,7 +920,7 @@
 	if (strcasecmp(DST_AS_STR(token), "DNSKEY") == 0)
 		type = dns_rdatatype_dnskey;
 	else if (strcasecmp(DST_AS_STR(token), "KEY") == 0)
-		type = dns_rdatatype_key;
+		type = dns_rdatatype_key; /* SIG(0) */
 	else
 		BADTOKEN();


qemu: snapshot: Remove pre-blockdev code paths

Assume that QEMU_CAPS_BLOCKDEV is present and remove all code executed
when it's not.

Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Pavel Hrdina <d4772d05997b8abf035041e3b4f4996380ea7e7a@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- src/qemu/qemu_snapshot.c
+++ src/qemu/qemu_snapshot.c
@@ -448,8 +448,7 @@
 static int
 qemuSnapshotPrepareDiskExternalActive(virDomainObj *vm,
                                       virDomainSnapshotDiskDef *snapdisk,
-                                      virDomainDiskDef *domdisk,
-                                      bool blockdev)
+                                      virDomainDiskDef *domdisk)
 {
     virStorageType actualType = virStorageSourceGetActualType(snapdisk->src);

@@ -469,38 +468,7 @@
     switch (actualType) {
     case VIR_STORAGE_TYPE_BLOCK:
     case VIR_STORAGE_TYPE_FILE:
-        break;
-
     case VIR_STORAGE_TYPE_NETWORK:
-        /* defer all of the checking to either qemu or libvirt's blockdev code */
-        if (blockdev)
-            break;
-
-        switch ((virStorageNetProtocol) snapdisk->src->protocol) {
-        case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
-            break;
-
-        case VIR_STORAGE_NET_PROTOCOL_NONE:
-        case VIR_STORAGE_NET_PROTOCOL_NBD:
-        case VIR_STORAGE_NET_PROTOCOL_RBD:
-        case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
-        case VIR_STORAGE_NET_PROTOCOL_ISCSI:
-        case VIR_STORAGE_NET_PROTOCOL_HTTP:
-        case VIR_STORAGE_NET_PROTOCOL_HTTPS:
-        case VIR_STORAGE_NET_PROTOCOL_FTP:
-        case VIR_STORAGE_NET_PROTOCOL_FTPS:
-        case VIR_STORAGE_NET_PROTOCOL_TFTP:
-        case VIR_STORAGE_NET_PROTOCOL_SSH:
-        case VIR_STORAGE_NET_PROTOCOL_VXHS:
-        case VIR_STORAGE_NET_PROTOCOL_NFS:
-        case VIR_STORAGE_NET_PROTOCOL_LAST:
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("external active snapshots are not supported on "
-                             "'network' disks using '%s' protocol"),
-                           virStorageNetProtocolTypeToString(snapdisk->src->protocol));
-            return -1;
-
-        }
         break;

     case VIR_STORAGE_TYPE_DIR:
@@ -527,17 +495,8 @@
                                 virDomainDiskDef *disk,
                                 virDomainSnapshotDiskDef *snapdisk,
                                 bool active,
-                                bool reuse,
-                                bool blockdev)
-{
-
-    if (disk->src->readonly && !(reuse || blockdev)) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("external snapshot for readonly disk %s "
-                         "is not supported"), disk->dst);
-        return -1;
-    }
-
+                                bool reuse)
+{
     if (qemuTranslateSnapshotDiskSourcePool(snapdisk) < 0)
         return -1;

@@ -548,7 +507,7 @@
         if (qemuSnapshotPrepareDiskExternalInactive(snapdisk, disk) < 0)
             return -1;
     } else {
-        if (qemuSnapshotPrepareDiskExternalActive(vm, snapdisk, disk, blockdev) < 0)
+        if (qemuSnapshotPrepareDiskExternalActive(vm, snapdisk, disk) < 0)
             return -1;
     }

@@ -678,8 +637,6 @@
                     bool *has_manual,
                     unsigned int *flags)
 {
-    qemuDomainObjPrivate *priv = vm->privateData;
-    bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
     size_t i;
     bool active = virDomainObjIsActive(vm);
     bool reuse = (*flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
@@ -741,16 +698,10 @@
                                    _("metadata cache max size control is supported only with qcow2 images"));
                     return -1;
                 }
-
-                if (!blockdev) {
-                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                                   _("metadata cache max size control is not supported with this QEMU binary"));
-                    return -1;
-                }
             }

             if (qemuSnapshotPrepareDiskExternal(vm, dom_disk, disk,
-                                                active, reuse, blockdev) < 0)
+                                                active, reuse) < 0)
                 return -1;

             external++;
@@ -1057,10 +1008,7 @@
     virDomainObj *vm = snapctxt->vm;
     qemuDomainObjPrivate *priv = vm->privateData;
     virQEMUDriver *driver = priv->driver;
-    bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
     virDomainDiskDef *persistdisk;
-    bool supportsCreate;
-    bool updateRelativeBacking = false;
     qemuSnapshotDiskData *dd = snapctxt->dd + snapctxt->ndd++;

     dd->disk = disk;
@@ -1090,28 +1038,15 @@
             return -1;
     }

-    supportsCreate = virStorageSourceSupportsCreate(dd->src);
-
-    /* relative backing store paths need to be updated so that relative
-     * block commit still works. With blockdev we must update it when doing
-     * commit anyways so it's skipped here */
-    if (!blockdev &&
-        virStorageSourceSupportsBackingChainTraversal(dd->src))
-        updateRelativeBacking = true;
-
-    if (supportsCreate || updateRelativeBacking) {
+    if (virStorageSourceSupportsCreate(dd->src)) {
         if (qemuDomainStorageFileInit(driver, vm, dd->src, NULL) < 0)
             return -1;

         dd->initialized = true;

-        if (reuse) {
-            if (updateRelativeBacking &&
-                virStorageSourceFetchRelativeBackingPath(dd->src, &dd->relPath) < 0)
-                return -1;
-        } else {
+        if (!reuse) {
             /* pre-create the image file so that we can label it before handing it to qemu */
-            if (supportsCreate && dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
+            if (dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
                 if (virStorageSourceCreate(dd->src) < 0) {
                     virReportSystemError(errno, _("failed to create image file '%s'"),
                                          NULLSTR(dd->src->path));
@@ -1129,20 +1064,15 @@

     dd->prepared = true;

-    if (blockdev) {
-        if (qemuSnapshotDiskPrepareOneBlockdev(vm, dd, snapctxt->cfg, reuse,
-                                               blockNamedNodeData, snapctxt->asyncJob) < 0)
-            return -1;
-
-        if (qemuSnapshotDiskBitmapsPropagate(dd, snapctxt->actions, blockNamedNodeData) < 0)
-            return -1;
-
-        if (qemuBlockSnapshotAddBlockdev(snapctxt->actions, dd->disk, dd->src) < 0)
-            return -1;
-    } else {
-        if (qemuBlockSnapshotAddLegacy(snapctxt->actions, dd->disk, dd->src, reuse) < 0)
-            return -1;
-    }
+    if (qemuSnapshotDiskPrepareOneBlockdev(vm, dd, snapctxt->cfg, reuse,
+                                           blockNamedNodeData, snapctxt->asyncJob) < 0)
+        return -1;
+
+    if (qemuSnapshotDiskBitmapsPropagate(dd, snapctxt->actions, blockNamedNodeData) < 0)
+        return -1;
+
+    if (qemuBlockSnapshotAddBlockdev(snapctxt->actions, dd->disk, dd->src) < 0)
+        return -1;

     return 0;
 }
@@ -1209,17 +1139,6 @@
 }

-static void
-qemuSnapshotDiskUpdateSourceRenumber(virStorageSource *src)
-{
-    virStorageSource *next;
-    unsigned int idx = 1;
-
-    for (next = src->backingStore; virStorageSourceIsBacking(next); next = next->backingStore)
-        next->id = idx++;
-}
-
-
 /**
  * qemuSnapshotDiskUpdateSource:
  * @vm: domain object
@@ -1254,10 +1173,6 @@
     dd->disk->src->relPath = g_steal_pointer(&dd->relPath);
     dd->src->backingStore = g_steal_pointer(&dd->disk->src);
     dd->disk->src = g_steal_pointer(&dd->src);
-
-    /* fix numbering of disks */
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
-        qemuSnapshotDiskUpdateSourceRenumber(dd->disk->src);

     if (dd->persistdisk) {
         dd->persistdisk->src->readonly = true;
@@ -1413,8 +1328,7 @@
     /* We need to collect reply from 'query-named-block-nodes' prior to the
      * migration step as qemu deactivates bitmaps after migration so the result
      * would be wrong */
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
-        !(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_SNAPSHOT)))
+    if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_SNAPSHOT)))
         goto cleanup;

     /* do the memory snapshot if necessary */


AbstractDngDecompressor: kill unused nThreads variable

--- src/librawspeed/decompressors/AbstractDngDecompressor.h
+++ src/librawspeed/decompressors/AbstractDngDecompressor.h
@@ -61,7 +61,6 @@
   bool mFixLjpeg;
   uint32 mPredictor;
   uint32 mBps;
-  uint32 nThreads;
   int compression;
 };


Remove some redundant code.

Remove some redundant code.

* subversion/libsvn_fs_fs/fs_fs.c
  (recover_find_max_ids): Don't bother reading the noderev id or creating a
    noderev structure, as we don't use them.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@982248 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_fs_fs/fs_fs.c
+++ subversion/libsvn_fs_fs/fs_fs.c
@@ -6628,7 +6628,7 @@
 {
   apr_hash_t *headers;
   char *value;
-  node_revision_t noderev;
+  representation_t *data_rep;
   struct rep_args *ra;
   struct recover_read_from_file_baton baton;
   svn_stream_t *stream;
@@ -6641,10 +6641,6 @@
                                                                pool),
                             pool));

-  /* We're going to populate a skeletal noderev - just the id and data_rep. */
-  value = apr_hash_get(headers, HEADER_ID, APR_HASH_KEY_STRING);
-  noderev.id = svn_fs_fs__id_parse(value, strlen(value), pool);
-
   /* Check that this is a directory.  It should be. */
   value = apr_hash_get(headers, HEADER_TYPE, APR_HASH_KEY_STRING);
   if (value == NULL || strcmp(value, KIND_DIR) != 0)
@@ -6655,18 +6651,18 @@
   value = apr_hash_get(headers, HEADER_TEXT, APR_HASH_KEY_STRING);
   if (!value)
     return SVN_NO_ERROR;
-  SVN_ERR(read_rep_offsets(&noderev.data_rep, value, NULL, FALSE, pool));
+  SVN_ERR(read_rep_offsets(&data_rep, value, NULL, FALSE, pool));

   /* If the directory's data representation wasn't changed in this revision,
      we've already scanned the directory's contents for noderevs, so we don't
      need to again.  This will occur if a property is changed on a directory
      without changing the directory's contents. */
-  if (noderev.data_rep->revision != rev)
+  if (data_rep->revision != rev)
     return SVN_NO_ERROR;

   /* We could use get_dir_contents(), but this is much cheaper.  It does
      rely on directory entries being stored as PLAIN reps, though. */
-  offset = noderev.data_rep->offset;
+  offset = data_rep->offset;
   SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
   SVN_ERR(read_rep_line(&ra, rev_file, pool));
   if (ra->is_delta)
@@ -6678,7 +6674,7 @@
      stored in the representation. */
   baton.file = rev_file;
   baton.pool = pool;
-  baton.remaining = noderev.data_rep->expanded_size;
+  baton.remaining = data_rep->expanded_size;
   stream = svn_stream_create(&baton, pool);
   svn_stream_set_read(stream, read_handler_recover);


qemu_snapshot: revert: move active snapshot revert to separate function

Signed-off-by: Pavel Hrdina <d4772d05997b8abf035041e3b4f4996380ea7e7a@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- src/qemu/qemu_snapshot.c
+++ src/qemu/qemu_snapshot.c
@@ -2031,6 +2031,99 @@
 }

+static int
+qemuSnapshotRevertActive(virDomainObj *vm,
+                         virDomainSnapshotPtr snapshot,
+                         virDomainMomentObj *snap,
+                         virDomainSnapshotDef *snapdef,
+                         virQEMUDriver *driver,
+                         virQEMUDriverConfig *cfg,
+                         virDomainDef **config,
+                         virDomainDef **inactiveConfig,
+                         unsigned int start_flags,
+                         unsigned int flags)
+{
+    virObjectEvent *event = NULL;
+    virObjectEvent *event2 = NULL;
+    int detail;
+    bool defined = false;
+    qemuDomainSaveCookie *cookie = (qemuDomainSaveCookie *) snapdef->cookie;
+    int rc;
+
+    start_flags |= VIR_QEMU_PROCESS_START_PAUSED;
+
+    /* Transitions 2, 3, 5, 6, 8, 9 */
+    if (virDomainObjIsActive(vm)) {
+        /* Transitions 5, 6, 8, 9 */
+        qemuProcessStop(driver, vm,
+                        VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT,
+                        QEMU_ASYNC_JOB_START, 0);
+        virDomainAuditStop(vm, "from-snapshot");
+        detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT;
+        event = virDomainEventLifecycleNewFromObj(vm,
+                                                  VIR_DOMAIN_EVENT_STOPPED,
+                                                  detail);
+        virObjectEventStateQueue(driver->domainEventState, event);
+    }
+
+    if (*inactiveConfig) {
+        virDomainObjAssignDef(vm, inactiveConfig, false, NULL);
+        defined = true;
+    }
+
+    virDomainObjAssignDef(vm, config, true, NULL);
+
+    /* No cookie means libvirt which saved the domain was too old to
+     * mess up the CPU definitions.
+     */
+    if (cookie &&
+        qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
+        return -1;
+
+    rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
+                          cookie ? cookie->cpu : NULL,
+                          QEMU_ASYNC_JOB_START, NULL, -1, NULL, snap,
+                          VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
+                          start_flags);
+    virDomainAuditStart(vm, "from-snapshot", rc >= 0);
+    detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
+    event = virDomainEventLifecycleNewFromObj(vm,
+                                     VIR_DOMAIN_EVENT_STARTED,
+                                     detail);
+    virObjectEventStateQueue(driver->domainEventState, event);
+    if (rc < 0)
+        return -1;
+
+    /* Touch up domain state.  */
+    if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) &&
+        (snapdef->state == VIR_DOMAIN_SNAPSHOT_PAUSED ||
+         (flags & VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) {
+        /* Transitions 3, 6, 9 */
+        virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
+                             VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
+        detail = VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT;
+        event2 = virDomainEventLifecycleNewFromObj(vm,
+                                          VIR_DOMAIN_EVENT_SUSPENDED,
+                                          detail);
+        virObjectEventStateQueue(driver->domainEventState, event2);
+    } else {
+        /* Transitions 2, 5, 8 */
+        if (!virDomainObjIsActive(vm)) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("guest unexpectedly quit"));
+            return -1;
+        }
+        rc = qemuProcessStartCPUs(driver, vm,
+                                  VIR_DOMAIN_RUNNING_FROM_SNAPSHOT,
+                                  QEMU_ASYNC_JOB_START);
+        if (rc < 0)
+            return -1;
+    }
+
+    return qemuSnapshotRevertWriteMetadata(vm, snap, driver, cfg, defined);
+}
+
+
 /* The domain is expected to be locked and inactive. */
 static int
 qemuSnapshotRevertInactive(virQEMUDriver *driver,
@@ -2076,7 +2169,6 @@
     g_autoptr(virDomainDef) config = NULL;
     g_autoptr(virDomainDef) inactiveConfig = NULL;
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
-    qemuDomainSaveCookie *cookie;
     unsigned int start_flags = VIR_QEMU_PROCESS_START_GEN_VMID;
     bool defined = false;

@@ -2120,81 +2212,14 @@
         goto endjob;
     }

-    cookie = (qemuDomainSaveCookie *) snapdef->cookie;
-
     switch ((virDomainSnapshotState) snapdef->state) {
     case VIR_DOMAIN_SNAPSHOT_RUNNING:
     case VIR_DOMAIN_SNAPSHOT_PAUSED:
-        start_flags |= VIR_QEMU_PROCESS_START_PAUSED;
-
-        /* Transitions 2, 3, 5, 6, 8, 9 */
-        if (virDomainObjIsActive(vm)) {
-            /* Transitions 5, 6, 8, 9 */
-            qemuProcessStop(driver, vm,
-                            VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT,
-                            QEMU_ASYNC_JOB_START, 0);
-            virDomainAuditStop(vm, "from-snapshot");
-            detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT;
-            event = virDomainEventLifecycleNewFromObj(vm,
-                                                      VIR_DOMAIN_EVENT_STOPPED,
-                                                      detail);
-            virObjectEventStateQueue(driver->domainEventState, event);
-        }
-
-        if (inactiveConfig) {
-            virDomainObjAssignDef(vm, &inactiveConfig, false, NULL);
-            defined = true;
-        }
-
-        virDomainObjAssignDef(vm, &config, true, NULL);
-
-        /* No cookie means libvirt which saved the domain was too old to
-         * mess up the CPU definitions.
-         */
-        if (cookie &&
-            qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
-            goto endjob;
-
-        rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
-                              cookie ? cookie->cpu : NULL,
-                              QEMU_ASYNC_JOB_START, NULL, -1, NULL, snap,
-                              VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
-                              start_flags);
-        virDomainAuditStart(vm, "from-snapshot", rc >= 0);
-        detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
-        event = virDomainEventLifecycleNewFromObj(vm,
-                                         VIR_DOMAIN_EVENT_STARTED,
-                                         detail);
-        virObjectEventStateQueue(driver->domainEventState, event);
-        if (rc < 0)
-            goto endjob;
-
-        /* Touch up domain state.  */
-        if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) &&
-            (snapdef->state == VIR_DOMAIN_SNAPSHOT_PAUSED ||
-             (flags & VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) {
-            /* Transitions 3, 6, 9 */
-            virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
-                                 VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
-            detail = VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT;
-            event2 = virDomainEventLifecycleNewFromObj(vm,
-                                              VIR_DOMAIN_EVENT_SUSPENDED,
-                                              detail);
-            virObjectEventStateQueue(driver->domainEventState, event2);
-        } else {
-            /* Transitions 2, 5, 8 */
-            if (!virDomainObjIsActive(vm)) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("guest unexpectedly quit"));
-                goto endjob;
-            }
-            rc = qemuProcessStartCPUs(driver, vm,
-                                      VIR_DOMAIN_RUNNING_FROM_SNAPSHOT,
-                                      QEMU_ASYNC_JOB_START);
-            if (rc < 0)
-                goto endjob;
-        }
-        break;
+        ret = qemuSnapshotRevertActive(vm, snapshot, snap, snapdef,
+                                       driver, cfg,
+                                       &config, &inactiveConfig,
+                                       start_flags, flags);
+        goto endjob;

     case VIR_DOMAIN_SNAPSHOT_SHUTDOWN:
     case VIR_DOMAIN_SNAPSHOT_SHUTOFF:


vere: add ames counters for forwarded packets

Track the amount of packets we forward, and the amount we drop due to
forward queue pressure. Once every 1000 packets, printf the total.

--- pkg/urbit/vere/io/ames.c
+++ pkg/urbit/vere/io/ames.c
@@ -45,6 +45,8 @@
     c3_o          fit_o;                //  filtering active
     c3_y          ver_y;                //  protocol version
     c3_d          foq_d;                //  forward queue size
+    c3_d          fow_d;                //  forwarded count
+    c3_d          fod_d;                //  forwards dropped count
   } u3_ames;

 /* u3_head: ames packet header
@@ -597,6 +599,11 @@

     c3_free(bod_y);
     u3z(bod);
+  }
+
+  pac_u->sam_u->fow_d++;
+  if ( 0 == (pac_u->sam_u->fow_d % 1000) ) {
+    u3l_log("ames: forwarded %" PRIu64 " total\n", pac_u->sam_u->fow_d);
   }

   pac_u->sam_u->foq_d--;
@@ -718,6 +725,11 @@
         if ( (1000 < sam_u->foq_d)
           && !((c3y == u3a_is_cat(rec)) && (256 > rec)) )
         {
+          sam_u->fod_d++;
+          if ( 0 == (sam_u->fod_d % 1000) ) {
+            u3l_log("ames: dropped %" PRIu64 " forwards total\n", sam_u->fod_d);
+          }
+
           u3z(sen); u3z(rec);
         }
         //  otherwise, proceed with forwarding


qemu_validate: Validate that QEMU's capable of guestReset

Now that we have a capability, validate that the QEMU we are
talking to has everything we need for guestReset.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- src/qemu/qemu_validate.c
+++ src/qemu/qemu_validate.c
@@ -2543,6 +2543,14 @@
     if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
+            if (hostdev->source.subsys.u.usb.guestReset &&
+                !virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_HOST_GUESTS_RESETS_ALL)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("guestReset is not supported with this version of QEMU"));
+                return -1;
+            }
+            break;
+
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
             break;


A follow-up to r26436.

A follow-up to r26436.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__txn_mergeinfo): Remove declaration of non-existent API.

--- subversion/libsvn_fs_fs/fs_fs.h
+++ subversion/libsvn_fs_fs/fs_fs.h
@@ -334,13 +334,6 @@
                                      svn_fs_txn_t *txn,
                                      apr_pool_t *pool);

-/* Return the changed mergeinfo list from transaction TXN and store it
-   in *MINFOLIST (never NULL), allocating the mergeinfo list from
-   POOL.  */
-svn_error_t *svn_fs_fs__txn_mergeinfo(apr_hash_t **minfolist,
-                                      svn_fs_txn_t *txn,
-                                      apr_pool_t *pool);
-
 /* Delete the mutable node-revision referenced by ID, along with any
    mutable props or directory contents associated with it.  Perform
    temporary allocations in POOL. */


Fix use of PathEndsInSlash on win32 path.

--- plcore/pl_filesystem.c
+++ plcore/pl_filesystem.c
@@ -641,7 +641,7 @@
 	}

 	char selectorPath[ PL_SYSTEM_MAX_PATH ];
-	snprintf( selectorPath, sizeof( selectorPath ), PathEndsInSlash( path ) ? "%s*.%s" : "%s/*.%s", path, extension );
+	snprintf( selectorPath, sizeof( selectorPath ), PlPathEndsInSlash( path ) ? "%s*.%s" : "%s/*.%s", path, extension );

 	WIN32_FIND_DATA ffd;
 	HANDLE find = FindFirstFile( selectorPath, &ffd );
@@ -650,7 +650,7 @@
 	}

 	do {
-		snprintf( selectorPath, sizeof( selectorPath ), PathEndsInSlash( path ) ? "%s%s" : "%s/%s", path, ffd.cFileName );
+		snprintf( selectorPath, sizeof( selectorPath ), PlPathEndsInSlash( path ) ? "%s%s" : "%s/%s", path, ffd.cFileName );

 		if ( ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
 			if ( recursive && !( strcmp( ffd.cFileName, "." ) == 0 || strcmp( ffd.cFileName, ".." ) == 0 ) ) {


increased log buffer size with uIP SLIP

increased log buffer size with uIP SLIP

--- platform/cooja/sys/log.c
+++ platform/cooja/sys/log.c
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: log.c,v 1.6 2008/10/05 15:40:27 fros4943 Exp $
+ * $Id: log.c,v 1.7 2009/10/19 18:00:49 fros4943 Exp $
  */

 #include <stdio.h>
@@ -36,7 +36,14 @@
 #include "lib/simEnvChange.h"

 #define IMPLEMENT_PRINTF 1
+
+#if WITH_UIP
+/* uIP packets via SLIP */
+#include "uip.h"
+#define MAX_LOG_LENGTH (2*UIP_BUFSIZE)
+#else /* WITH_UIP */
 #define MAX_LOG_LENGTH 1024
+#endif /* WITH_UIP */

 const struct simInterface simlog_interface;


using memcpy for terminal scrolling

using memcpy for terminal scrolling

--- kernel/arch/i386/tty.c
+++ kernel/arch/i386/tty.c
@@ -40,11 +40,7 @@
 		t->col = 0;
 		if (++t->row == VGA_HEIGHT) {
 			// shift all rows up one
-			for (int j = 0; j < VGA_HEIGHT; j++) {
-				for (int i = 0; i < VGA_WIDTH; i++) {
-					t->buf[(j * VGA_WIDTH) + i] = t->buf[((j + 1) * VGA_WIDTH) + i];
-				}
-			}
+			memcpy(t->buf, &t->buf[VGA_WIDTH], (VGA_HEIGHT - 1) * VGA_WIDTH);
 			t->row = VGA_HEIGHT - 1; // stick at bottom row
 		}
 	}


Followup to r23439, which was prepared before r23429 added
svn_fs_fs__abort_txn to fs_fs.h

* subversion/libsvn_svn_fs/fs_fs.h
  (svn_fs_fs__abort_txn): Remove duplicate declaration.

--- subversion/libsvn_fs_fs/fs_fs.h
+++ subversion/libsvn_fs_fs/fs_fs.h
@@ -412,10 +412,6 @@
                                   svn_revnum_t rev, apr_uint32_t flags,
                                   apr_pool_t *pool);

-/* Abort the existing transaction TXN, performing any temporary
-   allocations in POOL. */
-svn_error_t *svn_fs_fs__abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool);
-
 /* Find the value of the property named PROPNAME in transaction TXN.
    Return the contents in *VALUE_P.  The contents will be allocated
    from POOL. */


On the authzperf branch:

On the authzperf branch:

* subversion/libsvn_repos/authz.c
  (add_next_node): Refine commentary. No functional change.

git-svn-id: 1f1d32df43057f8baf3569895afdc221b0c15aad@1764482 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_repos/authz.c
+++ subversion/libsvn_repos/authz.c
@@ -956,7 +956,8 @@
     {
       /* The rule with the highest sequence number is the one that applies.
        * Not all nodes that we are following have rules that apply directly
-       * to this path but only some deep sub-node. */
+       * to this path but are mere intermediates that may only have some
+       * matching deep sub-node. */
       combine_access(&state->rights, &node->rights);

       /* The rule tree node can be seen as an overlay of all the nodes that
@@ -968,8 +969,8 @@
       /* NODE is now enlisted as a (potential) match for the next segment. */
       APR_ARRAY_PUSH(state->next, node_t *) = node;

-      /* Variable length sub-segment sequences apply to the same node due
-       * to matching empty sequences as well. */
+      /* Variable length sub-segment sequences apply to the same node as
+       * they match empty sequences as well. */
       if (node->pattern_sub_nodes && node->pattern_sub_nodes->any_var)
         {
           node = node->pattern_sub_nodes->any_var;


version set to 7.1.0

version set to 7.1.0

--- kernel/linux/pf_ring.h
+++ kernel/linux/pf_ring.h
@@ -24,10 +24,9 @@

 #define RING_MAGIC
 #define RING_MAGIC_VALUE             0x88
-#define RING_FLOWSLOT_VERSION          16 /*
-					    Increment whenever we change slot or packet header
-					    layout (e.g. we add/move a field)
-					  */
+
+/* Increment whenever we change slot or packet header layout (e.g. we add/move a field) */
+#define RING_FLOWSLOT_VERSION          16

 #define DEFAULT_BUCKET_LEN            128
 #define MAX_NUM_DEVICES               256
@@ -41,8 +40,8 @@
 #define pfring_ptr ax25_ptr

 /* Versioning */
-#define RING_VERSION                "6.7.0"
-#define RING_VERSION_NUM           0x060700
+#define RING_VERSION                "7.1.0"
+#define RING_VERSION_NUM           0x070100

 /* Set */
 #define SO_ADD_TO_CLUSTER                 99
@@ -133,10 +132,10 @@
   please do not change them to unsigned
 */
 struct pkt_offset {
-  int16_t eth_offset; /*
-			 This offset *must* be added to all offsets below
-			 ONLY if you are inside the kernel. Ignore it in user-space.
-		       */
+  /* This 'eth_offset' offset *must* be added to all offsets below
+   * ONLY if you are inside the kernel. Ignore it in user-space. */
+  int16_t eth_offset;
+
   int16_t vlan_offset;
   int16_t l3_offset;
   int16_t l4_offset;


fm10k-zc fix for kernel 3.10.0-957

fm10k-zc fix for kernel 3.10.0-957

--- drivers/intel/fm10k/fm10k-0.23.5-zc/src/kcompat.h
+++ drivers/intel/fm10k/fm10k-0.23.5-zc/src/kcompat.h
@@ -705,11 +705,17 @@
 #ifndef SPEED_5000
 #define SPEED_5000 5000
 #endif
+#ifndef SPEED_14000
+#define SPEED_14000 14000
+#endif
 #ifndef SPEED_25000
 #define SPEED_25000 25000
 #endif
 #ifndef SPEED_50000
 #define SPEED_50000 50000
+#endif
+#ifndef SPEED_56000
+#define SPEED_56000 56000
 #endif
 #ifndef SPEED_100000
 #define SPEED_100000 100000
@@ -839,17 +845,36 @@
 /* SLES12 SP1 GA is 3.12.49-11
  * updates 3.12.xx-60.yy where xx={51..} */
 #define SLE_VERSION_CODE SLE_VERSION(12,1,0)
-#elif (LINUX_VERSION_CODE == KERNEL_VERSION(4,4,21))
-/* SLES12 SP2 GA is 4.4.21-69 */
+#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21) && \
+       (LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,59))) || \
+       (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,74) && \
+        LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) && \
+        SLE_LOCALVERSION_CODE >= KERNEL_VERSION(92,0,0) && \
+        SLE_LOCALVERSION_CODE <  KERNEL_VERSION(93,0,0)))
+/* SLES12 SP2 GA is 4.4.21-69.
+ * SLES12 SP2 updates before SLES12 SP3 are: 4.4.{21,38,49,59}
+ * SLES12 SP2 updates after SLES12 SP3 are: 4.4.{74,90,103,114,120}
+ * but they all use a SLE_LOCALVERSION_CODE matching 92.nn.y */
 #define SLE_VERSION_CODE SLE_VERSION(12,2,0)
-/* SLES12 SP3 GM is 4.4.73-5 and update kernels are 4.4.82-6.3
- * and 4.4.114-94.11 */
-#elif ((LINUX_VERSION_CODE == KERNEL_VERSION(4,4,73)) || \
-       (LINUX_VERSION_CODE == KERNEL_VERSION(4,4,82)) || \
-       (LINUX_VERSION_CODE == KERNEL_VERSION(4,4,114)))
+#elif ((LINUX_VERSION_CODE == KERNEL_VERSION(4,4,73) || \
+        LINUX_VERSION_CODE == KERNEL_VERSION(4,4,82) || \
+        LINUX_VERSION_CODE == KERNEL_VERSION(4,4,92)) || \
+       (LINUX_VERSION_CODE == KERNEL_VERSION(4,4,103) && \
+       (SLE_LOCALVERSION_CODE == KERNEL_VERSION(6,33,0) || \
+        SLE_LOCALVERSION_CODE == KERNEL_VERSION(6,38,0))) || \
+       (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,114) && \
+        LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) && \
+        SLE_LOCALVERSION_CODE >= KERNEL_VERSION(94,0,0) && \
+        SLE_LOCALVERSION_CODE <  KERNEL_VERSION(95,0,0)) )
+/* SLES12 SP3 GM is 4.4.73-5 and update kernels are 4.4.82-6.3.
+ * SLES12 SP3 updates not conflicting with SP2 are: 4.4.{82,92}
+ * SLES12 SP3 updates conflicting with SP2 are:
+ *   - 4.4.103-6.33.1, 4.4.103-6.38.1
+ *   - 4.4.{114,120}-94.nn.y */
 #define SLE_VERSION_CODE SLE_VERSION(12,3,0)
-/* SLES15 Beta1 is 4.12.14-2 */
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,14))
+/* SLES15 Beta1 is 4.12.14-2.
+ * SLES12 SP4 will also use 4.12.14-nn.xx.y */
 #define SLE_VERSION_CODE SLE_VERSION(15,0,0)
 /* new SLES kernels must be added here with >= based on kernel
  * the idea is to order from newest to oldest and just catch all
@@ -874,6 +899,7 @@
 #endif

 #define memcpy(dest, src, len)	memcpy_s(dest, len, src, len)
+#define memset(dest, ch, len)	memset_s(dest, len, ch, len)

 static inline int _kc_test_and_clear_bit(int nr, volatile unsigned long *addr)
 {
@@ -925,6 +951,10 @@
 	     pos;							     \
 	     pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))

+#ifdef uninitialized_var
+#undef uninitialized_var
+#define uninitialized_var(x) x = *(&(x))
+#endif
 #endif /* __KLOCWORK__ */

 /*****************************************************************************/
@@ -2216,6 +2246,11 @@
 #ifndef PCI_EXP_LNKCTL_ASPMC
 #define  PCI_EXP_LNKCTL_ASPMC	0x0003	/* ASPM Control */
 #endif
+
+#ifndef PCI_EXP_LNKCAP_MLW
+#define PCI_EXP_LNKCAP_MLW	0x000003f0 /* Maximum Link Width */
+#endif
+
 #else /* < 2.6.29 */
 #ifndef HAVE_NET_DEVICE_OPS
 #define HAVE_NET_DEVICE_OPS
@@ -2260,8 +2295,20 @@
 #define nr_cpus_node(node) cpumask_weight(cpumask_of_node(node))
 #endif

+#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5,5))
+#define HAVE_PCI_DEV_IS_VIRTFN_BIT
+#endif /* RHEL >= 5.5 */
+
+#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5,5)))
+static inline bool pci_is_root_bus(struct pci_bus *pbus)
+{
+	return !(pbus->parent);
+}
+#endif
+
 #else /* < 2.6.30 */
 #define HAVE_ASPM_QUIRKS
+#define HAVE_PCI_DEV_IS_VIRTFN_BIT
 #endif /* < 2.6.30 */

 /*****************************************************************************/
@@ -2727,6 +2774,19 @@
 				   const void __user *from, size_t count);
 #define simple_write_to_buffer _kc_simple_write_to_buffer

+#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,4)))
+static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
+{
+#ifdef HAVE_PCI_DEV_IS_VIRTFN_BIT
+#ifdef CONFIG_PCI_IOV
+	if (dev->is_virtfn)
+		dev = dev->physfn;
+#endif /* CONFIG_PCI_IOV */
+#endif /* HAVE_PCI_DEV_IS_VIRTFN_BIT */
+	return dev;
+}
+#endif /* ! RHEL >= 6.4 */
+
 #ifndef PCI_EXP_LNKSTA_NLW_SHIFT
 #define PCI_EXP_LNKSTA_NLW_SHIFT 4
 #endif
@@ -3534,6 +3594,7 @@

 /******************************************************************************/
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) )
+#include <linux/workqueue.h>
 #ifndef ADVERTISED_40000baseKR4_Full
 /* these defines were all added in one commit, so should be safe
  * to trigger activiation on one define
@@ -3671,6 +3732,11 @@
 #define pcie_capability_read_word(d,p,v) __kc_pcie_capability_read_word(d,p,v)
 #endif /* pcie_capability_read_word */

+#ifndef pcie_capability_read_dword
+int __kc_pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val);
+#define pcie_capability_read_dword(d,p,v) __kc_pcie_capability_read_dword(d,p,v)
+#endif
+
 #ifndef pcie_capability_write_word
 int __kc_pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val);
 #define pcie_capability_write_word(d,p,v) __kc_pcie_capability_write_word(d,p,v)
@@ -3767,6 +3833,37 @@
 #define __setup_timer(_timer, _fn, _data, _flags)	\
 	setup_timer((_timer), (_fn), (_data))		\

+#if ( ! ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,7) ) ) && \
+	( ! ( SLE_VERSION_CODE >= SLE_VERSION(12,0,0) ) )
+
+#ifndef mod_delayed_work
+/**
+ * __mod_delayed_work - modify delay or queue delayed work
+ * @wq: workqueue to use
+ * @dwork: delayed work to queue
+ * @delay: number of jiffies to wait before queueing
+ *
+ * Return: %true if @dwork was pending and was rescheduled;
+ *         %false if it wasn't pending
+ *
+ * Note: the dwork parameter was declared as a void*
+ *       to avoid comptibility problems with early 2.6 kernels
+ *       where struct delayed_work is not declared. Unlike the original
+ *       implementation flags are not preserved and it shouldn't be
+ *       used in the interrupt context.
+ */
+static inline bool __mod_delayed_work(struct workqueue_struct *wq,
+				    void *dwork,
+				    unsigned long delay)
+{
+	bool ret = cancel_delayed_work(dwork);
+	queue_delayed_work(wq, dwork, delay);
+	return ret;
+}
+#define mod_delayed_work(wq, dwork, delay) __mod_delayed_work(wq, dwork, delay)
+#endif /* mod_delayed_work */
+
+#endif /* !(RHEL >= 6.7) && !(SLE >= 12.0) */
 #else /* >= 3.7.0 */
 #include <linux/hashtable.h>
 #define HAVE_CONST_STRUCT_PCI_ERROR_HANDLERS
@@ -3815,6 +3912,23 @@
 #if (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,4,0))
 #define HAVE_SRIOV_CONFIGURE
 #endif
+
+#ifndef PCI_EXP_LNKCAP_SLS_2_5GB
+#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
+#endif
+
+#ifndef PCI_EXP_LNKCAP_SLS_5_0GB
+#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
+#endif
+
+#undef PCI_EXP_LNKCAP2_SLS_2_5GB
+#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
+
+#undef PCI_EXP_LNKCAP2_SLS_5_0GB
+#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
+
+#undef PCI_EXP_LNKCAP2_SLS_8_0GB
+#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */

 #else /* >= 3.8.0 */
 #ifndef __devinit
@@ -4077,9 +4191,6 @@
 #if !defined(HAVE_UDP_ENC_TUNNEL) && IS_ENABLED(CONFIG_GENEVE)
 #define HAVE_UDP_ENC_TUNNEL
 #endif
-#ifdef ETHTOOL_GLINKSETTINGS
-#define HAVE_ETHTOOL_25G_BITS
-#endif /* ETHTOOL_GLINKSETTINGS */
 #endif /* RHEL >= 7.3 */

 /* new hooks added to net_device_ops_extended in RHEL7.4 */
@@ -4137,8 +4248,19 @@
 #ifndef u64_stats_init
 #define u64_stats_init(a) do { } while(0)
 #endif
-#ifndef BIT_ULL
+#undef BIT_ULL
 #define BIT_ULL(n) (1ULL << (n))
+
+#if (!(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) && \
+     !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,0)))
+static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
+{
+	dev = pci_physfn(dev);
+	if (pci_is_root_bus(dev->bus))
+		return NULL;
+
+	return dev->bus->self;
+}
 #endif

 #if (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,1,0))
@@ -4264,6 +4386,15 @@
 int __kc_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
 		       int target, unsigned short *fragoff, int *flags);
 #define ipv6_find_hdr(a, b, c, d, e) __kc_ipv6_find_hdr((a), (b), (c), (d), (e))
+
+#ifndef OPTIMIZE_HIDE_VAR
+#ifdef __GNUC__
+#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
+#else
+#include <linux/barrier.h>
+#define OPTIMIZE_HIDE_VAR(var)	barrier()
+#endif
+#endif
 #else /* >= 3.14.0 */

 /* for ndo_dfwd_ ops add_station, del_station and _start_xmit */
@@ -4505,6 +4636,11 @@
 }
 #define napi_complete_done _kc_napi_complete_done

+extern int _kc_bitmap_print_to_pagebuf(bool list, char *buf,
+					const unsigned long *maskp,
+					int nmaskbits);
+#define bitmap_print_to_pagebuf _kc_bitmap_print_to_pagebuf
+
 #ifndef NETDEV_RSS_KEY_LEN
 #define NETDEV_RSS_KEY_LEN (13 * 4)
 #endif
@@ -4520,6 +4656,9 @@
 #define dma_rmb() rmb()
 #endif
 #ifndef dev_alloc_pages
+#ifndef NUMA_NO_NODE
+#define NUMA_NO_NODE -1
+#endif
 #define dev_alloc_pages(_order) alloc_pages_node(NUMA_NO_NODE, (GFP_ATOMIC | __GFP_COLD | __GFP_COMP | __GFP_MEMALLOC), (_order))
 #endif
 #ifndef dev_alloc_page
@@ -4823,8 +4962,8 @@
 	* sum = csum_fold(csum_add(diff, ~csum_unfold(*sum)));
 }
 #endif
-
-#if !(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,2)))
+#if !(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,2))) && \
+	!(SLE_VERSION_CODE && (SLE_VERSION_CODE > SLE_VERSION(12,3,0)))
 static inline void page_ref_inc(struct page *page)
 {
 	get_page(page);
@@ -4832,9 +4971,13 @@
 #else
 #define HAVE_PAGE_COUNT_BULK_UPDATE
 #endif
-
+#ifndef IPV4_USER_FLOW
+#define	IPV4_USER_FLOW	0x0d	/* spec only (usr_ip4_spec) */
+#endif
 #else /* >= 4.6.0 */
 #define HAVE_PAGE_COUNT_BULK_UPDATE
+#define HAVE_ETHTOOL_FLOW_UNION_IP6_SPEC
+#define HAVE_PTP_CROSSTIMESTAMP
 #endif /* 4.6.0 */

 /*****************************************************************************/
@@ -4854,9 +4997,6 @@
 #define HAVE_DEVLINK_SUPPORT
 #define HAVE_NETIF_TRANS_UPDATE
 #define HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE
-#ifdef ETHTOOL_GLINKSETTINGS
-#define HAVE_ETHTOOL_25G_BITS
-#endif /* ETHTOOL_GLINKSETTINGS */
 #endif /* 4.7.0 */

 /*****************************************************************************/
@@ -4873,6 +5013,10 @@
 };
 #endif

+#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5))
+#define HAVE_TCF_EXTS_TO_LIST
+#endif
+
 #if !(SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0))) &&\
 	!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4))
 static inline int
@@ -4913,33 +5057,99 @@
 #endif /* !SLE_VERSION(12,3,0) */
 #else
 #define HAVE_UDP_ENC_RX_OFFLOAD
+#define HAVE_TCF_EXTS_TO_LIST
 #endif /* 4.8.0 */

 /*****************************************************************************/
+#ifdef ETHTOOL_GLINKSETTINGS
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0))
+#if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,3)))
+#define HAVE_ETHTOOL_25G_BITS
+#define HAVE_ETHTOOL_50G_BITS
+#define HAVE_ETHTOOL_100G_BITS
+#endif /* RHEL_RELEASE_VERSION(7,3) */
+#if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0)))
+#define HAVE_ETHTOOL_25G_BITS
+#define HAVE_ETHTOOL_50G_BITS
+#define HAVE_ETHTOOL_100G_BITS
+#endif /* SLE_VERSION(12,3,0) */
+#else
+#define HAVE_ETHTOOL_25G_BITS
+#define HAVE_ETHTOOL_50G_BITS
+#define HAVE_ETHTOOL_100G_BITS
+#endif /* KERNEL_VERSION(4.7.0) */
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0))
+#if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4)))
+#define HAVE_ETHTOOL_NEW_50G_BITS
+#endif /* RHEL_RELEASE_VERSION(7,4) */
+#if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0)))
+#define HAVE_ETHTOOL_NEW_50G_BITS
+#endif /* SLE_VERSION(12,3,0) */
+#else
+#define HAVE_ETHTOOL_NEW_50G_BITS
+#endif /* KERNEL_VERSION(4.8.0)*/
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0))
 #if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4)))
+#define HAVE_ETHTOOL_NEW_1G_BITS
 #define HAVE_ETHTOOL_NEW_10G_BITS
-#endif /* RHEL */
+#endif /* RHEL_RELEASE_VERSION(7,4) */
+#if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(15,4,0)))
+#define HAVE_ETHTOOL_NEW_1G_BITS
+#define HAVE_ETHTOOL_NEW_10G_BITS
+#endif /* SLE_VERSION(15,4,0) */
 #else
+#define HAVE_ETHTOOL_NEW_1G_BITS
 #define HAVE_ETHTOOL_NEW_10G_BITS
-#endif /* 4.9.0 */
+#endif /* KERNEL_VERSION(4.9.0) */
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
+#if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4)))
+#define HAVE_ETHTOOL_NEW_2500MB_BITS
+#define HAVE_ETHTOOL_5G_BITS
+#endif /* RHEL_RELEASE_VERSION(7,4) */
+#if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(15,4,0)))
+#define HAVE_ETHTOOL_NEW_2500MB_BITS
+#define HAVE_ETHTOOL_5G_BITS
+#endif /* SLE_VERSION(15,4,0) */
+#else
+#define HAVE_ETHTOOL_NEW_2500MB_BITS
+#define HAVE_ETHTOOL_5G_BITS
+#endif /* KERNEL_VERSION(4.10.0) */
+
+#endif /* ETHTOOL_GLINKSETTINGS */
+
+/*****************************************************************************/
+#ifdef NETIF_F_HW_TC
+#endif /* NETIF_F_HW_TC */
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0))
+#ifdef NETIF_F_HW_TC
+#if (!(RHEL_RELEASE_CODE) && !(SLE_VERSION_CODE) || \
+    (SLE_VERSION_CODE && (SLE_VERSION_CODE < SLE_VERSION(12,3,0))))
+#define HAVE_TC_FLOWER_VLAN_IN_TAGS
+#endif /* !RHEL_RELEASE_CODE && !SLE_VERSION_CODE || SLE_VERSION(12,3,0) */
+#endif /* NETIF_F_HW_TC */
+#endif /* KERNEL_VERSION(4.9.0) */

 /*****************************************************************************/
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
 #if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4)))
 #define HAVE_DEV_WALK_API
 #endif
+#if (SLE_VERSION_CODE && (SLE_VERSION_CODE == SLE_VERSION(12,3,0)))
+#define HAVE_STRUCT_DMA_ATTRS
+#endif /* (SLES == 12.3.0) */
 #if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0)))
-#define HAVE_STRUCT_DMA_ATTRS
 #define HAVE_NETDEVICE_MIN_MAX_MTU
-#endif
-
+#endif /* (SLES >= 12.3.0) */
 #if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)))
 #define HAVE_STRUCT_DMA_ATTRS
 #define HAVE_RHEL7_EXTENDED_MIN_MAX_MTU
 #define HAVE_NETDEVICE_MIN_MAX_MTU
 #endif
-
 #if (!(SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0))) && \
      !(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5))))
 #ifndef dma_map_page_attrs
@@ -4981,13 +5191,20 @@
 	__free_pages(page, compound_order(page));
 }
 #endif /* !SLE_VERSION(12,3,0) && !RHEL_VERSION(7,5) */
-#ifndef page_frag_free
+#if ((SLE_VERSION_CODE && (SLE_VERSION_CODE > SLE_VERSION(12,3,0))) ||\
+     (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)))
+#define HAVE_SWIOTLB_SKIP_CPU_SYNC
+#endif
+
+#if ((SLE_VERSION_CODE && (SLE_VERSION_CODE < SLE_VERSION(15,0,0))) ||\
+     (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,4))))
 #define page_frag_free __free_page_frag
 #endif
 #ifndef ETH_MIN_MTU
 #define ETH_MIN_MTU 68
 #endif /* ETH_MIN_MTU */
 #else /* >= 4.10 */
+#define HAVE_TC_FLOWER_ENC
 #define HAVE_NETDEVICE_MIN_MAX_MTU
 #define HAVE_SWIOTLB_SKIP_CPU_SYNC
 #define HAVE_NETDEV_TC_RESETS_XPS
@@ -4999,11 +5216,11 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
 #ifdef CONFIG_NET_RX_BUSY_POLL
 #define HAVE_NDO_BUSY_POLL
+#endif /* CONFIG_NET_RX_BUSY_POLL */
 #if ((SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0))) || \
      (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5))))
 #define HAVE_VOID_NDO_GET_STATS64
-#endif
-#endif
+#endif /* (SLES >= 12.3.0) && (RHEL >= 7.5) */
 #else /* > 4.11 */
 #define HAVE_VOID_NDO_GET_STATS64
 #define HAVE_VM_OPS_FAULT_NO_VMA
@@ -5011,6 +5228,7 @@

 /*****************************************************************************/
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0))
+#define  PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */
 #else /* > 4.13 */
 #define HAVE_HWTSTAMP_FILTER_NTP_ALL
 #define HAVE_NDO_SETUP_TC_CHAIN_INDEX
@@ -5043,6 +5261,9 @@
 #define from_timer(var, callback_timer, timer_fieldname) \
 	container_of(callback_timer, typeof(*var), timer_fieldname)

+#ifndef xdp_do_flush_map
+#define xdp_do_flush_map() do {} while (0)
+#endif
 struct _kc_xdp_buff {
 	void *data;
 	void *data_end;
@@ -5058,21 +5279,212 @@
 #endif /* 4.14.0 */

 /*****************************************************************************/
+#ifndef ETHTOOL_GLINKSETTINGS
+
+#define __ETHTOOL_LINK_MODE_MASK_NBITS 32
+#define ETHTOOL_LINK_MASK_SIZE BITS_TO_LONGS(__ETHTOOL_LINK_MODE_MASK_NBITS)
+
+/**
+ * struct ethtool_link_ksettings
+ * @link_modes: supported and advertising, single item arrays
+ * @link_modes.supported: bitmask of supported link speeds
+ * @link_modes.advertising: bitmask of currently advertised speeds
+ * @base: base link details
+ * @base.speed: current link speed
+ * @base.port: current port type
+ * @base.duplex: current duplex mode
+ * @base.autoneg: current autonegotiation settings
+ *
+ * This struct and the following macros provide a way to support the old
+ * ethtool get/set_settings API on older kernels, but in the style of the new
+ * GLINKSETTINGS API.  In this way, the same code can be used to support both
+ * APIs as seemlessly as possible.
+ *
+ * It should be noted the old API only has support up to the first 32 bits.
+ */
+struct ethtool_link_ksettings {
+	struct {
+		u32 speed;
+		u8 port;
+		u8 duplex;
+		u8 autoneg;
+	} base;
+	struct {
+		unsigned long supported[ETHTOOL_LINK_MASK_SIZE];
+		unsigned long advertising[ETHTOOL_LINK_MASK_SIZE];
+	} link_modes;
+};
+
+#define ETHTOOL_LINK_NAME_advertising(mode) ADVERTISED_ ## mode
+#define ETHTOOL_LINK_NAME_supported(mode) SUPPORTED_ ## mode
+#define ETHTOOL_LINK_NAME(name) ETHTOOL_LINK_NAME_ ## name
+#define ETHTOOL_LINK_CONVERT(name, mode) ETHTOOL_LINK_NAME(name)(mode)
+
+/**
+ * ethtool_link_ksettings_zero_link_mode
+ * @ptr: ptr to ksettings struct
+ * @name: supported or advertising
+ */
+#define ethtool_link_ksettings_zero_link_mode(ptr, name)\
+	(*((ptr)->link_modes.name) = 0x0)
+
+/**
+ * ethtool_link_ksettings_add_link_mode
+ * @ptr: ptr to ksettings struct
+ * @name: supported or advertising
+ * @mode: link mode to add
+ */
+#define ethtool_link_ksettings_add_link_mode(ptr, name, mode)\
+	(*((ptr)->link_modes.name) |= (typeof(*((ptr)->link_modes.name)))ETHTOOL_LINK_CONVERT(name, mode))
+
+/**
+ * ethtool_link_ksettings_test_link_mode
+ * @ptr: ptr to ksettings struct
+ * @name: supported or advertising
+ * @mode: link mode to add
+ */
+#define ethtool_link_ksettings_test_link_mode(ptr, name, mode)\
+	(!!(*((ptr)->link_modes.name) & ETHTOOL_LINK_CONVERT(name, mode)))
+#endif /* !ETHTOOL_GLINKSETTINGS */
+
+/*****************************************************************************/
+#if ((LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)) || \
+     (SLE_VERSION_CODE && (SLE_VERSION_CODE <= SLE_VERSION(12,3,0))) || \
+     (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,5))))
+#define phy_speed_to_str _kc_phy_speed_to_str
+const char *_kc_phy_speed_to_str(int speed);
+#else /* (LINUX >= 4.14.0) || (SLES > 12.3.0) || (RHEL > 7.5) */
+#include <linux/phy.h>
+#endif /* (LINUX < 4.14.0) || (SLES <= 12.3.0) || (RHEL <= 7.5) */
+
+/*****************************************************************************/
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
+#if !(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,6)))
 #define TC_SETUP_QDISC_MQPRIO TC_SETUP_MQPRIO
-#ifdef ETHTOOL_GLINKSETTINGS
+#endif
 void _kc_ethtool_intersect_link_masks(struct ethtool_link_ksettings *dst,
 				      struct ethtool_link_ksettings *src);
 #define ethtool_intersect_link_masks _kc_ethtool_intersect_link_masks
-#endif /* ETHTOOL_GLINKSETTINGS */
 #else /* >= 4.15 */
 #define HAVE_NDO_BPF
 #define HAVE_XDP_BUFF_DATA_META
+#define HAVE_TC_CB_AND_SETUP_QDISC_MQPRIO
 #endif /* 4.15.0 */

+/*****************************************************************************/
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,16,0))
+#define pci_printk(level, pdev, fmt, arg...) \
+	dev_printk(level, &(pdev)->dev, fmt, ##arg)
+#define pci_emerg(pdev, fmt, arg...)	dev_emerg(&(pdev)->dev, fmt, ##arg)
+#define pci_alert(pdev, fmt, arg...)	dev_alert(&(pdev)->dev, fmt, ##arg)
+#define pci_crit(pdev, fmt, arg...)	dev_crit(&(pdev)->dev, fmt, ##arg)
+#define pci_err(pdev, fmt, arg...)	dev_err(&(pdev)->dev, fmt, ##arg)
+#define pci_warn(pdev, fmt, arg...)	dev_warn(&(pdev)->dev, fmt, ##arg)
+#define pci_notice(pdev, fmt, arg...)	dev_notice(&(pdev)->dev, fmt, ##arg)
+#define pci_info(pdev, fmt, arg...)	dev_info(&(pdev)->dev, fmt, ##arg)
+#define pci_dbg(pdev, fmt, arg...)	dev_dbg(&(pdev)->dev, fmt, ##arg)
+
+#ifndef array_index_nospec
+static inline unsigned long _kc_array_index_mask_nospec(unsigned long index,
+							unsigned long size)
+{
+	/*
+	 * Always calculate and emit the mask even if the compiler
+	 * thinks the mask is not needed. The compiler does not take
+	 * into account the value of @index under speculation.
+	 */
+	OPTIMIZER_HIDE_VAR(index);
+	return ~(long)(index | (size - 1UL - index)) >> (BITS_PER_LONG - 1);
+}
+
+#define array_index_nospec(index, size)					\
+({									\
+	typeof(index) _i = (index);					\
+	typeof(size) _s = (size);					\
+	unsigned long _mask = _kc_array_index_mask_nospec(_i, _s);	\
+									\
+	BUILD_BUG_ON(sizeof(_i) > sizeof(long));			\
+	BUILD_BUG_ON(sizeof(_s) > sizeof(long));			\
+									\
+	(typeof(_i)) (_i & _mask);					\
+})
+#endif /* array_index_nospec */
 #else /* >= 4.16 */
+#include <linux/nospec.h>
 #define HAVE_XDP_BUFF_RXQ
 #endif /* 4.16.0 */

+/*****************************************************************************/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0))
+#include <linux/pci_regs.h>
+#include <linux/pci.h>
+#define PCIE_SPEED_16_0GT 0x17
+#define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */
+#define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */
+#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */
+void _kc_pcie_print_link_status(struct pci_dev *dev);
+#define pcie_print_link_status _kc_pcie_print_link_status
+#endif /* 4.17.0 */
+
+/*****************************************************************************/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0))
+#ifdef NETIF_F_HW_L2FW_DOFFLOAD
+#include <linux/if_macvlan.h>
+#ifndef macvlan_supports_dest_filter
+#define macvlan_supports_dest_filter _kc_macvlan_supports_dest_filter
+static inline bool _kc_macvlan_supports_dest_filter(struct net_device *dev)
+{
+	struct macvlan_dev *macvlan = netdev_priv(dev);
+
+	return macvlan->mode == MACVLAN_MODE_PRIVATE ||
+	       macvlan->mode == MACVLAN_MODE_VEPA ||
+	       macvlan->mode == MACVLAN_MODE_BRIDGE;
+}
+#endif
+
+#ifndef macvlan_accel_priv
+#define macvlan_accel_priv _kc_macvlan_accel_priv
+static inline void *_kc_macvlan_accel_priv(struct net_device *dev)
+{
+	struct macvlan_dev *macvlan = netdev_priv(dev);
+
+	return macvlan->fwd_priv;
+}
+#endif
+
+#ifndef macvlan_release_l2fw_offload
+#define macvlan_release_l2fw_offload _kc_macvlan_release_l2fw_offload
+static inline int _kc_macvlan_release_l2fw_offload(struct net_device *dev)
+{
+	struct macvlan_dev *macvlan = netdev_priv(dev);
+
+	macvlan->fwd_priv = NULL;
+	return dev_uc_add(macvlan->lowerdev, dev->dev_addr);
+}
+#endif
+#endif /* NETIF_F_HW_L2FW_DOFFLOAD */
+#else
+#define HAVE_XDP_FRAME_STRUCT
+#define HAVE_NDO_XDP_XMIT_BULK_AND_FLAGS
+#define NO_NDO_XDP_FLUSH
+#endif /* 4.18.0 */
+
+/*****************************************************************************/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0))
+#ifdef ETHTOOL_GLINKSETTINGS
+#define ethtool_ks_clear(ptr, name) \
+	ethtool_link_ksettings_zero_link_mode(ptr, name)
+#define ethtool_ks_add_mode(ptr, name, mode) \
+	ethtool_link_ksettings_add_link_mode(ptr, name, mode)
+#define ethtool_ks_del_mode(ptr, name, mode) \
+	ethtool_link_ksettings_del_link_mode(ptr, name, mode)
+#define ethtool_ks_test(ptr, name, mode) \
+	ethtool_link_ksettings_test_link_mode(ptr, name, mode)
+#endif /* ETHTOOL_GLINKSETTINGS */
+#else /* >= 4.19.0 */
+#define HAVE_TCF_BLOCK_CB_REGISTER_EXTACK
+#define NO_NETDEV_BPF_PROG_ATTACHED
+#define HAVE_NDO_SELECT_QUEUE_SB_DEV
+#endif /* 4.19.0 */
+
 #endif /* _KCOMPAT_H_ */


On the authzperf branch: Hide local function.

* subversion/libsvn_repos/authz.c (normalize_wildcards): Mark static.

git-svn-id: 1f1d32df43057f8baf3569895afdc221b0c15aad@1615055 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_repos/authz.c
+++ subversion/libsvn_repos/authz.c
@@ -655,7 +655,7 @@
  * https://wiki.apache.org/subversion/AuthzImprovements
  * and return the result.
  */
-const char *
+static const char *
 normalize_wildcards(const char *path,
                     apr_pool_t *result_pool)
 {


staging: brcm80211: remove extern keyword from function definition

Sparse warning was given when using the extern keyword in the function
definition. This patch removes those instances.

Reported-by: Aaro Koskinen <13423a3f3006b5859cfceae66d59451f5eb4e205@iki.fi>
Reviewed-by: Franky (Zhenhui) Lin <c740ae0f5dfc9bd2203ae1a0d3155a31e94c745d@broadcom.com>
Reviewed-by: Roland Vossen <45182f14eed14f589e080b05abc22e5a7f6ee742@broadcom.com>
Signed-off-by: Roland Vossen <45182f14eed14f589e080b05abc22e5a7f6ee742@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -76,9 +76,8 @@
 #endif
 }

-extern int
-brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
-			 uint regaddr, u8 *byte)
+int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
+			     uint regaddr, u8 *byte)
 {
 	int err_ret;

@@ -173,9 +172,9 @@
 	return err_ret;
 }

-extern int
-brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev, uint rw,
-			 uint func, uint addr, u32 *word, uint nbytes)
+int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
+			     uint rw, uint func, uint addr, u32 *word,
+			     uint nbytes)
 {
 	int err_ret = -EIO;

@@ -304,11 +303,10 @@
  * aligned packet.
  *
  */
-extern int
-brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
-			   uint fix_inc, uint write, uint func, uint addr,
-			   uint reg_width, uint buflen_u, u8 *buffer,
-			   struct sk_buff *pkt)
+int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
+			       uint fix_inc, uint write, uint func, uint addr,
+			       uint reg_width, uint buflen_u, u8 *buffer,
+			       struct sk_buff *pkt)
 {
 	int Status;
 	struct sk_buff *mypkt = NULL;
@@ -425,9 +423,8 @@
 	return scratch;
 }

-extern int
-brcmf_sdioh_cis_read(struct brcmf_sdio_dev *sdiodev, uint func,
-		     u8 *cisd, u32 length)
+int brcmf_sdioh_cis_read(struct brcmf_sdio_dev *sdiodev, uint func,
+			 u8 *cisd, u32 length)
 {
 	u32 count;
 	int offset;


Translate error output from hook scripts from the native encoding to UTF8.

* subversion/libsvn_repos/hooks.c (run_hook_cmd): Convert error output to UTF8.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@857175 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_repos/hooks.c
+++ subversion/libsvn_repos/hooks.c
@@ -25,6 +25,7 @@
 #include "svn_error.h"
 #include "svn_path.h"
 #include "svn_repos.h"
+#include "svn_utf.h"
 #include "repos.h"
 #include "svn_private_config.h"

@@ -92,10 +93,11 @@
     }
   else
     {
-      svn_stringbuf_t *error;
+      svn_stringbuf_t *native_error;
+      const char *error;
       svn_error_t *err2;

-      err2 = svn_stringbuf_from_aprfile (&error, read_errhandle, pool);
+      err2 = svn_stringbuf_from_aprfile (&native_error, read_errhandle, pool);

       err = svn_io_wait_for_cmd(&cmd_proc, cmd, &exitcode, &exitwhy, pool);
       if (! err)
@@ -104,10 +106,13 @@
             {
               if (read_errstream && ! err2)
                 {
-                  err = svn_error_createf
-                    (SVN_ERR_REPOS_HOOK_FAILURE, err,
-                     _("'%s' hook failed with error output:\n%s"),
-                     name, error->data);
+                  err2 = svn_utf_cstring_to_utf8 (&error, native_error->data,
+                                                  pool);
+                  if (! err2)
+                    err = svn_error_createf
+                      (SVN_ERR_REPOS_HOOK_FAILURE, err,
+                       _("'%s' hook failed with error output:\n%s"),
+                       name, error);
                 }
               else
                 {


Removes unused variables.

Removes unused variables.

Produced compiler warning with unused variables.

--- uECC.c
+++ uECC.c
@@ -2518,10 +2518,6 @@
               const uint8_t message_hash[uECC_BYTES],
               uint8_t signature[uECC_BYTES*2]) {
     uECC_word_t k[uECC_N_WORDS];
-    uECC_word_t tmp[uECC_N_WORDS];
-    uECC_word_t s[uECC_N_WORDS];
-    uECC_word_t *k2[2] = {tmp, s};
-    EccPoint p;
     uECC_word_t tries;

     for (tries = 0; tries < MAX_TRIES; ++tries) {


staging: Fix typo in ieee80211_rx.c

staging: Fix typo in ieee80211_rx.c

Correct spelling "suppported" to "supported" in
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c

Signed-off-by: Masanari iida<f31bb8ac2957d045575b3081e813605474613a21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -237,7 +237,7 @@

 	#ifdef NOT_YET
 	if (ieee->iw_mode == IW_MODE_MASTER) {
-		printk(KERN_DEBUG "%s: Master mode not yet suppported.\n",
+		printk(KERN_DEBUG "%s: Master mode not yet supported.\n",
 		       ieee->dev->name);
 		return 0;
 /*


Add support for profiling sqlite statement execution.

* subversion/libsvn_subr/sqlite.c (sqlite_profiler): New.
* (svn_sqlite__open): If SQLITE3_PROFILE, register sqlite_profiler.

--- subversion/libsvn_subr/sqlite.c
+++ subversion/libsvn_subr/sqlite.c
@@ -63,6 +63,15 @@
 }
 #endif

+#ifdef SQLITE3_PROFILE
+/* An sqlite execution timing callback. */
+static void
+sqlite_profiler(void *data, const char *sql, sqlite3_uint64 duration)
+{
+  /*  sqlite3 *db3 = data; */
+  SVN_DBG(("[%.3f] sql=\"%s\"\n", 1e-9 * duration, sql));
+}
+#endif

 struct svn_sqlite__db_t
 {
@@ -916,6 +925,9 @@

 #ifdef SQLITE3_DEBUG
   sqlite3_trace((*db)->db3, sqlite_tracer, (*db)->db3);
+#endif
+#ifdef SQLITE3_PROFILE
+  sqlite3_profile((*db)->db3, sqlite_profiler, (*db)->db3);
 #endif

   SVN_ERR(exec_sql(*db,


Supress printing very long plists in debug output

--- common/debug.c
+++ common/debug.c
@@ -38,6 +38,8 @@
 #ifndef STRIP_DEBUG_CODE
 #include "asprintf.h"
 #endif
+
+#define MAX_PRINT_LEN 16*1024

 int debug_level = 0;

@@ -163,7 +165,11 @@
 	if (buffer[length-1] == '\n')
 		buffer[length-1] = '\0';

-	debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer);
+	if (length <= MAX_PRINT_LEN)
+		debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer);
+	else
+		debug_info_real(func, file, line, "supress printing %i bytes plist...\n", length);
+
 	free(buffer);
 #endif
 }


erthink: use `unsigned` for `DEFINE_ENUM_FLAG_OPERATORS` to be more consistent with C/C++standards.

--- erthink_defs.h
+++ erthink_defs.h
@@ -750,23 +750,23 @@
 #define DEFINE_ENUM_FLAG_OPERATORS(ENUM)                                       \
   extern "C++" {                                                               \
   cxx01_constexpr ENUM operator|(ENUM a, ENUM b) {                             \
-    return ENUM(std::size_t(a) | std::size_t(b));                              \
+    return ENUM(unsigned(a) | unsigned(b));                                    \
   }                                                                            \
   cxx14_constexpr ENUM &operator|=(ENUM &a, ENUM b) { return a = a | b; }      \
   cxx01_constexpr ENUM operator&(ENUM a, ENUM b) {                             \
-    return ENUM(std::size_t(a) & std::size_t(b));                              \
+    return ENUM(unsigned(a) & unsigned(b));                                    \
   }                                                                            \
-  cxx01_constexpr ENUM operator&(ENUM a, size_t b) {                           \
-    return ENUM(std::size_t(a) & b);                                           \
+  cxx01_constexpr ENUM operator&(ENUM a, unsigned b) {                         \
+    return ENUM(unsigned(a) & b);                                              \
   }                                                                            \
-  cxx01_constexpr ENUM operator&(size_t a, ENUM b) {                           \
-    return ENUM(a & std::size_t(b));                                           \
+  cxx01_constexpr ENUM operator&(unsigned a, ENUM b) {                         \
+    return ENUM(a & unsigned(b));                                              \
   }                                                                            \
   cxx14_constexpr ENUM &operator&=(ENUM &a, ENUM b) { return a = a & b; }      \
-  cxx14_constexpr ENUM &operator&=(ENUM &a, size_t b) { return a = a & b; }    \
-  cxx01_constexpr std::size_t operator~(ENUM a) { return ~std::size_t(a); }    \
+  cxx14_constexpr ENUM &operator&=(ENUM &a, unsigned b) { return a = a & b; }  \
+  cxx01_constexpr unsigned operator~(ENUM a) { return ~unsigned(a); }          \
   cxx01_constexpr ENUM operator^(ENUM a, ENUM b) {                             \
-    return ENUM(std::size_t(a) ^ std::size_t(b));                              \
+    return ENUM(unsigned(a) ^ unsigned(b));                                    \
   }                                                                            \
   cxx14_constexpr ENUM &operator^=(ENUM &a, ENUM b) { return a = a ^ b; }      \
   }


patch "staging: rtl8723au: os_dep: declared cfg80211_infrastructure_mode static

Declared cfg80211_infrastructure_mode method static to remove sparse warning

Signed-off-by: Rahul Garg <cd6f041b53fc74b42df3953cac138d1dd407bcf2@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


error fixed

error fixed

--- IvenResponse.h
+++ IvenResponse.h
@@ -23,7 +23,8 @@
 {
 public:
     IvenResponse();
-    clearResponse();
+    void clearResponse();
+public:
     int ivenCode;
     uint16_t httpStatus;
     ErrorList error;


Point transformation using matrices.

Point transformation using matrices.

git-svn-id: 285d6e11b92f44d073a8e12a14e649675b16fc71@201 3ec011a9-ccf5-4689-8f2f-5f4aa021d377

--- math/include/vislib/AbstractMatrixImpl.h
+++ math/include/vislib/AbstractMatrixImpl.h
@@ -15,6 +15,8 @@
 #include "vislib/mathfunctions.h"
 #include "vislib/memutils.h"
 #include "vislib/OutOfRangeException.h"
+#include "vislib/Point.h"
+#include "vislib/ShallowVector.h"
 #include "vislib/String.h"
 #include "vislib/Vector.h"

@@ -355,6 +357,37 @@
         template<class Sp>
         Vector<T, D - 1> operator *(
             const AbstractVector<T, D - 1, Sp>& rhs) const;
+
+        /**
+         * Multiplies this matrix with the point 'rhs'.
+         *
+         * @param rhs The right hand side operand.
+         *
+         * @return The transformed point.
+         */
+        template<class Sp>
+        inline Point<T, D> operator *(const AbstractPoint<T, D, Sp>& rhs) const {
+            ShallowVector<T, D> v(const_cast<double *>(rhs.PeekCoordinates()));
+            return Point<T, D>(v.PeekComponents());
+        }
+
+        /**
+         * Extends 'rhs' to be a point with homogenous coordinates and
+         * multiplies the matrix with this point. Before returning the (D - 1)
+         * dimensional result, a perspective divide is performed to normalise
+         * the last component to 1. This component is discarded in the result.
+         *
+         * @param rhs The right hand side operand.
+         *
+         * @return The transformed point.
+         */
+        template<class Sp>
+        inline Point<T, D - 1> operator *(
+                const AbstractPoint<T, D - 1, Sp>& rhs) const {
+            ShallowVector<T, D - 1> v(const_cast<double *>(
+                rhs.PeekCoordinates()));
+            return Point<T, D - 1>(v.PeekComponents());
+        }

         /**
          * Assignment operator.
@@ -982,8 +1015,8 @@
     }

-    /* vislib::math::AbstractMatrixImpl<T, D, L, S, C>::operator *
-     *
+    /*
+     * vislib::math::AbstractMatrixImpl<T, D, L, S, C>::operator *
      */
     template<class T, unsigned int D, MatrixLayout L, class S,
         template<class T, unsigned int D, MatrixLayout L, class S> class C>


More issue #3020 work.  Overload svndumpfilter --skip-missing-merge-sources
option to also removes mergeinfo that predates the starting revision of
the dump stream.

See http://svn.haxx.se/dev/archive-2010-04/0475.shtml

* subversion/svndumpfilter/main.c

  (parse_baton_t): New member oldest_original_rev.

  (output_revision): Set oldest_original_rev.

  (adjust_mergeinfo): If --skip-missing-merge-sources is specified then toss
   mergeinfo older than oldest_original_rev.

  (parse_baton_initialize): Initialize oldest_original_rev.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@939709 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/svndumpfilter/main.c
+++ subversion/svndumpfilter/main.c
@@ -193,6 +193,9 @@
   apr_hash_t *dropped_nodes;
   apr_hash_t *renumber_history;  /* svn_revnum_t -> struct revmap_t */
   svn_revnum_t last_live_revision;
+  /* The oldest original revision in the input stream which was
+     not filtered. */
+  svn_revnum_t oldest_original_rev;
 };

 struct revision_baton_t
@@ -395,6 +398,10 @@
                                rb->header->data, &(rb->header->len)));
       SVN_ERR(svn_stream_write(rb->pb->out_stream,
                                props->data, &(props->len)));
+
+      /* Stash the oldest original rev not dropped. */
+      if (!SVN_IS_VALID_REVNUM(rb->pb->oldest_original_rev))
+        rb->pb->oldest_original_rev = rb->rev_orig;

       if (rb->pb->do_renumber_revs)
         {
@@ -673,6 +680,17 @@
   apr_pool_t *subpool = svn_pool_create(pool);

   SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));
+
+  /* Issue #3020: If we are skipping missing merge sources, then also
+     filter mergeinfo ranges older than the oldest revision in the dump
+     stream (since they are missing too).  If the oldest rev is r0 or r1,
+     then the filtering would be a no-op, so don't bother. */
+  if (rb->pb->skip_missing_merge_sources && rb->pb->oldest_original_rev > 1)
+    SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
+      &mergeinfo, mergeinfo,
+      rb->pb->oldest_original_rev - 1, 0,
+      FALSE, subpool, subpool));
+
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
       const char *merge_source = svn__apr_hash_index_key(hi);
@@ -997,6 +1015,7 @@
   baton->dropped_nodes = apr_hash_make(pool);
   baton->renumber_history = apr_hash_make(pool);
   baton->last_live_revision = SVN_INVALID_REVNUM;
+  baton->oldest_original_rev = SVN_INVALID_REVNUM;

   /* This is non-ideal: We should pass through the version of the
    * input dumpstream.  However, our API currently doesn't allow that.


add fail() function

add fail() function

--- common/error.h
+++ common/error.h
@@ -16,10 +16,15 @@
 #define ERROR_H

 #include <stdexcept>
+#include <stdio.h>

 void printGlErrors_(const char* where="", const int line=0);

 #define printGlErrors() printGlErrors_(__func__, __LINE__)
+
+#define fail(...) fprintf(stderr, "[ERROR] (%s:%d) ", __FILE__, __LINE__); \
+                  fprintf(stderr, __VA_ARGS__); \
+                  exit(1)

 class Exception : public std::runtime_error
 {


staging: rtl8723au: ioctl_cfg80211.c: Use struct ieee80211_mgmt to build mgmt frame

Signed-off-by: Jes Sorensen <0e1e349bdba396f044a06b01fef702e072aa66d3@redhat.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


fixes issue 500
+ only disable redzone for _dbg routine set itself, not all sets
  in same module

SVN-Revision: 617

--- common/alloc.c
+++ common/alloc.c
@@ -2020,7 +2020,6 @@

     if (options.track_heap) {
         const char *modname = dr_module_preferred_name(info);
-        bool use_redzone = true;
 #ifdef WINDOWS
         bool no_dbg_routines = false;
 #endif
@@ -2044,27 +2043,8 @@
         }

         dr_mutex_lock(alloc_routine_lock);
-#ifdef USE_DRSYMS
-        if (lookup_symbol_or_export(info, "_malloc_dbg") != NULL) {
-            /* i#26: msvcrtdbg adds its own redzone that contains a debugging
-             * data structure.  The problem is that operator delete() assumes
-             * this data struct is placed immediately prior to the ptr
-             * returned by malloc.  We aren't intercepting new or delete
-             * so we simply skip our redzone for msvcrtdbg: after all there's
-             * already a redzone there.
-             */
-            use_redzone = false;
-            LOG(1, "NOT using redzones for routines in %s "PFX"\n",
-                (modname == NULL) ? "<noname>" : modname, info->start);
-            /* We watch debug operator delete b/c it reads malloc's headers (i#26)
-             * but we now watch it in general so we don't need to special-case
-             * it here.
-             */
-        } else
-            no_dbg_routines = true;
-#endif
         set_libc = find_alloc_routines(info, possible_libc_routines,
-                                       POSSIBLE_LIBC_ROUTINE_NUM, use_redzone,
+                                       POSSIBLE_LIBC_ROUTINE_NUM, true,
                                        false, HEAPSET_LIBC);
         if (info->start == get_libc_base()) {
             if (set_dyn_libc != NULL)
@@ -2072,16 +2052,32 @@
             set_dyn_libc = set_libc;
         }
 #ifdef WINDOWS
+# ifdef USE_DRSYMS
         /* optimization: assume no other dbg routines if no _malloc_dbg */
+        no_dbg_routines = (lookup_symbol_or_export(info, "_malloc_dbg") == NULL);
+# endif
+        /* i#26: msvcrtdbg adds its own redzone that contains a debugging
+         * data structure.  The problem is that operator delete() assumes
+         * this data struct is placed immediately prior to the ptr
+         * returned by malloc.  We aren't intercepting new or delete
+         * as full layers so we simply skip our redzone for msvcrtdbg: after all there's
+         * already a redzone there.
+         */
+        /* We watch debug operator delete b/c it reads malloc's headers (i#26)
+         * but we now watch it in general so we don't need to special-case
+         * it here.
+         */
         if (!no_dbg_routines) {
+            LOG(1, "NOT using redzones for _dbg routines in %s "PFX"\n",
+                (modname == NULL) ? "<noname>" : modname, info->start);
             find_alloc_routines(info, possible_crtdbg_routines,
-                                POSSIBLE_CRTDBG_ROUTINE_NUM, use_redzone, false,
+                                POSSIBLE_CRTDBG_ROUTINE_NUM, false, false,
                                 HEAPSET_LIBC_DBG);
         }
 #endif
         if (options.intercept_operators) {
             set_cpp = find_alloc_routines(info, possible_cpp_routines,
-                                          POSSIBLE_CPP_ROUTINE_NUM, use_redzone,
+                                          POSSIBLE_CPP_ROUTINE_NUM, true,
                                           false,
                                           /* we assume we only hit i#26 where op delete
                                            * reads heap headers when _malloc_dbg
@@ -4731,6 +4727,7 @@
              * NtContinue) and determine whether returning to heap routine.  For
              * now assuming heap routines do not handle faults.
              */
+            LOG(2, "Exception in app\n");
             pt->in_heap_routine = 0;
             pt->in_heap_adjusted = 0;
         }


Compile time clang compatibility issues

Compile time clang compatibility issues

--- impl/op/vtm/Skplst.h
+++ impl/op/vtm/Skplst.h
@@ -8,7 +8,7 @@
 #include <op/common/Utils.h>
 #include <op/vtm/Transactional.h>
 #include <op/vtm/SegmentManager.h>
-
+#include <op/vtm/MemoryBlock.h>

 namespace OP
 {


Removed ro, hidden and system attributes handling.

--- common/fat32.c
+++ common/fat32.c
@@ -637,8 +637,6 @@

 #ifdef DEBUG
   result->access = 07; /* rwx */
-  if (item.attribute & FLAG_RO)
-    result->access &= 05;
 #endif

 #ifdef FAT_TIME
@@ -685,13 +683,8 @@
 #endif
   }
   /* Not found if volume name, system or directory entry */
-  if (item.attribute & (FLAG_VOLUME | FLAG_SYSTEM | FLAG_DIR))
+  if (item.attribute & (FLAG_VOLUME | FLAG_DIR))
     return E_NONEXISTENT;
-#ifdef FAT_WRITE
-  /* Attempt to write into read-only file */
-  if ((item.attribute & FLAG_RO) && (mode == FS_WRITE || mode == FS_APPEND))
-    return E_ERROR;
-#endif
   fileHandle->parent.descriptor = handleObject;

   fileHandle->position = 0;
@@ -729,12 +722,9 @@
     path = followPath(handle, &item, path);
   if (!path)
     return E_NONEXISTENT;
-  /* Not directory or volume name, system */
-  if (!(item.attribute & FLAG_DIR) ||
-      item.attribute & (FLAG_VOLUME | FLAG_SYSTEM))
-  {
+  /* Not directory or volume name */
+  if (!(item.attribute & FLAG_DIR) || item.attribute & FLAG_VOLUME)
     return E_NONEXISTENT;
-  }

   dirHandle->cluster = item.cluster;
   dirHandle->currentCluster = item.cluster;
@@ -759,8 +749,8 @@
   if (!src)
     return E_NONEXISTENT;

-  /* System entries are invisible */
-  if (item.attribute & FLAG_SYSTEM)
+  /* Volume entries are invisible */
+  if (item.attribute & FLAG_VOLUME)
     return E_NONEXISTENT;

   /* Save old entry data */
@@ -810,8 +800,8 @@
     path = followPath(handle, &item, path);
   if (!path)
     return E_NONEXISTENT;
-  /* Read only, volume name, system or directory */
-  if (item.attribute & (FLAG_RO | FLAG_VOLUME | FLAG_SYSTEM | FLAG_DIR))
+  /* Volume name or directory */
+  if (item.attribute & (FLAG_VOLUME | FLAG_DIR))
     return E_NONEXISTENT;

   /* Mark file table clusters as free */
@@ -1114,7 +1104,7 @@
     }
     item.index++;
   }
-  while (item.attribute & (FLAG_HIDDEN | FLAG_SYSTEM));
+  while (item.attribute & FLAG_VOLUME);
   /* Hidden and system entries not shown */
   dirHandle->currentIndex = item.index; /* Points to next item */
   dirHandle->currentCluster = item.parent;
@@ -1168,8 +1158,6 @@

   while (*path && (followedPath = followPath(handle, &item, path)))
   {
-//     if (item.attribute & FLAG_RO)
-//       return E_ERROR; /* TODO Access denied */
     parent = item.cluster;
     path = followedPath;
   }
@@ -1253,12 +1241,9 @@
     path = followPath(handle, &item, path);
   if (!path)
     return E_NONEXISTENT;
-  /* Not directory or read only, volume name, system */
-  if (!(item.attribute & FLAG_DIR) ||
-      item.attribute & (FLAG_RO | FLAG_VOLUME | FLAG_SYSTEM))
-  {
+  /* Not directory or volume name */
+  if (!(item.attribute & FLAG_DIR) || item.attribute & FLAG_VOLUME)
     return E_NONEXISTENT;
-  }

   /* Check if directory not empty */
   dirItem = item;


common: Document flash_set_protect better

BRANCH=none
BUG=none
TEST=none

Signed-off-by: Craig Hesling <383db090fd8ef907a606ac8a9eccd2962bc489cf@chromium.org>
Change-Id: I07967c32fd481f76385e65af8752c9f5c5d19d98
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2222691
Reviewed-by: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>

--- common/flash.c
+++ common/flash.c
@@ -811,6 +811,17 @@
 	return flags | flash_physical_get_protect_flags();
 }

+/*
+ * Request a flash protection flags change for |mask| flash protect flags
+ * to |flags| state.
+ *
+ * Order of flag processing:
+ * 1. Clear/Set RO_AT_BOOT + Clear *_AT_BOOT flags + Commit *_AT_BOOT flags.
+ * 2. Return if RO_AT_BOOT and HW-WP are not asserted.
+ * 3. Set remaining *_AT_BOOT flags + Commit *_AT_BOOT flags.
+ * 4. Commit RO_NOW.
+ * 5. Commit ALL_NOW.
+ */
 int flash_set_protect(uint32_t mask, uint32_t flags)
 {
 	int retval = EC_SUCCESS;
@@ -842,19 +853,22 @@
 	 * to determine whether to clear protection for the entire flash or
 	 * leave RO protected. There are two cases that we want to keep RO
 	 * protected:
-	 *   1. RO_AT_BOOT was already set before flash_set_protect() is
+	 *   A. RO_AT_BOOT was already set before flash_set_protect() is
 	 *      called.
-	 *   2. RO_AT_BOOT was not set, but it's requested to be set by
+	 *   B. RO_AT_BOOT was not set, but it's requested to be set by
 	 *      the caller of flash_set_protect().
 	 */

+	/* 1.a - Clear RO_AT_BOOT. */
 	new_flags_at_boot &= ~(mask & EC_FLASH_PROTECT_RO_AT_BOOT);
+	/* 1.b - Set RO_AT_BOOT. */
 	new_flags_at_boot |= flags & EC_FLASH_PROTECT_RO_AT_BOOT;

-	/* Removing ALL must also remove RW/ROLLBACK */
+	/* 1.c - Clear ALL_AT_BOOT. */
 	if ((mask & EC_FLASH_PROTECT_ALL_AT_BOOT) &&
 	    !(flags & EC_FLASH_PROTECT_ALL_AT_BOOT)) {
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_ALL_AT_BOOT;
+		/* Must also clear RW/ROLLBACK. */
 #ifdef CONFIG_FLASH_PROTECT_RW
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_RW_AT_BOOT;
 #endif
@@ -863,23 +877,27 @@
 #endif
 	}

+	/* 1.d - Clear RW_AT_BOOT. */
 #ifdef CONFIG_FLASH_PROTECT_RW
-	/* Removing RW must also remove ALL (otherwise nothing will happen). */
 	if ((mask & EC_FLASH_PROTECT_RW_AT_BOOT) &&
 	    !(flags & EC_FLASH_PROTECT_RW_AT_BOOT)) {
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_RW_AT_BOOT;
+		/* Must also clear ALL (otherwise nothing will happen). */
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_ALL_AT_BOOT;
 	}
 #endif

+	/* 1.e - Clear ROLLBACK_AT_BOOT. */
 #ifdef CONFIG_ROLLBACK
 	if ((mask & EC_FLASH_PROTECT_ROLLBACK_AT_BOOT) &&
 	    !(flags & EC_FLASH_PROTECT_ROLLBACK_AT_BOOT)) {
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_ROLLBACK_AT_BOOT;
+		/* Must also remove ALL (otherwise nothing will happen). */
 		new_flags_at_boot &= ~EC_FLASH_PROTECT_ALL_AT_BOOT;
 	}
 #endif

+	/* 1.f - Commit *_AT_BOOT "clears" (and RO "set" 1.b). */
 	if (new_flags_at_boot != old_flags_at_boot) {
 		rv = flash_protect_at_boot(new_flags_at_boot);
 		if (rv)
@@ -887,7 +905,8 @@
 		old_flags_at_boot = new_flags_at_boot;
 	}

-	/*
+	/* 2 - Return if RO_AT_BOOT and HW-WP are not asserted.
+	 *
 	 * All subsequent flags only work if write protect is enabled (that is,
 	 * hardware WP flag) *and* RO is protected at boot (software WP flag).
 	 */
@@ -896,36 +915,44 @@
 		return retval;

 	/*
-	 * The case where ALL/RW/ROLLBACK_AT_BOOT is unset is already covered
+	 * 3.a - Set ALL_AT_BOOT.
+	 *
+	 * The case where ALL/RW/ROLLBACK_AT_BOOT is cleared is already covered
 	 * above, so we do not need to mask it out.
 	 */
 	new_flags_at_boot |= flags & EC_FLASH_PROTECT_ALL_AT_BOOT;

+	/* 3.b - Set RW_AT_BOOT. */
 #ifdef CONFIG_FLASH_PROTECT_RW
 	new_flags_at_boot |= flags & EC_FLASH_PROTECT_RW_AT_BOOT;
 #endif

+	/* 3.c - Set ROLLBACK_AT_BOOT. */
 #ifdef CONFIG_ROLLBACK
 	new_flags_at_boot |= flags & EC_FLASH_PROTECT_ROLLBACK_AT_BOOT;
 #endif

+	/* 3.d - Commit *_AT_BOOT "sets". */
 	if (new_flags_at_boot != old_flags_at_boot) {
 		rv = flash_protect_at_boot(new_flags_at_boot);
 		if (rv)
 			retval = rv;
 	}

+	/* 4 - Commit RO_NOW. */
 	if (flags & EC_FLASH_PROTECT_RO_NOW) {
 		rv = flash_physical_protect_now(0);
 		if (rv)
 			retval = rv;
 	}

+	/* 5 - Commit ALL_NOW. */
 	if (flags & EC_FLASH_PROTECT_ALL_NOW) {
 		rv = flash_physical_protect_now(1);
 		if (rv)
 			retval = rv;
 	}
+
 	return retval;
 }


webrtc/common_types.h: Document bitrate fields' units.

R=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1847004

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@4386 4adac7df-926f-26a2-2b94-8c16560cd09d

--- common_types.h
+++ common_types.h
@@ -227,7 +227,7 @@
     int plfreq;
     int pacsize;
     int channels;
-    int rate;
+    int rate;  // bits/sec unlike {start,min,max}Bitrate elsewhere in this file!
 };

 enum FrameType
@@ -525,9 +525,9 @@
     unsigned short      width;
     unsigned short      height;
     unsigned char       numberOfTemporalLayers;
-    unsigned int        maxBitrate;
-    unsigned int        targetBitrate;
-    unsigned int        minBitrate;
+    unsigned int        maxBitrate;  // kilobits/sec.
+    unsigned int        targetBitrate;  // kilobits/sec.
+    unsigned int        minBitrate;  // kilobits/sec.
     unsigned int        qpMax; // minimum quality
 };

@@ -546,9 +546,9 @@
     unsigned short      width;
     unsigned short      height;

-    unsigned int        startBitrate;
-    unsigned int        maxBitrate;
-    unsigned int        minBitrate;
+    unsigned int        startBitrate;  // kilobits/sec.
+    unsigned int        maxBitrate;  // kilobits/sec.
+    unsigned int        minBitrate;  // kilobits/sec.
     unsigned char       maxFramerate;

     VideoCodecUnion     codecSpecific;


Fix possible access to already freed memory in camel-store-summary.c

--- camel/camel-store-summary.c
+++ camel/camel-store-summary.c
@@ -967,6 +967,7 @@
 		g_hash_table_remove(s->folders_path, (gchar *)camel_store_info_path(s, info));
 		g_free(info->path);
 		g_free(info->uri);
+		info->uri = NULL;
 		info->path = g_strdup(str);
 		g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
 		s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
@@ -986,6 +987,8 @@
 		}
 		g_free(info->path);
 		info->path = v;
+		g_free (info->uri);
+		info->uri = NULL;
 		g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
 		CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
 		break;


fixed thumbnail naming

fixed thumbnail naming

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@1020 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/kodak/dc120/dc120.c
+++ camlibs/kodak/dc120/dc120.c
@@ -215,6 +215,7 @@
 	DC120Data *dd = camera->camlib_data;
 	int picnum=0, album_num=-1, from_card=0;
 	char buf[32];
+	char *dot;

 	picnum = gp_filesystem_number(dd->fs, folder, filename);

@@ -241,6 +242,15 @@

 	if (album_num == -1)
 		return (GP_ERROR);
+
+	if (action == DC120_ACTION_PREVIEW) {
+		dot = strrchr(filename, '.');
+		if (dot)
+			strcpy(&dot[1], "ppm");
+	}
+
+	if (file)
+		strcpy(file->name, filename);

 	return (dc120_file_action(dd, action, from_card, album_num, picnum+1, file));
 }


tests: Add assert for double-insert when parsing playlists

Doesn't actually happen in totem-pl-parser, but we'll want
to check, to be certain.

--- plparse/tests/parser.c
+++ plparse/tests/parser.c
@@ -717,6 +717,7 @@
 	 */
 	data.uri = get_relative_uri (TEST_SRCDIR "separator.m3u");
 	data.mainloop = g_main_loop_new (NULL, FALSE);
+	data.count = 0;

 	g_object_set (pl, "recurse", FALSE,
 			  "debug", option_debug,
@@ -732,6 +733,9 @@
 	g_idle_add_full (G_PRIORITY_HIGH, block_main_loop_idle, NULL, NULL);
 	totem_pl_parser_parse_async (pl, data.uri, FALSE, NULL, parse_async_ready, &data);
 	g_main_loop_run (data.mainloop);
+
+	/* The number of entries in separator.m3u */
+	g_assert(data.count == 1);

 	g_free (data.uri);
 	g_main_loop_unref (data.mainloop);


Use mqtt3_db_retain_queue() on new subscribes when compiled with regex support.

--- src/read_handle_server.c
+++ src/read_handle_server.c
@@ -37,6 +37,7 @@
 #include <sys/select.h>
 #include <unistd.h>

+#include <config.h>
 #include <mqtt3.h>

 int mqtt3_handle_connect(mqtt3_context *context)
@@ -118,10 +119,12 @@
 	uint8_t *payload = NULL;
 	uint32_t payloadlen = 0;

+#ifndef WITH_REGEX
 	uint16_t retain_mid;
 	int retain_qos;
 	uint8_t *retain_payload = NULL;
 	uint32_t retain_payloadlen;
+#endif

 	mqtt3_log_printf(MQTT3_LOG_DEBUG, "Received SUBSCRIBE from %s", context->id);
 	/* FIXME - plenty of potential for memory leaks here */
@@ -141,6 +144,9 @@
 			mqtt3_log_printf(MQTT3_LOG_DEBUG, "\t%s (QoS %d)", sub, qos);
 			mqtt3_db_sub_insert(context->id, sub, qos);

+#ifdef WITH_REGEX
+			if(mqtt3_db_retain_queue(context, sub, qos)) rc = 1;
+#else
 			if(!mqtt3_db_retain_find(sub, &retain_qos, &retain_payloadlen, &retain_payload)){
 				if(retain_qos > qos) retain_qos = qos;
 				if(retain_qos > 0){
@@ -166,6 +172,7 @@
 					mqtt3_free(retain_payload);
 				}
 			}
+#endif
 			mqtt3_free(sub);
 		}


Write a useful timestamp in DTA files

Write a useful timestamp in DTA files

--- src/readstat_dta_write.c
+++ src/readstat_dta_write.c
@@ -23,8 +23,10 @@
 }

 static readstat_error_t dta_emit_header_time_stamp(readstat_writer_t *writer) {
+    time_t now = time(NULL);
+    struct tm *time_s = localtime(&now);
     char time_stamp[18];
-    memset(time_stamp, '\0', sizeof(time_stamp));
+    strftime(time_stamp, sizeof(time_stamp), "%d %b %Y %H:%M", time_s);
     return readstat_write_bytes(writer, time_stamp, sizeof(time_stamp));
 }