Support for mtrr on AMD opteron CPUs. Patch by Mickey and bluhm@, tweaks by dim@, ok deraadt@ and myself. (miod@ also found it sane).

--- arch/i386/i386/mtrr.c
+++ arch/i386/i386/mtrr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtrr.c,v 1.9 2006/11/29 20:03:20 dim Exp $ */
+/* $OpenBSD: mtrr.c,v 1.10 2007/05/02 18:52:17 matthieu Exp $ */
 /*-
  * Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
  * Copyright (c) 1999 Brian Fundakowski Feldman
@@ -41,19 +41,25 @@
 void
 mtrrattach(int num)
 {
+	int family, model, step;
+
 	if (num > 1)
 		return;

+	family = (cpu_id >> 8) & 0xf;
+	model  = (cpu_id >> 4) & 0xf;
+	step   = (cpu_id >> 0) & 0xf;
+
 	if (strcmp(cpu_vendor, "AuthenticAMD") == 0 &&
-	    (cpu_id & 0xf00) == 0x500 &&
-	    ((cpu_id & 0xf0) > 0x80 ||
-	     ((cpu_id & 0xf0) == 0x80 &&
-	      (cpu_id & 0xf) > 0x7))) {
+	    family == 0x5 &&
+	    (model > 0x8 ||
+	     (model == 0x8 &&
+	      step > 0x7))) {
 		mem_range_softc.mr_op = &k6_mrops;

 		/* Try for i686 MTRRs */
 	} else if ((cpu_feature & CPUID_MTRR) &&
-		   ((cpu_id & 0xf00) == 0x600) &&
+		   (family == 0x6 || family == 0xf) &&
 		   ((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
 		    (strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
 		mem_range_softc.mr_op = &i686_mrops;


<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">      <title>403 - Forbidden</title>
403 - Forbidden


Remove unnecessary has_failed_ member variable from detail::CatchSubscription

This simplifies things a bit.

--- src/rs/include/rs/catch.h
+++ src/rs/include/rs/catch.h
@@ -38,11 +38,8 @@
       subscriber_->requested_ += count;
     }

-    if (has_failed_) {
-      catch_subscription_.Request(count);
-    } else {
-      inner_subscription_.Request(count);
-    }
+    catch_subscription_.Request(count);
+    inner_subscription_.Request(count);
   }

   void Cancel() {
@@ -62,7 +59,6 @@
   // stack frame, causing memory corruption.
   AnySubscription inner_subscription_;
   AnySubscription catch_subscription_;
-  bool has_failed_ = false;  // Set to true when catch_subscription_ is set.
   WeakReference<Subscriber> subscriber_;
 };

@@ -122,7 +118,6 @@
       auto sub = catch_publisher.Subscribe(MakeSubscriber(me_.lock()));
       sub.Request(requested_);
       if (subscription_) {
-        subscription_->has_failed_ = true;
         subscription_->catch_subscription_ = AnySubscription(std::move(sub));
       }
     }


Discordant mode: mates mapped to the same location are reported with type -

--- MrsFAST.c
+++ MrsFAST.c
@@ -2870,52 +2870,59 @@

 			//fprintf(stdout, "%c %c ", dir1, dir2);

-			if ( dir1 == dir2 )
-			{
-				event = 'V';
-				//fprintf(stdout, "Inverstion \n");
+			if (loc1 == loc2)
+			{
+				event = '-';
 			}
 			else
 			{
-				if (loc1 < loc2)
+				if ( dir1 == dir2 )
 				{
-
-					//fprintf(stdout, "< %d ", loc2-loc1-SEQ_LENGTH);
-
-					if (dir1 == 'R' && dir2 == 'F')
+					event = 'V';
+					//fprintf(stdout, "Inverstion \n");
+				}
+				else
+				{
+					if (loc1 < loc2)
 					{
-						event = 'E';
-
-						//fprintf(stdout, "Everted \n");
-					}
-					else if ( loc2 - loc1 >= maxPairEndedDiscordantDistance )
+
+						//fprintf(stdout, "< %d ", loc2-loc1-SEQ_LENGTH);
+
+						if (dir1 == 'R' && dir2 == 'F')
+						{
+							event = 'E';
+
+							//fprintf(stdout, "Everted \n");
+						}
+						else if ( loc2 - loc1 >= maxPairEndedDiscordantDistance )
+						{
+							event = 'D';
+							//fprintf(stdout, "Deletion \n");
+						}
+						else
+						{
+							event = 'I';
+							//fprintf(stdout, "Insertion \n");
+						}
+					}
+					else if (loc2 < loc1)
 					{
-						event = 'D';
-						//fprintf(stdout, "Deletion \n");
-					}
-					else
-					{
-						event = 'I';
-						//fprintf(stdout, "Insertion \n");
-					}
-				}
-				else if (loc2 < loc1)
-				{
-					//fprintf(stdout, "> %d ", loc1-loc2-SEQ_LENGTH);
-					if (dir2 == 'R' && dir1 == 'F')
-					{
-						event = 'E';
-						//fprintf(stdout, "Everted \n");
-					}
-					else if ( loc1 - loc2 >= maxPairEndedDiscordantDistance )
-					{
-						event = 'D';
-						//fprintf(stdout, "Deletion \n");
-					}
-					else
-					{
-						event = 'I';
-						//fprintf(stdout, "Insertion \n");
+						//fprintf(stdout, "> %d ", loc1-loc2-SEQ_LENGTH);
+						if (dir2 == 'R' && dir1 == 'F')
+						{
+							event = 'E';
+							//fprintf(stdout, "Everted \n");
+						}
+						else if ( loc1 - loc2 >= maxPairEndedDiscordantDistance )
+						{
+							event = 'D';
+							//fprintf(stdout, "Deletion \n");
+						}
+						else
+						{
+							event = 'I';
+							//fprintf(stdout, "Insertion \n");
+						}
 					}
 				}
 			}


disble GC during st_insert to avoid calls to ruby_xmalloc and rb_gc

--- ext/memprof.c
+++ ext/memprof.c
@@ -56,7 +56,7 @@
   VALUE ret = rb_newobj();
   struct obj_track *tracker = NULL;

-  if (track_objs) {
+  if (track_objs && objs) {
     tracker = malloc(sizeof(*tracker));

     if (tracker) {
@@ -72,7 +72,9 @@
       }

       tracker->obj = ret;
+      rb_gc_disable();
       st_insert(objs, (st_data_t)ret, (st_data_t)tracker);
+      rb_gc_enable();
     } else {
       fprintf(stderr, "Warning, unable to allocate a tracker. You are running dangerously low on RAM!\n");
     }
@@ -85,7 +87,7 @@
 freelist_tramp(unsigned long rval)
 {
   struct obj_track *tracker = NULL;
-  if (track_objs) {
+  if (track_objs && objs) {
     st_delete(objs, (st_data_t *) &rval, (st_data_t *) &tracker);
     if (tracker) {
       free(tracker->source);


Switch to positional parameters

Switch to positional parameters

--- shared-bindings/displayio/Display.c
+++ shared-bindings/displayio/Display.c
@@ -384,10 +384,10 @@
 //|     :param int y: The top edge of the area
 //|     :param bytearray buffer: The buffer in which to place the pixel data
 STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
-  enum { ARG_y, ARG_buffer };
+    enum { ARG_y, ARG_buffer };
     static const mp_arg_t allowed_args[] = {
-        { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} },
-        { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_KW_ONLY, {} },
+        { MP_QSTR_y, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = -1} },
+        { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
     };
     mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
     mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);


NFS: Fix RCU issues in the NFSv4 delegation code

Fix a number of RCU issues in the NFSv4 delegation code.

 (1) delegation->cred doesn't need to be RCU protected as it's essentially an
     invariant refcounted structure.

     By the time we get to nfs_free_delegation(), the delegation is being
     released, so no one else should be attempting to use the saved
     credentials, and they can be cleared.

     However, since the list of delegations could still be under traversal at
     this point by such as nfs_client_return_marked_delegations(), the cred
     should be released in nfs_do_free_delegation() rather than in
     nfs_free_delegation().  Simply using rcu_assign_pointer() to clear it is
     insufficient as that doesn't stop the cred from being destroyed, and nor
     does calling put_rpccred() after call_rcu(), given that the latter is
     asynchronous.

 (2) nfs_detach_delegation_locked() and nfs_inode_set_delegation() should use
     rcu_derefence_protected() because they can only be called if
     nfs_client::cl_lock is held, and that guards against anyone changing
     nfsi->delegation under it.  Furthermore, the barrier imposed by
     rcu_dereference() is superfluous, given that the spin_lock() is also a
     barrier.

 (3) nfs_detach_delegation_locked() is now passed a pointer to the nfs_client
     struct so that it can issue lockdep advice based on clp->cl_lock for (2).

 (4) nfs_inode_return_delegation_noreclaim() and nfs_inode_return_delegation()
     should use rcu_access_pointer() outside the spinlocked region as they
     merely examine the pointer and don't follow it, thus rendering unnecessary
     the need to impose a partial ordering over the one item of interest.

     These result in an RCU warning like the following:

[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
fs/nfs/delegation.c:332 invoked rcu_dereference_check() without protection!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
2 locks held by mount.nfs4/2281:
 #0:  (&type->s_umount_key#34){+.+...}, at: [<ffffffff810b25b4>] deactivate_super+0x60/0x80
 #1:  (iprune_sem){+.+...}, at: [<ffffffff810c332a>] invalidate_inodes+0x39/0x13a

stack backtrace:
Pid: 2281, comm: mount.nfs4 Not tainted 2.6.34-rc1-cachefs #110
Call Trace:
 [<ffffffff8105149f>] lockdep_rcu_dereference+0xaa/0xb2
 [<ffffffffa00b4591>] nfs_inode_return_delegation_noreclaim+0x5b/0xa0 [nfs]
 [<ffffffffa0095d63>] nfs4_clear_inode+0x11/0x1e [nfs]
 [<ffffffff810c2d92>] clear_inode+0x9e/0xf8
 [<ffffffff810c3028>] dispose_list+0x67/0x10e
 [<ffffffff810c340d>] invalidate_inodes+0x11c/0x13a
 [<ffffffff810b1dc1>] generic_shutdown_super+0x42/0xf4
 [<ffffffff810b1ebe>] kill_anon_super+0x11/0x4f
 [<ffffffffa009893c>] nfs4_kill_super+0x3f/0x72 [nfs]
 [<ffffffff810b25bc>] deactivate_super+0x68/0x80
 [<ffffffff810c6744>] mntput_no_expire+0xbb/0xf8
 [<ffffffff810c681b>] release_mounts+0x9a/0xb0
 [<ffffffff810c689b>] put_mnt_ns+0x6a/0x79
 [<ffffffffa00983a1>] nfs_follow_remote_path+0x5a/0x146 [nfs]
 [<ffffffffa0098334>] ? nfs_do_root_mount+0x82/0x95 [nfs]
 [<ffffffffa00985a9>] nfs4_try_mount+0x75/0xaf [nfs]
 [<ffffffffa0098874>] nfs4_get_sb+0x291/0x31a [nfs]
 [<ffffffff810b2059>] vfs_kern_mount+0xb8/0x177
 [<ffffffff810b2176>] do_kern_mount+0x48/0xe8
 [<ffffffff810c810b>] do_mount+0x782/0x7f9
 [<ffffffff810c8205>] sys_mount+0x83/0xbe
 [<ffffffff81001eeb>] system_call_fastpath+0x16/0x1b

Also on:

fs/nfs/delegation.c:215 invoked rcu_dereference_check() without protection!
 [<ffffffff8105149f>] lockdep_rcu_dereference+0xaa/0xb2
 [<ffffffffa00b4223>] nfs_inode_set_delegation+0xfe/0x219 [nfs]
 [<ffffffffa00a9c6f>] nfs4_opendata_to_nfs4_state+0x2c2/0x30d [nfs]
 [<ffffffffa00aa15d>] nfs4_do_open+0x2a6/0x3a6 [nfs]
 ...

And:

fs/nfs/delegation.c:40 invoked rcu_dereference_check() without protection!
 [<ffffffff8105149f>] lockdep_rcu_dereference+0xaa/0xb2
 [<ffffffffa00b3bef>] nfs_free_delegation+0x3d/0x6e [nfs]
 [<ffffffffa00b3e71>] nfs_do_return_delegation+0x26/0x30 [nfs]
 [<ffffffffa00b406a>] __nfs_inode_return_delegation+0x1ef/0x1fe [nfs]
 [<ffffffffa00b448a>] nfs_client_return_marked_delegations+0xc9/0x124 [nfs]
 ...

Signed-off-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com>
Signed-off-by: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Signed-off-by: Trond Myklebust <6a1f9db795c9fc44be97d66ab114c53193bd3d13@netapp.com>

--- fs/nfs/delegation.c
+++ fs/nfs/delegation.c
@@ -24,6 +24,8 @@

 static void nfs_do_free_delegation(struct nfs_delegation *delegation)
 {
+	if (delegation->cred)
+		put_rpccred(delegation->cred);
 	kfree(delegation);
 }

@@ -36,13 +38,7 @@

 static void nfs_free_delegation(struct nfs_delegation *delegation)
 {
-	struct rpc_cred *cred;
-
-	cred = rcu_dereference(delegation->cred);
-	rcu_assign_pointer(delegation->cred, NULL);
 	call_rcu(&delegation->rcu, nfs_free_delegation_callback);
-	if (cred)
-		put_rpccred(cred);
 }

 void nfs_mark_delegation_referenced(struct nfs_delegation *delegation)
@@ -180,9 +176,13 @@
 	return inode;
 }

-static struct nfs_delegation *nfs_detach_delegation_locked(struct nfs_inode *nfsi, const nfs4_stateid *stateid)
-{
-	struct nfs_delegation *delegation = rcu_dereference(nfsi->delegation);
+static struct nfs_delegation *nfs_detach_delegation_locked(struct nfs_inode *nfsi,
+							   const nfs4_stateid *stateid,
+							   struct nfs_client *clp)
+{
+	struct nfs_delegation *delegation =
+		rcu_dereference_protected(nfsi->delegation,
+					  lockdep_is_held(&clp->cl_lock));

 	if (delegation == NULL)
 		goto nomatch;
@@ -209,7 +209,7 @@
 {
 	struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
 	struct nfs_inode *nfsi = NFS_I(inode);
-	struct nfs_delegation *delegation;
+	struct nfs_delegation *delegation, *old_delegation;
 	struct nfs_delegation *freeme = NULL;
 	int status = 0;

@@ -227,10 +227,12 @@
 	spin_lock_init(&delegation->lock);

 	spin_lock(&clp->cl_lock);
-	if (rcu_dereference(nfsi->delegation) != NULL) {
-		if (memcmp(&delegation->stateid, &nfsi->delegation->stateid,
-					sizeof(delegation->stateid)) == 0 &&
-				delegation->type == nfsi->delegation->type) {
+	old_delegation = rcu_dereference_protected(nfsi->delegation,
+						   lockdep_is_held(&clp->cl_lock));
+	if (old_delegation != NULL) {
+		if (memcmp(&delegation->stateid, &old_delegation->stateid,
+					sizeof(old_delegation->stateid)) == 0 &&
+				delegation->type == old_delegation->type) {
 			goto out;
 		}
 		/*
@@ -240,12 +242,12 @@
 		dfprintk(FILE, "%s: server %s handed out "
 				"a duplicate delegation!\n",
 				__func__, clp->cl_hostname);
-		if (delegation->type <= nfsi->delegation->type) {
+		if (delegation->type <= old_delegation->type) {
 			freeme = delegation;
 			delegation = NULL;
 			goto out;
 		}
-		freeme = nfs_detach_delegation_locked(nfsi, NULL);
+		freeme = nfs_detach_delegation_locked(nfsi, NULL, clp);
 	}
 	list_add_rcu(&delegation->super_list, &clp->cl_delegations);
 	nfsi->delegation_state = delegation->type;
@@ -315,7 +317,7 @@
 		if (inode == NULL)
 			continue;
 		spin_lock(&clp->cl_lock);
-		delegation = nfs_detach_delegation_locked(NFS_I(inode), NULL);
+		delegation = nfs_detach_delegation_locked(NFS_I(inode), NULL, clp);
 		spin_unlock(&clp->cl_lock);
 		rcu_read_unlock();
 		if (delegation != NULL) {
@@ -344,9 +346,9 @@
 	struct nfs_inode *nfsi = NFS_I(inode);
 	struct nfs_delegation *delegation;

-	if (rcu_dereference(nfsi->delegation) != NULL) {
+	if (rcu_access_pointer(nfsi->delegation) != NULL) {
 		spin_lock(&clp->cl_lock);
-		delegation = nfs_detach_delegation_locked(nfsi, NULL);
+		delegation = nfs_detach_delegation_locked(nfsi, NULL, clp);
 		spin_unlock(&clp->cl_lock);
 		if (delegation != NULL)
 			nfs_do_return_delegation(inode, delegation, 0);
@@ -360,9 +362,9 @@
 	struct nfs_delegation *delegation;
 	int err = 0;

-	if (rcu_dereference(nfsi->delegation) != NULL) {
+	if (rcu_access_pointer(nfsi->delegation) != NULL) {
 		spin_lock(&clp->cl_lock);
-		delegation = nfs_detach_delegation_locked(nfsi, NULL);
+		delegation = nfs_detach_delegation_locked(nfsi, NULL, clp);
 		spin_unlock(&clp->cl_lock);
 		if (delegation != NULL) {
 			nfs_msync_inode(inode);
@@ -540,7 +542,7 @@
 		if (inode == NULL)
 			continue;
 		spin_lock(&clp->cl_lock);
-		delegation = nfs_detach_delegation_locked(NFS_I(inode), NULL);
+		delegation = nfs_detach_delegation_locked(NFS_I(inode), NULL, clp);
 		spin_unlock(&clp->cl_lock);
 		rcu_read_unlock();
 		if (delegation != NULL)


unload after last close

unload after last close

--- scsi/sd.c
+++ scsi/sd.c
@@ -1,5 +1,5 @@
-/*	$OpenBSD: sd.c,v 1.10 1996/05/10 12:31:39 deraadt Exp $	*/
-/*	$NetBSD: sd.c,v 1.98 1996/05/05 19:52:53 christos Exp $	*/
+/*	$OpenBSD: sd.c,v 1.11 1996/05/22 11:57:30 deraadt Exp $	*/
+/*	$NetBSD: sd.c,v 1.100 1996/05/14 10:38:47 leo Exp $	*/

 /*
  * Copyright (c) 1994, 1995 Charles M. Hannum.  All rights reserved.
@@ -398,7 +398,7 @@

 		scsi_prevent(sd->sc_link, PR_ALLOW,
 		    SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY);
-		sd->sc_link->flags &= ~SDEV_OPEN;
+		sd->sc_link->flags &= ~(SDEV_OPEN|SDEV_MEDIA_LOADED);
 	}

 	sdunlock(sd);
@@ -502,7 +502,7 @@
 	struct scsi_rw_big cmd_big;
 	struct scsi_rw cmd_small;
 	struct scsi_generic *cmdp;
-	int blkno, nblks, cmdlen;
+	int blkno, nblks, cmdlen, error;
 	struct partition *p;

 	SC_DEBUG(sc_link, SDEV_DB2, ("sdstart "));
@@ -591,11 +591,13 @@
 		 * Call the routine that chats with the adapter.
 		 * Note: we cannot sleep as we may be an interrupt
 		 */
-		if (scsi_scsi_cmd(sc_link, cmdp, cmdlen,
+		error = scsi_scsi_cmd(sc_link, cmdp, cmdlen,
 		    (u_char *)bp->b_data, bp->b_bcount,
 		    SDRETRIES, 10000, bp, SCSI_NOSLEEP |
-		    ((bp->b_flags & B_READ) ? SCSI_DATA_IN : SCSI_DATA_OUT)))
-			printf("%s: not queued", sd->sc_dev.dv_xname);
+		    ((bp->b_flags & B_READ) ? SCSI_DATA_IN : SCSI_DATA_OUT));
+		if (error)
+			printf("%s: not queued, error %d\n",
+			    sd->sc_dev.dv_xname, error);
 	}
 }


add xc_php_addref_dmz and s/xc_php_remove_dmz/xc_php_release_dmz/

git-svn-id: 88e1a00e4eab3b0bb0c09889526309a3e2f5bd8a@323 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

--- xcache.c
+++ xcache.c
@@ -147,7 +147,12 @@
 	php->cache->mem->handlers->free(php->cache->mem, (xc_entry_data_php_t *)php);
 }
 /* }}} */
-static void xc_php_remove_dmz(xc_entry_data_php_t *php) /* {{{ */
+static void xc_php_addref_dmz(xc_entry_data_php_t *php) /* {{{ */
+{
+	php->refcount ++;
+}
+/* }}} */
+static void xc_php_release_dmz(xc_entry_data_php_t *php) /* {{{ */
 {
 	if (-- php->refcount == 0) {
 		xc_entry_data_php_t **pp = &(php->cache->phps[php->hvalue]);
@@ -236,7 +241,7 @@
 static void xc_entry_free_real_dmz(volatile xc_entry_t *xce) /* {{{ */
 {
 	if (xce->type == XC_TYPE_PHP) {
-		xc_php_remove_dmz(xce->data.php);
+		xc_php_release_dmz(xce->data.php);
 	}
 	xce->cache->mem->handlers->free(xce->cache->mem, (xc_entry_t *)xce);
 }
@@ -1290,21 +1295,20 @@
 		/* php_store */
 		if (newlycompiled) {
 			stored_php = xc_php_store_dmz(&php TSRMLS_CC);
-			/* error */
 			if (!stored_php) {
+				/* error */
 				break;
 			}
 		}
 		/* entry_store */
+		xc_php_addref_dmz(stored_php);
 		stored_xce = xc_entry_store_dmz(&xce TSRMLS_CC);
 		if (stored_xce) {
 			stored_xce->data.php = stored_php;
-			stored_php->refcount ++;
 		}
 		else {
 			/* error */
-			xc_php_remove_dmz(stored_php);
-			stored_php = NULL;
+			xc_php_release_dmz(stored_php);
 		}
 	} LEAVE_LOCK_EX(cache);
 	/* }}} */


Some early callers of pmap_growkernel call it before vm_page structures are initialized. So we can't to PHYS_TO_VM_PAGE becuase there are no vm_pages. Reintroduce the old pmap_zero_page renamed to pmap_zero_phys that can zero pages without struct vm_page.

--- arch/i386/i386/pmap.c
+++ arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pmap.c,v 1.62 2002/09/10 18:29:43 art Exp $	*/
+/*	$OpenBSD: pmap.c,v 1.63 2002/09/11 22:39:00 art Exp $	*/
 /*	$NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $	*/

 /*
@@ -417,6 +417,8 @@
 void			pmap_pinit(pmap_t);
 void			pmap_release(pmap_t);

+void			pmap_zero_phys(paddr_t);
+
 /*
  * p m a p   i n l i n e   h e l p e r   f u n c t i o n s
  */
@@ -2026,6 +2028,26 @@
 {
 	paddr_t pa = VM_PAGE_TO_PHYS(pg);

+	simple_lock(&pmap_zero_page_lock);
+#ifdef DIAGNOSTIC
+	if (*zero_pte)
+		panic("pmap_zero_page: lock botch");
+#endif
+
+	*zero_pte = (pa & PG_FRAME) | PG_V | PG_RW;	/* map in */
+	bzero(zerop, NBPG);				/* zero */
+	*zero_pte = 0;				/* zap! */
+	pmap_update_pg((vaddr_t)zerop);		/* flush TLB */
+	simple_unlock(&pmap_zero_page_lock);
+}
+
+/*
+ * pmap_zero_phys: same as pmap_zero_page, but for use before vm_pages are
+ * initialized.
+ */
+void
+pmap_zero_phys(paddr_t pa)
+{
 	simple_lock(&pmap_zero_page_lock);
 #ifdef DIAGNOSTIC
 	if (*zero_pte)
@@ -3613,7 +3635,7 @@

 			if (uvm_page_physget(&ptaddr) == FALSE)
 				panic("pmap_growkernel: out of memory");
-			pmap_zero_page(PHYS_TO_VM_PAGE(ptaddr));
+			pmap_zero_phys(ptaddr);

 			kpm->pm_pdir[PDSLOT_KERN + nkpde] =
 				ptaddr | PG_RW | PG_V;


Agathaumas

Agathaumas


move the fd, don't copy it

move the fd, don't copy it

--- src/s6-rc/s6-rc-compile.c
+++ src/s6-rc/s6-rc-compile.c
@@ -32,7 +32,7 @@
 #define S6RC_ONESHOT_RUNNER_RUNSCRIPT \
 "#!" EXECLINE_EXTBINPREFIX "execlineb -P\n" \
 EXECLINE_EXTBINPREFIX "fdmove -c 2 1\n" \
-EXECLINE_EXTBINPREFIX "fdmove -c 1 3\n" \
+EXECLINE_EXTBINPREFIX "fdmove 1 3\n" \
 S6_EXTBINPREFIX "s6-ipcserver-socketbinder -- s\n" \
 S6_EXTBINPREFIX "s6-ipcserverd -1 --\n" \
 S6_EXTBINPREFIX "s6-ipcserver-access -v0 -E -l0 -i data/rules --\n" \


nfsd: return correct lockowner when there is a race on hash insert

alloc_init_lock_stateowner can return an already freed entry if there is
a race to put openowners in the hashtable.

Noticed by inspection after Jeff Layton fixed the same bug for open
owners.  Depending on client behavior, this one may be trickier to
trigger in practice.

Fixes: c58c6610ec24 "nfsd: Protect adding/removing lock owners using client_lock"
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Cc: Trond Myklebust <cc958843532c615cbd4920e868f78c7985331a5a@primarydata.com>
Acked-by: Jeff Layton <542dfe392278ff3cf017aafde9d989e8068d5c3e@primarydata.com>
Signed-off-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@redhat.com>

--- fs/nfsd/nfs4state.c
+++ fs/nfsd/nfs4state.c
@@ -5062,7 +5062,7 @@
 	} else
 		nfs4_free_lockowner(&lo->lo_owner);
 	spin_unlock(&clp->cl_lock);
-	return lo;
+	return ret;
 }

 static void


sys.resource: provide RLIMIT_AS fallback for OpenBSD 5.6.

* ext/posix/sys/resource.c (RLIMIT_AS): Fallback to RLIMIT_DATA
if not otherwise defined.

Signed-off-by: Gary V. Vaughan <f9023000f29773649f3850298becb9544b5fd6a9@gnu.org>

--- ext/posix/sys/resource.c
+++ ext/posix/sys/resource.c
@@ -20,6 +20,11 @@
 #include <sys/resource.h>

 #include "_helpers.c"
+
+/* OpenBSD 5.6 recommends using RLIMIT_DATA in place of missing RLIMIT_AS */
+#ifndef RLIMIT_AS
+#  define RLIMIT_AS RLIMIT_DATA
+#endif

 /***


fix MSVC warning

fix MSVC warning

--- libndarray/windows/npy_config.h
+++ libndarray/windows/npy_config.h
@@ -55,7 +55,6 @@
 #define NPY_HAVE_DECL_ASINHL 0
 #define NPY_HAVE_DECL_ASINL 0
 #define NPY_HAVE_DECL_ATAN 1
-#define NPY_HAVE_DECL_ATAN2 1
 #define NPY_HAVE_DECL_ATAN2F 0
 #define NPY_HAVE_DECL_ATAN2L 0
 #define NPY_HAVE_DECL_ATANF 0
@@ -109,7 +108,6 @@
 #define NPY_HAVE_DECL_FMOD 1
 #define NPY_HAVE_DECL_FMODF 0
 #define NPY_HAVE_DECL_FMODL 0
-#define NPY_HAVE_DECL_HYPOT 1
 #define NPY_HAVE_DECL_HYPOTF 0
 #define NPY_HAVE_DECL_HYPOTL 0
 #define NPY_HAVE_DECL_ISFINITE 0
@@ -167,8 +165,11 @@

 /* Disable broken MS math functions */
 #if defined(_MSC_VER) || defined(__MINGW32_VERSION)
-#undef NPY_HAVE_DECL_ATAN2 0
-#undef NPY_HAVE_DECL_HYPOT 0
+#define NPY_HAVE_DECL_ATAN2 0
+#define NPY_HAVE_DECL_HYPOT 0
+#else
+#define NPY_HAVE_DECL_ATAN2 1
+#define NPY_HAVE_DECL_HYPOT 1
 #endif


Fix OpenGL context creation

Fix OpenGL context creation

Specifying major/minor OpenGL version as well as ARB_compatiblity is
only officially needed/supported in OpenGL 3+

--- sdlarch.c
+++ sdlarch.c
@@ -293,10 +293,11 @@
     SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
     SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);

-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, g_video.hw.version_major);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, g_video.hw.version_minor);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
-
+    if (g_video.hw.context_type == RETRO_HW_CONTEXT_OPENGL_CORE || g_video.hw.version_major >= 3) {
+        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, g_video.hw.version_major);
+        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, g_video.hw.version_minor);
+        SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
+    }

     switch (g_video.hw.context_type) {
     case RETRO_HW_CONTEXT_OPENGL_CORE:
@@ -306,7 +307,8 @@
         SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
         break;
     case RETRO_HW_CONTEXT_OPENGL:
-        SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
+        if (g_video.hw.version_major >= 3)
+            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
         break;
     default:
         die("Unsupported hw context %i. (only OPENGL, OPENGL_CORE and OPENGLES2 supported)", g_video.hw.context_type);


adapted MeshColorizer to use new image classes

--- shared_include/mesh/MeshColorizer.h
+++ shared_include/mesh/MeshColorizer.h
@@ -2,14 +2,14 @@
 #define __MESH_COLORIZER_H__

 #include "mesh/Mesh.h"
-#include "scan/Scan.h"
+#include "image/Image.h"

 class MeshColorizer {

   public:

     /* color the vertices by using the values of a volume scan */
-    static void colorize(Mesh& mesh, const Scan& scan) {
+    static void colorize(Mesh& mesh, const Image& scan) {

       auto& colors = mesh.get_vertex_colors();
       // erase old colors
@@ -19,8 +19,10 @@

       // color the vertex according to the scan voxel it is located in
       for( const arma::vec& vertex: vertices) {
-        const double color = scan.get_value(vertex(0), vertex(1), vertex(2));
+
+        const double& color = scan.access().at_coordinate(vertex(0), vertex(1), vertex(2));
         colors.push_back(arma::vec({color, color, color}));
+
       }

     }


[PATCH] swsusp: fix typo in cr0 handling

Writing cr0 to cr2 register can't be right.  This fixes the typo.  I wonder
how it could survive so long.

Signed-off-by: Pavel Machek <2375fa63e2908bb2df59f606483a3aa92321db7a@suse.cz>
Cc: Zachary Amsden <9de8c4480303b5335cd2a33eefe814615ba3612a@vmware.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- arch/i386/power/cpu.c
+++ arch/i386/power/cpu.c
@@ -92,7 +92,7 @@
 	write_cr4(ctxt->cr4);
 	write_cr3(ctxt->cr3);
 	write_cr2(ctxt->cr2);
-	write_cr2(ctxt->cr0);
+	write_cr0(ctxt->cr0);

 	/*
 	 * now restore the descriptor tables to their proper values


Remove debug print statement.

Remove debug print statement.

--- src/scripting/interface.c
+++ src/scripting/interface.c
@@ -8,14 +8,10 @@

 llist *imported_scripts = NULL;

-/* Native functions */
-
 bool include_script(const char *filename)
 {
     if (llist_has(&imported_scripts, filename))
         return true;
-
-    printf("Importing %s\n", filename);

     char *buffer = read_file(filename);


nfsd4: release openowners on free in >=4.1 case

We don't need to keep openowners around in the >=4.1 case, because they
aren't needed to handle CLOSE replays any more (that's a problem for
sessions).  And doing so causes unexpected failures on a subsequent
destroy_clientid to fail.

We probably also need something comparable for lock owners on last
unlock.

Signed-off-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@redhat.com>

--- fs/nfsd/nfs4state.c
+++ fs/nfsd/nfs4state.c
@@ -3763,12 +3763,19 @@
 	nfsd4_close_open_stateid(stp);
 	oo->oo_last_closed_stid = stp;

-	/* place unused nfs4_stateowners on so_close_lru list to be
-	 * released by the laundromat service after the lease period
-	 * to enable us to handle CLOSE replay
-	 */
-	if (list_empty(&oo->oo_owner.so_stateids))
-		move_to_close_lru(oo);
+	if (list_empty(&oo->oo_owner.so_stateids)) {
+		if (cstate->minorversion) {
+			release_openowner(oo);
+			cstate->replay_owner = NULL;
+		} else {
+			/*
+			 * In the 4.0 case we need to keep the owners around a
+			 * little while to handle CLOSE replay.
+			 */
+			if (list_empty(&oo->oo_owner.so_stateids))
+				move_to_close_lru(oo);
+		}
+	}
 out:
 	if (!cstate->replay_owner)
 		nfs4_unlock_state();


In pmap_remove_page(), do not keep wired mappings; the callers want them gone.

--- arch/m88k/m88k/pmap.c
+++ arch/m88k/m88k/pmap.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pmap.c,v 1.76 2014/05/08 22:17:33 miod Exp $	*/
+/*	$OpenBSD: pmap.c,v 1.77 2014/05/17 12:22:09 miod Exp $	*/

 /*
  * Copyright (c) 2001-2004, 2010, Miodrag Vallat.
@@ -1418,12 +1418,6 @@
 			pvl = pvl->pv_next;
 			continue;	/* no page mapping */
 		}
-		if (pmap_pte_w(pte)) {
-			DPRINTF(CD_RMPG, ("pmap_remove_page(%p): wired mapping not removed\n",
-			    pg));
-			pvl = pvl->pv_next;
-			continue;
-		}

 		pmap_remove_pte(pmap, va, pte, pg, TRUE);
 		/*


Refine code to follow coding style.

Refine code to follow coding style.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@13595 6f19259b-4bc3-4df7-8a09-765794883524

--- ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -19,6 +19,14 @@
 #define INIT_DATA_BUFFER_SIZE  1024
 #define INIT_ATTS_BUFFER_SIZE  64

+/**
+  Base on the input attribute value to return the attribute string.
+
+  @param[in]     Atts           The input attribute value
+  @param[in,out] RetString      The buffer to save the attribute string.
+
+  @retval The attribute string info.
+**/
 CONST CHAR16 *
 EFIAPI
 GetAttrType (
@@ -28,21 +36,21 @@
 {
   StrCpy(RetString, L"");

-  if (Atts & EFI_VARIABLE_NON_VOLATILE) {
+  if ((Atts & EFI_VARIABLE_NON_VOLATILE) != 0) {
     StrCat(RetString, L"+NV");
   }
-  if (Atts & EFI_VARIABLE_RUNTIME_ACCESS) {
+  if ((Atts & EFI_VARIABLE_RUNTIME_ACCESS) != 0) {
     StrCat(RetString, L"+RS+BS");
-  } else if (Atts & EFI_VARIABLE_BOOTSERVICE_ACCESS) {
+  } else if ((Atts & EFI_VARIABLE_BOOTSERVICE_ACCESS) != 0) {
     StrCat(RetString, L"+BS");
   }
-  if (Atts & EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
+  if ((Atts & EFI_VARIABLE_HARDWARE_ERROR_RECORD) != 0) {
     StrCat(RetString, L"+HR");
   }
-  if (Atts & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) {
+  if ((Atts & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
     StrCat(RetString, L"+AW");
   }
-  if (Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) {
+  if ((Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) != 0) {
     StrCat(RetString, L"+AT");
   }


nfsd: fix clid_inuse on mount with security change

In bakeathon testing Solaris client was getting CLID_INUSE error when
doing a krb5 mount soon after an auth_sys mount, or vice versa.

That's not really necessary since in this case the old client doesn't
have any state any more:

	http://tools.ietf.org/html/rfc7530#page-103

	"when the server gets a SETCLIENTID for a client ID that
	currently has no state, or it has state but the lease has
	expired, rather than returning NFS4ERR_CLID_INUSE, the server
	MUST allow the SETCLIENTID and confirm the new client ID if
	followed by the appropriate SETCLIENTID_CONFIRM."

This doesn't fix the problem completely since our client_has_state()
check counts openowners left around to handle close replays, which we
should probably just remove in this case.

Signed-off-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@redhat.com>

--- fs/nfsd/nfs4state.c
+++ fs/nfsd/nfs4state.c
@@ -2262,7 +2262,8 @@
 	 * Note clp->cl_openowners check isn't quite right: there's no
 	 * need to count owners without stateid's.
 	 *
-	 * Also note we should probably be using this in 4.0 case too.
+	 * Also note in 4.0 case should also be checking for openowners
+	 * kept around just for close handling.
 	 */
 	return !list_empty(&clp->cl_openowners)
 #ifdef CONFIG_NFSD_PNFS
@@ -3049,7 +3050,7 @@
 	/* Cases below refer to rfc 3530 section 14.2.33: */
 	spin_lock(&nn->client_lock);
 	conf = find_confirmed_client_by_name(&clname, nn);
-	if (conf) {
+	if (conf && client_has_state(conf)) {
 		/* case 0: */
 		status = nfserr_clid_inuse;
 		if (clp_used_exchangeid(conf))
@@ -3136,6 +3137,11 @@
 	} else { /* case 3: normal case; new or rebooted client */
 		old = find_confirmed_client_by_name(&unconf->cl_name, nn);
 		if (old) {
+			status = nfserr_clid_inuse;
+			if (client_has_state(old)
+					&& !same_creds(&unconf->cl_cred,
+							&old->cl_cred))
+				goto out;
 			status = mark_client_expired_locked(old);
 			if (status) {
 				old = NULL;


riscv: pmp: make PMP debug display more comprehensive

Decoding those values by hand gets tedious.

Signed-off-by: Nicolas Pitre <76342682d5afc62854e1102d9578521fe1ed6813@baylibre.com>

--- arch/riscv/core/pmp.c
+++ arch/riscv/core/pmp.c
@@ -61,9 +61,42 @@

 	LOG_DBG("PMP %s:", banner);
 	for (index = start; index < end; index++) {
-		LOG_DBG("%3d: "PR_ADDR" 0x%02x", index,
-			pmp_addr[index],
-			pmp_n_cfg[index]);
+		ulong_t start, end, tmp;
+
+		switch (pmp_n_cfg[index] & PMP_A) {
+		case PMP_TOR:
+			start = (index == 0) ? 0 : (pmp_addr[index - 1] << 2);
+			end = (pmp_addr[index] << 2) - 1;
+			break;
+		case PMP_NA4:
+			start = pmp_addr[index] << 2;
+			end = start + 3;
+			break;
+		case PMP_NAPOT:
+			tmp = (pmp_addr[index] << 2) | 0x3;
+			start = tmp & (tmp + 1);
+			end   = tmp | (tmp + 1);
+			break;
+		default:
+			start = 0;
+			end = 0;
+			break;
+		}
+
+		if (end == 0) {
+			LOG_DBG("%3d: "PR_ADDR" 0x%02x", index,
+				pmp_addr[index],
+				pmp_n_cfg[index]);
+		} else {
+			LOG_DBG("%3d: "PR_ADDR" 0x%02x --> "
+				PR_ADDR"-"PR_ADDR" %c%c%c%s",
+				index, pmp_addr[index], pmp_n_cfg[index],
+				start, end,
+				(pmp_n_cfg[index] & PMP_R) ? 'R' : '-',
+				(pmp_n_cfg[index] & PMP_W) ? 'W' : '-',
+				(pmp_n_cfg[index] & PMP_X) ? 'X' : '-',
+				(pmp_n_cfg[index] & PMP_L) ? " LOCKED" : "");
+		}
 	}
 }

@@ -349,6 +382,8 @@
  */
 void z_riscv_pmp_stackguard_enable(struct k_thread *thread)
 {
+	LOG_DBG("pmp_stackguard_enable for thread %p", thread);
+
 	/*
 	 * Disable (non-locked) PMP entries for m-mode while we update them.
 	 * While at it, also clear MSTATUS_MPP as it must be cleared for
@@ -466,6 +501,8 @@
 void z_riscv_pmp_usermode_enable(struct k_thread *thread)
 {
 	struct k_mem_domain *domain = thread->mem_domain_info.mem_domain;
+
+	LOG_DBG("pmp_usermode_enable for thread %p with domain %p", thread, domain);

 	if (thread->arch.u_mode_pmp_end_index == 0) {
 		/* z_riscv_pmp_usermode_prepare() has not been called yet */


nonaccession

nonaccession


Add CTRL+C support for ‘devtree’ command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hp.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@15993 6f19259b-4bc3-4df7-8a09-765794883524

--- ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c
+++ ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c
@@ -1,6 +1,7 @@
 /** @file
   Main file for DevTree shell Driver1 function.

+  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.

   Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.

   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -57,6 +58,12 @@
   ChildCount          = 0;

   ASSERT(TheHandle    != NULL);
+
+  if (ShellGetExecutionBreakFlag()) {
+    ShellStatus = SHELL_ABORTED;
+    return ShellStatus;
+  }
+
   //
   // We want controller handles.  they will not have LoadedImage or DriverBinding (or others...)
   //
@@ -119,6 +126,9 @@
   ParseHandleDatabaseForChildControllers(TheHandle, &ChildCount, &ChildHandleBuffer);
   for (LoopVar = 0 ; LoopVar < ChildCount && ShellStatus == SHELL_SUCCESS; LoopVar++){
     ShellStatus = DoDevTreeForHandle(ChildHandleBuffer[LoopVar], Lang, UseDevPaths, IndentCharCount+2, HiiString);
+    if (ShellStatus == SHELL_ABORTED) {
+      break;
+    }
   }

   if (ChildHandleBuffer != NULL) {


slow + crap-out fix

slow + crap-out fix

git-svn-id: 9f3514be25e8c4f808c923faecc75db62e18396e@1567 ce7afbd9-0f25-0410-bca2-9054d3de1fdb

--- einit/src/set-lowmem.c
+++ einit/src/set-lowmem.c
@@ -318,7 +318,7 @@
 }

 void setsort (void **set, enum set_sort_order task, signed int(*sortfunction)(const void *, const void*)) {
-#if 0
+#if 1
  uint32_t c = 0, c2 = 0, x = 0, dc = 1;
  void *tmp;
  if (!set) return;
@@ -340,7 +340,7 @@
  }

  return;
-#endif
+#else
  uint32_t c = 0;
  if (task == set_sort_order_string_lexical)
   sortfunction = (signed int(*)(const void *, const void*))strcmp;
@@ -349,6 +349,7 @@
  for (; set[c]; c++);

  qsort (set, c+1, sizeof (void *), sortfunction);
+#endif
 }

 int inset (const void **haystack, const void *needle, int32_t esize) {


bpf: remove unused argument to lb4_xlate

The svc argument to lb4_xlate is unused. Remove it.

Also mark the nexthdr and backend arguments as __maybe_unused as they
are only used when compiled with LB_L4.

Signed-off-by: Tobias Klauser <9249c549618448e4c699e8032ba6c7f0d7fd4b7f@distanz.ch>

--- bpf/lib/lb.h
+++ bpf/lib/lb.h
@@ -756,9 +756,10 @@

 static __always_inline int
 lb4_xlate(struct __ctx_buff *ctx, __be32 *new_daddr, __be32 *new_saddr,
-	     __be32 *old_saddr, __u8 nexthdr, int l3_off, int l4_off,
+	     __be32 *old_saddr, __u8 nexthdr __maybe_unused,
+	     int l3_off, int l4_off,
 	     struct csum_offset *csum_off, struct lb4_key *key,
-	     struct lb4_service *svc, struct lb4_backend *backend)
+	     struct lb4_backend *backend __maybe_unused)
 {
 	int ret;
 	__be32 sum;
@@ -923,7 +924,7 @@

 	return lb4_xlate(ctx, &new_daddr, &new_saddr, &saddr,
 			 tuple->nexthdr, l3_off, l4_off, csum_off, key,
-			 svc, backend);
+			 backend);

 drop_no_service:
 		tuple->flags = flags;


nfsd4: rearrange exchange_id logic to simplify

Minor cleanup: it's simpler to have separate code paths for the update
and non-update cases.

Signed-off-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@redhat.com>

--- fs/nfsd/nfs4state.c
+++ fs/nfsd/nfs4state.c
@@ -1557,36 +1557,36 @@
 		bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred);
 		bool verfs_match = same_verf(&verf, &conf->cl_verifier);

-		if (!clp_used_exchangeid(conf)) {
-			if (update) { /* buggy client */
+		if (update) {
+			if (!clp_used_exchangeid(conf)) { /* buggy client */
 				status = nfserr_inval;
 				goto out;
 			}
-		}
-		if (!creds_match) { /* case 9 */
-			if (update)
+			if (!creds_match) { /* case 9 */
 				status = nfserr_perm;
-			else /* case 3 */
-				status = nfserr_clid_inuse;
-			goto out;
-		}
-		if (!verfs_match) { /* case 8 */
-			if (update) {
+				goto out;
+			}
+			if (!verfs_match) { /* case 8 */
 				status = nfserr_not_same;
 				goto out;
 			}
-			/* case 5, client reboot */
-			expire_client(conf);
-			goto out_new;
+			/* case 6 */
+			exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
+			new = conf;
+			goto out_copy;
 		}
-		if (!clp_used_exchangeid(conf)) {
-			status = nfserr_inval;
+		if (!creds_match) { /* case 3 */
+			status = nfserr_clid_inuse;
 			goto out;
 		}
-		/* case 2 */
-		exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
-		new = conf;
-		goto out_copy;
+		if (verfs_match) { /* case 2 */
+			exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
+			new = conf;
+			goto out_copy;
+		}
+		/* case 5, client reboot */
+		expire_client(conf);
+		goto out_new;
 	}

 	if (update) { /* case 7 */


fix |> 偶出现 initWithFormat: arguments： crash

--- DDLogger/DDLogger.h
+++ DDLogger/DDLogger.h
@@ -31,9 +31,9 @@

 #endif

-#define DDLog(...)                DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelNone,[NSString stringWithFormat:__VA_ARGS__]);
-#define DDLogInfo(...)            DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelInfo,[NSString stringWithFormat:__VA_ARGS__]);
-#define DDLogWarn(...)         DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelWarn,[NSString stringWithFormat:__VA_ARGS__]);
-#define DDLogError(...)           DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelError,[NSString stringWithFormat:__VA_ARGS__]);
+#define DDLog(...)                DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelNone,__VA_ARGS__);
+#define DDLogInfo(...)            DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelInfo,__VA_ARGS__);
+#define DDLogWarn(...)            DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelWarn,__VA_ARGS__);
+#define DDLogError(...)           DDExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,DDLogLevelError,__VA_ARGS__);

 #endif /* DDLogger_h */


The Shape functions of ANCF beam are ranging in 0...1:   remap U from -1...+1 that is sent from Gauss integrator for ChLoadableU . This also explains why a free falling ANCF beam was slightly rotating instead of staying parallel.

--- src/chrono_fea/ChElementBeamANCF.h
+++ src/chrono_fea/ChElementBeamANCF.h
@@ -911,7 +911,7 @@
                     ChVectorDynamic<>* state_w  ///< if != 0, update state (speed part) to this, then evaluate Q
                     ) {
         ChMatrixNM<double, 1,4> N;
-         this->ShapeFunctions(N, U); // evaluate shape functions (in compressed vector), btw. not dependant on state
+         this->ShapeFunctions(N, (U+1)*0.5); // evaluate shape functions (in compressed vector), btw. not dependant on state

          detJ = this->GetRestLength()/2.0;


musketade

musketade


KVM guest: remove KVM guest pv mmu support

This has not been used for some years now.  It's time to remove it.

Signed-off-by: Chris Wright <e829bd48de90b6e1a1950750fa8ca2bb62f273d4@redhat.com>
Signed-off-by: Avi Kivity <8f920f22884d6fea9df883843c4a8095a2e5ac6f@redhat.com>

--- arch/x86/kernel/kvm.c
+++ arch/x86/kernel/kvm.c
@@ -39,8 +39,6 @@
 #include <asm/desc.h>
 #include <asm/tlbflush.h>

-#define MMU_QUEUE_SIZE 1024
-
 static int kvmapf = 1;

 static int parse_no_kvmapf(char *arg)
@@ -60,20 +58,9 @@

 early_param("no-steal-acc", parse_no_stealacc);

-struct kvm_para_state {
-	u8 mmu_queue[MMU_QUEUE_SIZE];
-	int mmu_queue_len;
-};
-
-static DEFINE_PER_CPU(struct kvm_para_state, para_state);
 static DEFINE_PER_CPU(struct kvm_vcpu_pv_apf_data, apf_reason) __aligned(64);
 static DEFINE_PER_CPU(struct kvm_steal_time, steal_time) __aligned(64);
 static int has_steal_clock = 0;
-
-static struct kvm_para_state *kvm_para_state(void)
-{
-	return &per_cpu(para_state, raw_smp_processor_id());
-}

 /*
  * No need for any "IO delay" on KVM
@@ -271,151 +258,6 @@
 	}
 }

-static void kvm_mmu_op(void *buffer, unsigned len)
-{
-	int r;
-	unsigned long a1, a2;
-
-	do {
-		a1 = __pa(buffer);
-		a2 = 0;   /* on i386 __pa() always returns <4G */
-		r = kvm_hypercall3(KVM_HC_MMU_OP, len, a1, a2);
-		buffer += r;
-		len -= r;
-	} while (len);
-}
-
-static void mmu_queue_flush(struct kvm_para_state *state)
-{
-	if (state->mmu_queue_len) {
-		kvm_mmu_op(state->mmu_queue, state->mmu_queue_len);
-		state->mmu_queue_len = 0;
-	}
-}
-
-static void kvm_deferred_mmu_op(void *buffer, int len)
-{
-	struct kvm_para_state *state = kvm_para_state();
-
-	if (paravirt_get_lazy_mode() != PARAVIRT_LAZY_MMU) {
-		kvm_mmu_op(buffer, len);
-		return;
-	}
-	if (state->mmu_queue_len + len > sizeof state->mmu_queue)
-		mmu_queue_flush(state);
-	memcpy(state->mmu_queue + state->mmu_queue_len, buffer, len);
-	state->mmu_queue_len += len;
-}
-
-static void kvm_mmu_write(void *dest, u64 val)
-{
-	__u64 pte_phys;
-	struct kvm_mmu_op_write_pte wpte;
-
-#ifdef CONFIG_HIGHPTE
-	struct page *page;
-	unsigned long dst = (unsigned long) dest;
-
-	page = kmap_atomic_to_page(dest);
-	pte_phys = page_to_pfn(page);
-	pte_phys <<= PAGE_SHIFT;
-	pte_phys += (dst & ~(PAGE_MASK));
-#else
-	pte_phys = (unsigned long)__pa(dest);
-#endif
-	wpte.header.op = KVM_MMU_OP_WRITE_PTE;
-	wpte.pte_val = val;
-	wpte.pte_phys = pte_phys;
-
-	kvm_deferred_mmu_op(&wpte, sizeof wpte);
-}
-
-/*
- * We only need to hook operations that are MMU writes.  We hook these so that
- * we can use lazy MMU mode to batch these operations.  We could probably
- * improve the performance of the host code if we used some of the information
- * here to simplify processing of batched writes.
- */
-static void kvm_set_pte(pte_t *ptep, pte_t pte)
-{
-	kvm_mmu_write(ptep, pte_val(pte));
-}
-
-static void kvm_set_pte_at(struct mm_struct *mm, unsigned long addr,
-			   pte_t *ptep, pte_t pte)
-{
-	kvm_mmu_write(ptep, pte_val(pte));
-}
-
-static void kvm_set_pmd(pmd_t *pmdp, pmd_t pmd)
-{
-	kvm_mmu_write(pmdp, pmd_val(pmd));
-}
-
-#if PAGETABLE_LEVELS >= 3
-#ifdef CONFIG_X86_PAE
-static void kvm_set_pte_atomic(pte_t *ptep, pte_t pte)
-{
-	kvm_mmu_write(ptep, pte_val(pte));
-}
-
-static void kvm_pte_clear(struct mm_struct *mm,
-			  unsigned long addr, pte_t *ptep)
-{
-	kvm_mmu_write(ptep, 0);
-}
-
-static void kvm_pmd_clear(pmd_t *pmdp)
-{
-	kvm_mmu_write(pmdp, 0);
-}
-#endif
-
-static void kvm_set_pud(pud_t *pudp, pud_t pud)
-{
-	kvm_mmu_write(pudp, pud_val(pud));
-}
-
-#if PAGETABLE_LEVELS == 4
-static void kvm_set_pgd(pgd_t *pgdp, pgd_t pgd)
-{
-	kvm_mmu_write(pgdp, pgd_val(pgd));
-}
-#endif
-#endif /* PAGETABLE_LEVELS >= 3 */
-
-static void kvm_flush_tlb(void)
-{
-	struct kvm_mmu_op_flush_tlb ftlb = {
-		.header.op = KVM_MMU_OP_FLUSH_TLB,
-	};
-
-	kvm_deferred_mmu_op(&ftlb, sizeof ftlb);
-}
-
-static void kvm_release_pt(unsigned long pfn)
-{
-	struct kvm_mmu_op_release_pt rpt = {
-		.header.op = KVM_MMU_OP_RELEASE_PT,
-		.pt_phys = (u64)pfn << PAGE_SHIFT,
-	};
-
-	kvm_mmu_op(&rpt, sizeof rpt);
-}
-
-static void kvm_enter_lazy_mmu(void)
-{
-	paravirt_enter_lazy_mmu();
-}
-
-static void kvm_leave_lazy_mmu(void)
-{
-	struct kvm_para_state *state = kvm_para_state();
-
-	mmu_queue_flush(state);
-	paravirt_leave_lazy_mmu();
-}
-
 static void __init paravirt_ops_setup(void)
 {
 	pv_info.name = "KVM";
@@ -424,29 +266,6 @@
 	if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
 		pv_cpu_ops.io_delay = kvm_io_delay;

-	if (kvm_para_has_feature(KVM_FEATURE_MMU_OP)) {
-		pv_mmu_ops.set_pte = kvm_set_pte;
-		pv_mmu_ops.set_pte_at = kvm_set_pte_at;
-		pv_mmu_ops.set_pmd = kvm_set_pmd;
-#if PAGETABLE_LEVELS >= 3
-#ifdef CONFIG_X86_PAE
-		pv_mmu_ops.set_pte_atomic = kvm_set_pte_atomic;
-		pv_mmu_ops.pte_clear = kvm_pte_clear;
-		pv_mmu_ops.pmd_clear = kvm_pmd_clear;
-#endif
-		pv_mmu_ops.set_pud = kvm_set_pud;
-#if PAGETABLE_LEVELS == 4
-		pv_mmu_ops.set_pgd = kvm_set_pgd;
-#endif
-#endif
-		pv_mmu_ops.flush_tlb_user = kvm_flush_tlb;
-		pv_mmu_ops.release_pte = kvm_release_pt;
-		pv_mmu_ops.release_pmd = kvm_release_pt;
-		pv_mmu_ops.release_pud = kvm_release_pt;
-
-		pv_mmu_ops.lazy_mode.enter = kvm_enter_lazy_mmu;
-		pv_mmu_ops.lazy_mode.leave = kvm_leave_lazy_mmu;
-	}
 #ifdef CONFIG_X86_IO_APIC
 	no_timer_check = 1;
 #endif


ENH: Optimize array creation by avoiding errors

--- numpy/core/src/multiarray/common.c
+++ numpy/core/src/multiarray/common.c
@@ -38,7 +38,7 @@
  * This can be much faster then PyObject_GetAttrString where
  * exceptions are not used by caller.
  *
- * 'v' is the object to search for attribute.
+ * 'obj' is the object to search for attribute.
  *
  * 'name' is the attribute to search for.
  *


Add delegate

Add delegate

--- REPagedScrollView/REPagedScrollView.h
+++ REPagedScrollView/REPagedScrollView.h
@@ -31,6 +31,7 @@
 @property (strong, readonly, nonatomic) UIPageControl *pageControl;
 @property (assign, readonly, nonatomic) NSUInteger numberOfPages;
 @property (strong, readonly, nonatomic) NSArray *pages;
+@property (weak, readwrite, nonatomic) id<UIScrollViewDelegate> delegate;

 - (void)addPage:(UIView *)pageView;
 - (void)scrollToPageWithIndex:(NSUInteger)pageIndex animated:(BOOL)animated;


Veyron: Removing some stale tegra code

Veyron: Removing some stale tegra code

There's no point in having these delays, they're not applicable to Veyron.

BUG=None
TEST=Everything should work the same.
BRANCH=None

Change-Id: Icc2aebae1a497dd4f46579c23e36750feca6d67a
Signed-off-by: Alexandru M Stan <1784cbba6d7675b1eba55eaefe41c7672ad9da3b@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213248
Reviewed-by: Yung-chieh Lo <2d80bee8408e64f859a1b5868bd3b311c0a4b4cd@chromium.org>
Reviewed-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>

--- power/rockchip.c
+++ power/rockchip.c
@@ -53,19 +53,6 @@
 #define DELAY_FORCE_SHUTDOWN  (8 * SECOND)

 /*
- * The minimum time to assert the PMIC PWRON pin is 20ms.
- * Give it longer to ensure the PMIC doesn't lose it.
- */
-#define PMIC_PWRON_DEBOUNCE_TIME  (200 * MSEC * 3)
-
-/*
- * The minimum time to assert the PMIC THERM pin is 32us. However,
- * it needs to be extended to about 50ms to let the 5V rail
- * dissipate fully.
- */
-#define PMIC_THERM_HOLD_TIME  (50 * MSEC)
-
-/*
  * If the power key is pressed to turn on, then held for this long, we
  * power off.
  *
@@ -129,8 +116,6 @@

 /**
  * Set the PMIC PWREN signal.
- *
- * Note that asserting requires holding for PMIC_PWRON_DEBOUNCE_TIME.
  *
  * @param asserted	Assert (=1) or deassert (=0) the signal.
  */
@@ -183,7 +168,6 @@
 	now = get_time();
 	if (pressed) {
 		set_pmic_pwren(1);
-		usleep(PMIC_PWRON_DEBOUNCE_TIME);

 		if (!power_button_was_pressed) {
 			power_off_deadline.val = now.val + DELAY_FORCE_SHUTDOWN;
@@ -383,9 +367,8 @@
 	 * until AP running
 	 */
 	gpio_set_flags(GPIO_SPI1_NSS, GPIO_INPUT);
-	/* Push the power button */
+
 	set_pmic_pwren(1);
-	usleep(PMIC_PWRON_DEBOUNCE_TIME);
 	gpio_set_flags(GPIO_SPI1_NSS, GPIO_INPUT | GPIO_INT_BOTH
 			| GPIO_PULL_UP);
 	disable_sleep(SLEEP_MASK_AP_RUN);
@@ -445,8 +428,7 @@
 	lid_opened = 0;
 	enable_sleep(SLEEP_MASK_AP_RUN);
 	powerled_set_state(POWERLED_STATE_OFF);
-	/* Wait POWER GOOD pin to low */
-	usleep(PMIC_THERM_HOLD_TIME);
+
 	CPRINTS("power shutdown complete");
 }


nilfs2: fix regression that i-flag is not set on changeless checkpoints

According to the report from Jiro SEKIBA titled "regression in
2.6.37?"  (Message-Id: <8739n8vs1f.wl%jir@sekiba.com>), on 2.6.37 and
later kernels, lscp command no longer displays "i" flag on checkpoints
that snapshot operations or garbage collection created.

This is a regression of nilfs2 checkpointing function, and it's
critical since it broke behavior of a part of nilfs2 applications.
For instance, snapshot manager of TimeBrowse gets to create
meaningless snapshots continuously; snapshot creation triggers another
checkpoint, but applications cannot distinguish whether the new
checkpoint contains meaningful changes or not without the i-flag.

This patch fixes the regression and brings that application behavior
back to normal.

Reported-by: Jiro SEKIBA <5bf4ce6b1d16b8e72b3c064fd853f5e60cd6303c@unicus.jp>
Signed-off-by: Ryusuke Konishi <f414f2bdd839fdc054376382fa67e9bc2fbf206f@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <f414f2bdd839fdc054376382fa67e9bc2fbf206f@lab.ntt.co.jp>
Tested-by: Jiro SEKIBA <5bf4ce6b1d16b8e72b3c064fd853f5e60cd6303c@unicus.jp>
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>  [2.6.37]

--- fs/nilfs2/segment.c
+++ fs/nilfs2/segment.c
@@ -430,7 +430,8 @@
 	nilfs_segctor_map_segsum_entry(
 		sci, &sci->sc_binfo_ptr, sizeof(struct nilfs_finfo));

-	if (inode->i_sb && !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
+	if (NILFS_I(inode)->i_root &&
+	    !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
 		set_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags);
 	/* skip finfo */
 }


overageness

overageness


x86: fix cmos read and write to not use inb_p and outb_p

fix code to access CMOS rtc registers so that it does not use inb_p and
outb_p routines, which are deprecated.  Extensive research on all known
CMOS RTC chipset timing shows that there is no need for a delay in
accessing the registers of these chips even on old machines. These chipa
are never on an expansion bus, but have always been "motherboard"
resources, either in the processor chipset or explicitly on the
motherboard, and they are not part of the ISA/LPC or PCI buses, so
delays should not be based on bus timing. The reason to fix it:

 1) port 80 writes often hang some laptops that use ENE EC chipsets,
    esp. those designed and manufactured by Quanta for HP;

 2) RTC accesses are timing sensitive, and extra microseconds may matter;

 3) the new "io_delay" function is calibrated by expansion bus timing needs,
    thus is not appropriate for access to CMOS rtc registers.

Signed-off-by: David P. Reed <064ac42fd2aefa15c68bc2bab9ff068efff256ab@reed.com>
Acked-by: Alan Cox <91e38e63b890fbb214c8914809fde03c73e7f24d@redhat.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- arch/x86/kernel/rtc.c
+++ arch/x86/kernel/rtc.c
@@ -146,8 +146,8 @@
 	unsigned char val;

 	lock_cmos_prefix(addr);
-	outb_p(addr, RTC_PORT(0));
-	val = inb_p(RTC_PORT(1));
+	outb(addr, RTC_PORT(0));
+	val = inb(RTC_PORT(1));
 	lock_cmos_suffix(addr);
 	return val;
 }
@@ -156,8 +156,8 @@
 void rtc_cmos_write(unsigned char val, unsigned char addr)
 {
 	lock_cmos_prefix(addr);
-	outb_p(addr, RTC_PORT(0));
-	outb_p(val, RTC_PORT(1));
+	outb(addr, RTC_PORT(0));
+	outb(val, RTC_PORT(1));
 	lock_cmos_suffix(addr);
 }
 EXPORT_SYMBOL(rtc_cmos_write);


Stupid find and replace had failed so build also failed.

--- TrAnimate/TrCustomCurvedAnimation.h
+++ TrAnimate/TrCustomCurvedAnimation.h
@@ -75,36 +75,36 @@
 typedef double(^TrCurve)(double t);

 extern TrCurve const TrCurveLinear;
-extern TrCurve const `TrCurveEaseInQuad`;
-extern TrCurve const `TrCurveEaseOutQuad`;
-extern TrCurve const `TrCurveEaseInOutQuad`;
-extern TrCurve const `TrCurveEaseInCubic`;
-extern TrCurve const `TrCurveEaseOutCubic`;
-extern TrCurve const `TrCurveEaseInOutCubic`;
-extern TrCurve const `TrCurveEaseInQuart`;
-extern TrCurve const `TrCurveEaseOutQuart`;
-extern TrCurve const `TrCurveEaseInOutQuart`;
-extern TrCurve const `TrCurveEaseInQuint`;
-extern TrCurve const `TrCurveEaseOutQuint`;
-extern TrCurve const `TrCurveEaseInOutQuint`;
-extern TrCurve const `TrCurveEaseInSine`;
-extern TrCurve const `TrCurveEaseOutSine`;
-extern TrCurve const `TrCurveEaseInOutSine`;
-extern TrCurve const `TrCurveEaseInExpo`;
-extern TrCurve const `TrCurveEaseOutExpo`;
-extern TrCurve const `TrCurveEaseInOutExpo`;
-extern TrCurve const `TrCurveEaseInCirc`;
-extern TrCurve const `TrCurveEaseOutCirc`;
-extern TrCurve const `TrCurveEaseInOutCirc`;
-extern TrCurve const `TrCurveEaseInElastic`;
-extern TrCurve const `TrCurveEaseOutElastic`;
-extern TrCurve const `TrCurveEaseInOutElastic`;
-extern TrCurve const `TrCurveEaseInBack`;
-extern TrCurve const `TrCurveEaseOutBack`;
-extern TrCurve const `TrCurveEaseInOutBack`;
-extern TrCurve const `TrCurveEaseInBounce`;
-extern TrCurve const `TrCurveEaseOutBounce`;
-extern TrCurve const `TrCurveEaseInOutBounce`;
+extern TrCurve const TrCurveEaseInQuad;
+extern TrCurve const TrCurveEaseOutQuad;
+extern TrCurve const TrCurveEaseInOutQuad;
+extern TrCurve const TrCurveEaseInCubic;
+extern TrCurve const TrCurveEaseOutCubic;
+extern TrCurve const TrCurveEaseInOutCubic;
+extern TrCurve const TrCurveEaseInQuart;
+extern TrCurve const TrCurveEaseOutQuart;
+extern TrCurve const TrCurveEaseInOutQuart;
+extern TrCurve const TrCurveEaseInQuint;
+extern TrCurve const TrCurveEaseOutQuint;
+extern TrCurve const TrCurveEaseInOutQuint;
+extern TrCurve const TrCurveEaseInSine;
+extern TrCurve const TrCurveEaseOutSine;
+extern TrCurve const TrCurveEaseInOutSine;
+extern TrCurve const TrCurveEaseInExpo;
+extern TrCurve const TrCurveEaseOutExpo;
+extern TrCurve const TrCurveEaseInOutExpo;
+extern TrCurve const TrCurveEaseInCirc;
+extern TrCurve const TrCurveEaseOutCirc;
+extern TrCurve const TrCurveEaseInOutCirc;
+extern TrCurve const TrCurveEaseInElastic;
+extern TrCurve const TrCurveEaseOutElastic;
+extern TrCurve const TrCurveEaseInOutElastic;
+extern TrCurve const TrCurveEaseInBack;
+extern TrCurve const TrCurveEaseOutBack;
+extern TrCurve const TrCurveEaseInOutBack;
+extern TrCurve const TrCurveEaseInBounce;
+extern TrCurve const TrCurveEaseOutBounce;
+extern TrCurve const TrCurveEaseInOutBounce;

 /**
  *  A `CAKeyframeAnimation` subclass which support custom curves.


miiLa: Minor docs adjustment.

miiLa: Minor docs adjustment.

--- nx/include/switch/applets/mii_la.h
+++ nx/include/switch/applets/mii_la.h
@@ -29,7 +29,7 @@
 /// AppletOutput
 typedef struct {
     u32 res;                   ///< Result: 0 = Success, 1 = Cancel.
-    s32 index;                 ///< s32 Index. Only set when Result is Success, where \ref MiiLaAppletMode isn't ::NfpLaMiiLaAppletMode_ShowMiiEdit.
+    s32 index;                 ///< Index. Only set when Result is Success, where \ref MiiLaAppletMode isn't ::NfpLaMiiLaAppletMode_ShowMiiEdit.
     u8 unk_x8[0x18];           ///< Unused
 } MiiLaAppletOutput;


use signed char explicitly

use signed char explicitly

on some envs char is unsigned by default

--- vod/bit_read_stream.h
+++ vod/bit_read_stream.h
@@ -8,7 +8,7 @@
 typedef struct {
 	simple_read_stream_t stream;
 	u_char cur_byte;
-	char cur_bit;
+	signed char cur_bit;
 } bit_reader_state_t;

 // functions


Command/Observer for Optimizers that wrap vnl_optimizers.

error: pathspec 'Testing/Code/Algorithms/itkCommandVnlIterationUpdate.h' did not match any file(s) known to git

--- Testing/Code/Algorithms/itkCommandVnlIterationUpdate.h
+++ Testing/Code/Algorithms/itkCommandVnlIterationUpdate.h
@@ -0,0 +1,141 @@
+/*=========================================================================
+
+  Program:   Insight Segmentation & Registration Toolkit
+  Module:    itkCommandVnlIterationUpdate.h
+  Language:  C++
+  Date:      $Date$
+  Version:   $Revision$
+
+  Copyright (c) 2002 Insight Consortium. All rights reserved.
+  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
+
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef __itkCommandIterationUpdate_h
+#define __itkCommandIterationUpdate_h
+
+#include <itkCommand.h>
+#include "itkWeakPointer.h"
+
+namespace itk {
+
+/**
+ *  Implementation of the Command Pattern to be invoked every iteration
+ */
+template < class TOptimizer >
+class ITK_EXPORT CommandVnlIterationUpdate : public Command
+{
+public:
+  /**
+   * Standard "Self" typedef.
+   */
+  typedef CommandVnlIterationUpdate   Self;
+
+
+  /**
+   * Standard "Superclass" typedef.
+   */
+  typedef itk::Command  Superclass;
+
+
+  /**
+   * Smart pointer typedef support.
+   */
+  typedef itk::SmartPointer<Self>  Pointer;
+
+  /**
+   * ConstSmart pointer typedef support.
+   */
+  typedef itk::SmartPointer<const Self>  ConstPointer;
+
+  /**
+   * Execute method will print data at each iteration
+   */
+  void Execute(itk::Object *caller, const itk::EventObject & event)
+  {
+    Execute( (const itk::Object *)caller, event);
+  }
+
+  void Execute(const itk::Object *caller, const itk::EventObject & event)
+  {
+    if( typeid( event ) == typeid( itk::StartEvent ) )
+      {
+      std::cout << std::endl << "Position              Value";
+      std::cout << std::endl << std::endl;
+      }
+    else if( typeid( event ) == typeid( itk::IterationEvent ) )
+      {
+      std::cout << m_Optimizer->GetCurrentIteration() << " = ";
+      std::cout << m_Optimizer->GetCurrentPosition() << std::endl;
+      }
+    else if( typeid( event ) == typeid( itk::EndEvent ) )
+      {
+      std::cout << std::endl << std::endl;
+      std::cout << "After " << m_Optimizer->GetCurrentIteration();
+      std::cout << "  iterations " << std::endl;
+      std::cout << "Solution is    = " << m_Optimizer->GetCurrentPosition();
+      std::cout << std::endl;
+      std::cout << "vnl report = " << std::endl;
+      m_Optimizer->GetOptimizer()->diagnose_outcome( std::cout );
+      }
+
+  }
+
+
+  /**
+   * Run-time type information (and related methods).
+   */
+  itkTypeMacro( CommandVnlIterationUpdate, ::itk::Command );
+
+
+  /**
+   * Method for creation through the object factory.
+   */
+  itkNewMacro( Self );
+
+
+  /**
+   * Type defining the optimizer
+   */
+  typedef    TOptimizer     OptimizerType;
+
+
+  /**
+   * Set Optimizer
+   */
+  void SetOptimizer( OptimizerType * optimizer )
+    {
+    m_Optimizer = optimizer;
+    m_Optimizer->AddObserver( itk::IterationEvent(), this );
+    }
+
+
+
+protected:
+
+  /**
+   * Constructor
+   */
+  CommandVnlIterationUpdate() {};
+
+private:
+
+  /**
+   *  WeakPointer to the Optimizer
+   */
+  WeakPointer<OptimizerType>   m_Optimizer;
+
+
+
+};
+
+
+} // end namespace itk
+
+
+#endif
+


Corrected usage of image strides

Corrected usage of image strides

The function vp8_post_proc_down_and_across_c takes the
stride of both the src and dst images as parameters, but
assumes that they are the same.

I modified the code to use the correct strides, as the
assembler versions of these functions do.

Change-Id: I222715b774cd071b21c15a4b0d2f4aef64a520de

--- vp8/common/postproc.c
+++ vp8/common/postproc.c
@@ -143,9 +143,7 @@
     int col;
     int i;
     int v;
-    int pitch = src_pixels_per_line;
     unsigned char d[8];
-    (void)dst_pixels_per_line;

     for (row = 0; row < rows; row++)
     {
@@ -161,10 +159,10 @@

             for (i = -2; i <= 2; i++)
             {
-                if (abs(v - p_src[col+i*pitch]) > flimit)
+                if (abs(v - p_src[col+i*src_pixels_per_line]) > flimit)
                     goto down_skip_convolve;

-                kernel += kernel5[2+i] * p_src[col+i*pitch];
+                kernel += kernel5[2+i] * p_src[col+i*src_pixels_per_line];
             }

             v = (kernel >> 3);
@@ -211,10 +209,9 @@
         p_dst[col-2] = d[(col-2)&7];
         p_dst[col-1] = d[(col-1)&7];

-
         /* next row */
-        src_ptr += pitch;
-        dst_ptr += pitch;
+        src_ptr += src_pixels_per_line;
+        dst_ptr += dst_pixels_per_line;
     }
 }


<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">      <title>403 - Forbidden</title>
403 - Forbidden


Handle _NET_WM_WINDOW_TYPE_DIALOG

Handle _NET_WM_WINDOW_TYPE_DIALOG

--- xwinfo.c
+++ xwinfo.c
@@ -172,6 +172,8 @@
         printf("%s", "toolbar");
     else if (a == ewmh->_NET_WM_WINDOW_TYPE_MENU)
         printf("%s", "menu");
+    else if (a == ewmh->_NET_WM_WINDOW_TYPE_DIALOG)
+        printf("%s", "dialog");
     else if (a == ewmh->_NET_WM_WINDOW_TYPE_UTILITY)
         printf("%s", "utility");
     else if (a == ewmh->_NET_WM_WINDOW_TYPE_SPLASH)


Fix inet_ntop6

Fix inet_ntop6

--- nx/source/runtime/devices/socket.c
+++ nx/source/runtime/devices/socket.c
@@ -888,16 +888,17 @@
         //TuxSH:
         //sprintf(tp, "%x", words[i]);
         {
-            char *e = tp + 7;
-            memset(e, '0', 4);
+            char hexbuf[8];
+            char *e = hexbuf + 7;
             u_int word = words[i];
             while(word > 0) {
                 static const char digits[] = "0123456789abcdef";
                 *e-- = digits[word & 0xF];
                 word >>= 4;
             }
-        }
-        tp += strlen(tp);
+
+            memcpy(tp, e + 1, hexbuf + 8 - (e + 1));
+        }
     }
     /* Was it a trailing run of 0x00's? */
     if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))


fixed build with mac

fixed build with mac

--- seaslog.c
+++ seaslog.c
@@ -360,7 +360,7 @@
     return SUCCESS;
 }

-inline int seaslog_log_by_level_common_ex(int argc, int check_argc, char *level, int level_int, zval *messages, zval *content, char *logger_str, int logger_len, zend_class_entry *seaslog_ce TSRMLS_DC)
+static inline int seaslog_log_by_level_common_ex(int argc, int check_argc, char *level, int level_int, zval *messages, zval *content, char *logger_str, int logger_len, zend_class_entry *seaslog_ce TSRMLS_DC)
 {
     HashTable *msght;
     zval *pzval;


All zero coeff skip in IDCT 32x32

All zero coeff skip in IDCT 32x32

When all coefficients are zeros, skip the corresponding 1-D inverse
transform. This practice has been used in the SSE2 implementation of
inverse 32x32 DCT. This commit imports this algorithm into the C code.

Change-Id: I0f58bfcb183a569fab85d524d5d9cf8ae8653f86

--- vp9/common/vp9_idct.c
+++ vp9/common/vp9_idct.c
@@ -1253,7 +1253,20 @@

   // Rows
   for (i = 0; i < 32; ++i) {
-    idct32_1d(input, outptr);
+    int16_t zero_coeff[16];
+    for (j = 0; j < 16; ++j)
+      zero_coeff[j] = input[2 * j] | input[2 * j + 1];
+    for (j = 0; j < 8; ++j)
+      zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1];
+    for (j = 0; j < 4; ++j)
+      zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1];
+    for (j = 0; j < 2; ++j)
+      zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1];
+
+    if (zero_coeff[0] | zero_coeff[1])
+      idct32_1d(input, outptr);
+    else
+      vpx_memset(outptr, 0, sizeof(int16_t) * 32);
     input += 32;
     outptr += 32;
   }


resuspension

resuspension


And kill got_focus

And kill got_focus

--- scrotwm.c
+++ scrotwm.c
@@ -232,7 +232,6 @@
 	TAILQ_ENTRY(ws_win)	entry;
 	Window			id;
 	struct swm_geometry	g;
-	int			got_focus;
 	int			floating;
 	int			transient;
 	int			manual;
@@ -1144,7 +1143,6 @@
 	grabbuttons(win, 0);
 	XSetWindowBorder(display, win->id,
 	    win->ws->r->s->c[SWM_S_COLOR_UNFOCUS].color);
-	win->got_focus = 0;

 	if (win->ws->focus == win) {
 		win->ws->focus = NULL;
@@ -1179,12 +1177,9 @@
 	win->ws->focus = win;

 	if (win->ws->r != NULL) {
-		if (win->got_focus == 0) {
-			XSetWindowBorder(display, win->id,
-			    win->ws->r->s->c[SWM_S_COLOR_FOCUS].color);
-			grabbuttons(win, 1);
-		}
-		win->got_focus = 1;
+		XSetWindowBorder(display, win->id,
+		    win->ws->r->s->c[SWM_S_COLOR_FOCUS].color);
+		grabbuttons(win, 1);
 		XSetInputFocus(display, win->id,
 		    RevertToPointerRoot, CurrentTime);
 	}


fixed #58

fixed #58

--- seaslog.c
+++ seaslog.c
@@ -620,7 +620,7 @@
     return result;
 }

-static int get_detail(char *log_path, char *level, char *key_word, long start, long limit, long order, zval *return_value TSRMLS_DC)
+static int get_detail(char *log_path, char *level, char *key_word, long start, long end, long order, zval *return_value TSRMLS_DC)
 {
     FILE * fp;
     char buffer[BUFSIZ + 1];
@@ -657,13 +657,13 @@
 #ifdef WINDOWS
         spprintf(&sh, 0, "findstr \"%s\" %s | findstr \"%s\" ", level, path, key_word);
 #else
-        spprintf(&sh, 0, "%s 2>/dev/null| grep '%s' -w | grep '%s' -w | sed -n '%ld,%ld'p", command, level, key_word, start, limit);
+        spprintf(&sh, 0, "%s 2>/dev/null| grep '%s' -w | grep '%s' -w | sed -n '%ld,%ld'p", command, level, key_word, start, end);
 #endif
     } else {
 #ifdef WINDOWS
         spprintf(&sh, 0, "findstr \"%s\" %s", level, path);
 #else
-        spprintf(&sh, 0, "%s 2>/dev/null| grep '%s' -w | sed -n '%ld,%ld'p", command, level, start, limit);
+        spprintf(&sh, 0, "%s 2>/dev/null| grep '%s' -w | sed -n '%ld,%ld'p", command, level, start, end);
 #endif
     }

@@ -893,7 +893,7 @@
         level = "|";
     }

-    get_detail(log_path, level, key_word, start, limit, order, return_value TSRMLS_CC);
+    get_detail(log_path, level, key_word, start, start + limit, order, return_value TSRMLS_CC);
 }

 PHP_METHOD(SEASLOG_RES_NAME, getBuffer)


tame

tame


[PATCH] fs/partitions: Conversion to generic boolean

Conversion of booleans to: generic-boolean.patch (2006-08-23)

Signed-off-by: Richard Knutsson <06521f7b54a25177f76fb5734b6bf542e0498409@student.ltu.se>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- fs/partitions/ldm.c
+++ fs/partitions/ldm.c
@@ -30,11 +30,6 @@
 #include "check.h"
 #include "msdos.h"

-typedef enum {
-	FALSE = 0,
-	TRUE  = 1
-} BOOL;
-
 /**
  * ldm_debug/info/error/crit - Output an error message
  * @f:    A printf format string containing the message
@@ -103,24 +98,24 @@
  *
  * N.B. The GUID need not be NULL terminated.
  *
- * Return:  TRUE   @dest contains binary GUID
- *          FALSE  @dest contents are undefined
- */
-static BOOL ldm_parse_guid (const u8 *src, u8 *dest)
+ * Return:  'true'   @dest contains binary GUID
+ *          'false'  @dest contents are undefined
+ */
+static bool ldm_parse_guid (const u8 *src, u8 *dest)
 {
 	static const int size[] = { 4, 2, 2, 2, 6 };
 	int i, j, v;

 	if (src[8]  != '-' || src[13] != '-' ||
 	    src[18] != '-' || src[23] != '-')
-		return FALSE;
+		return false;

 	for (j = 0; j < 5; j++, src++)
 		for (i = 0; i < size[j]; i++, src+=2, *dest++ = v)
 			if ((v = ldm_parse_hexbyte (src)) < 0)
-				return FALSE;
-
-	return TRUE;
+				return false;
+
+	return true;
 }

@@ -132,17 +127,17 @@
  * This parses the LDM database PRIVHEAD structure supplied in @data and
  * sets up the in-memory privhead structure @ph with the obtained information.
  *
- * Return:  TRUE   @ph contains the PRIVHEAD data
- *          FALSE  @ph contents are undefined
- */
-static BOOL ldm_parse_privhead (const u8 *data, struct privhead *ph)
+ * Return:  'true'   @ph contains the PRIVHEAD data
+ *          'false'  @ph contents are undefined
+ */
+static bool ldm_parse_privhead (const u8 *data, struct privhead *ph)
 {
 	BUG_ON (!data || !ph);

 	if (MAGIC_PRIVHEAD != BE64 (data)) {
 		ldm_error ("Cannot find PRIVHEAD structure. LDM database is"
 			" corrupt. Aborting.");
-		return FALSE;
+		return false;
 	}

 	ph->ver_major          = BE16 (data + 0x000C);
@@ -155,7 +150,7 @@
 	if ((ph->ver_major != 2) || (ph->ver_minor != 11)) {
 		ldm_error ("Expected PRIVHEAD version %d.%d, got %d.%d."
 			" Aborting.", 2, 11, ph->ver_major, ph->ver_minor);
-		return FALSE;
+		return false;
 	}
 	if (ph->config_size != LDM_DB_SIZE) {	/* 1 MiB in sectors. */
 		/* Warn the user and continue, carefully */
@@ -166,16 +161,16 @@
 	if ((ph->logical_disk_size == 0) ||
 	    (ph->logical_disk_start + ph->logical_disk_size > ph->config_start)) {
 		ldm_error ("PRIVHEAD disk size doesn't match real disk size");
-		return FALSE;
+		return false;
 	}

 	if (!ldm_parse_guid (data + 0x0030, ph->disk_id)) {
 		ldm_error ("PRIVHEAD contains an invalid GUID.");
-		return FALSE;
+		return false;
 	}

 	ldm_debug ("Parsed PRIVHEAD successfully.");
-	return TRUE;
+	return true;
 }

 /**
@@ -189,16 +184,16 @@
  *
  * N.B.  The *_start and *_size values returned in @toc are not range-checked.
  *
- * Return:  TRUE   @toc contains the TOCBLOCK data
- *          FALSE  @toc contents are undefined
- */
-static BOOL ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
+ * Return:  'true'   @toc contains the TOCBLOCK data
+ *          'false'  @toc contents are undefined
+ */
+static bool ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
 {
 	BUG_ON (!data || !toc);

 	if (MAGIC_TOCBLOCK != BE64 (data)) {
 		ldm_crit ("Cannot find TOCBLOCK, database may be corrupt.");
-		return FALSE;
+		return false;
 	}
 	strncpy (toc->bitmap1_name, data + 0x24, sizeof (toc->bitmap1_name));
 	toc->bitmap1_name[sizeof (toc->bitmap1_name) - 1] = 0;
@@ -209,7 +204,7 @@
 			sizeof (toc->bitmap1_name)) != 0) {
 		ldm_crit ("TOCBLOCK's first bitmap is '%s', should be '%s'.",
 				TOC_BITMAP1, toc->bitmap1_name);
-		return FALSE;
+		return false;
 	}
 	strncpy (toc->bitmap2_name, data + 0x46, sizeof (toc->bitmap2_name));
 	toc->bitmap2_name[sizeof (toc->bitmap2_name) - 1] = 0;
@@ -219,10 +214,10 @@
 			sizeof (toc->bitmap2_name)) != 0) {
 		ldm_crit ("TOCBLOCK's second bitmap is '%s', should be '%s'.",
 				TOC_BITMAP2, toc->bitmap2_name);
-		return FALSE;
+		return false;
 	}
 	ldm_debug ("Parsed TOCBLOCK successfully.");
-	return TRUE;
+	return true;
 }

 /**
@@ -235,16 +230,16 @@
  *
  * N.B.  The *_start, *_size and *_seq values will be range-checked later.
  *
- * Return:  TRUE   @vm contains VMDB info
- *          FALSE  @vm contents are undefined
- */
-static BOOL ldm_parse_vmdb (const u8 *data, struct vmdb *vm)
+ * Return:  'true'   @vm contains VMDB info
+ *          'false'  @vm contents are undefined
+ */
+static bool ldm_parse_vmdb (const u8 *data, struct vmdb *vm)
 {
 	BUG_ON (!data || !vm);

 	if (MAGIC_VMDB != BE32 (data)) {
 		ldm_crit ("Cannot find the VMDB, database may be corrupt.");
-		return FALSE;
+		return false;
 	}

 	vm->ver_major = BE16 (data + 0x12);
@@ -252,7 +247,7 @@
 	if ((vm->ver_major != 4) || (vm->ver_minor != 10)) {
 		ldm_error ("Expected VMDB version %d.%d, got %d.%d. "
 			"Aborting.", 4, 10, vm->ver_major, vm->ver_minor);
-		return FALSE;
+		return false;
 	}

 	vm->vblk_size     = BE32 (data + 0x08);
@@ -260,7 +255,7 @@
 	vm->last_vblk_seq = BE32 (data + 0x04);

 	ldm_debug ("Parsed VMDB successfully.");
-	return TRUE;
+	return true;
 }

 /**
@@ -270,10 +265,10 @@
  *
  * This compares the two privhead structures @ph1 and @ph2.
  *
- * Return:  TRUE   Identical
- *          FALSE  Different
- */
-static BOOL ldm_compare_privheads (const struct privhead *ph1,
+ * Return:  'true'   Identical
+ *          'false'  Different
+ */
+static bool ldm_compare_privheads (const struct privhead *ph1,
 				   const struct privhead *ph2)
 {
 	BUG_ON (!ph1 || !ph2);
@@ -294,10 +289,10 @@
  *
  * This compares the two tocblock structures @toc1 and @toc2.
  *
- * Return:  TRUE   Identical
- *          FALSE  Different
- */
-static BOOL ldm_compare_tocblocks (const struct tocblock *toc1,
+ * Return:  'true'   Identical
+ *          'false'  Different
+ */
+static bool ldm_compare_tocblocks (const struct tocblock *toc1,
 				   const struct tocblock *toc2)
 {
 	BUG_ON (!toc1 || !toc2);
@@ -323,17 +318,17 @@
  * the configuration area (the database).  The values are range-checked against
  * @hd, which contains the real size of the disk.
  *
- * Return:  TRUE   Success
- *          FALSE  Error
- */
-static BOOL ldm_validate_privheads (struct block_device *bdev,
+ * Return:  'true'   Success
+ *          'false'  Error
+ */
+static bool ldm_validate_privheads (struct block_device *bdev,
 				    struct privhead *ph1)
 {
 	static const int off[3] = { OFF_PRIV1, OFF_PRIV2, OFF_PRIV3 };
 	struct privhead *ph[3] = { ph1 };
 	Sector sect;
 	u8 *data;
-	BOOL result = FALSE;
+	bool result = false;
 	long num_sects;
 	int i;

@@ -393,7 +388,7 @@
 		goto out;
 	}*/
 	ldm_debug ("Validated PRIVHEADs successfully.");
-	result = TRUE;
+	result = true;
 out:
 	kfree (ph[1]);
 	kfree (ph[2]);
@@ -411,10 +406,10 @@
  *
  * The offsets and sizes of the configs are range-checked against a privhead.
  *
- * Return:  TRUE   @toc1 contains validated TOCBLOCK info
- *          FALSE  @toc1 contents are undefined
- */
-static BOOL ldm_validate_tocblocks (struct block_device *bdev,
+ * Return:  'true'   @toc1 contains validated TOCBLOCK info
+ *          'false'  @toc1 contents are undefined
+ */
+static bool ldm_validate_tocblocks (struct block_device *bdev,
 	unsigned long base, struct ldmdb *ldb)
 {
 	static const int off[4] = { OFF_TOCB1, OFF_TOCB2, OFF_TOCB3, OFF_TOCB4};
@@ -422,7 +417,7 @@
 	struct privhead *ph;
 	Sector sect;
 	u8 *data;
-	BOOL result = FALSE;
+	bool result = false;
 	int i;

 	BUG_ON (!bdev || !ldb);
@@ -465,7 +460,7 @@
 	}

 	ldm_debug ("Validated TOCBLOCKs successfully.");
-	result = TRUE;
+	result = true;
 out:
 	kfree (tb[1]);
 	kfree (tb[2]);
@@ -482,15 +477,15 @@
  * Find the vmdb of the LDM Database stored on @bdev and return the parsed
  * information in @ldb.
  *
- * Return:  TRUE   @ldb contains validated VBDB info
- *          FALSE  @ldb contents are undefined
- */
-static BOOL ldm_validate_vmdb (struct block_device *bdev, unsigned long base,
+ * Return:  'true'   @ldb contains validated VBDB info
+ *          'false'  @ldb contents are undefined
+ */
+static bool ldm_validate_vmdb (struct block_device *bdev, unsigned long base,
 			       struct ldmdb *ldb)
 {
 	Sector sect;
 	u8 *data;
-	BOOL result = FALSE;
+	bool result = false;
 	struct vmdb *vm;
 	struct tocblock *toc;

@@ -502,7 +497,7 @@
 	data = read_dev_sector (bdev, base + OFF_VMDB, &sect);
 	if (!data) {
 		ldm_crit ("Disk read failed.");
-		return FALSE;
+		return false;
 	}

 	if (!ldm_parse_vmdb (data, vm))
@@ -527,7 +522,7 @@
 		goto out;
 	}

-	result = TRUE;
+	result = true;
 out:
 	put_dev_sector (sect);
 	return result;
@@ -547,23 +542,23 @@
  *       only likely to happen if the underlying device is strange.  If that IS
  *       the case we should return zero to let someone else try.
  *
- * Return:  TRUE   @bdev is a dynamic disk
- *          FALSE  @bdev is not a dynamic disk, or an error occurred
- */
-static BOOL ldm_validate_partition_table (struct block_device *bdev)
+ * Return:  'true'   @bdev is a dynamic disk
+ *          'false'  @bdev is not a dynamic disk, or an error occurred
+ */
+static bool ldm_validate_partition_table (struct block_device *bdev)
 {
 	Sector sect;
 	u8 *data;
 	struct partition *p;
 	int i;
-	BOOL result = FALSE;
+	bool result = false;

 	BUG_ON (!bdev);

 	data = read_dev_sector (bdev, 0, &sect);
 	if (!data) {
 		ldm_crit ("Disk read failed.");
-		return FALSE;
+		return false;
 	}

 	if (*(__le16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC))
@@ -572,7 +567,7 @@
 	p = (struct partition*)(data + 0x01BE);
 	for (i = 0; i < 4; i++, p++)
 		if (SYS_IND (p) == WIN2K_DYNAMIC_PARTITION) {
-			result = TRUE;
+			result = true;
 			break;
 		}

@@ -625,10 +620,10 @@
  * N.B.  This function creates the partitions in the order it finds partition
  *       objects in the linked list.
  *
- * Return:  TRUE   Partition created
- *          FALSE  Error, probably a range checking problem
- */
-static BOOL ldm_create_data_partitions (struct parsed_partitions *pp,
+ * Return:  'true'   Partition created
+ *          'false'  Error, probably a range checking problem
+ */
+static bool ldm_create_data_partitions (struct parsed_partitions *pp,
 					const struct ldmdb *ldb)
 {
 	struct list_head *item;
@@ -642,7 +637,7 @@
 	disk = ldm_get_disk_objid (ldb);
 	if (!disk) {
 		ldm_crit ("Can't find the ID of this disk in the database.");
-		return FALSE;
+		return false;
 	}

 	printk (" [LDM]");
@@ -661,7 +656,7 @@
 	}

 	printk ("\n");
-	return TRUE;
+	return true;
 }

@@ -766,10 +761,10 @@
  *
  * Read a raw VBLK Component object (version 3) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Component VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Component VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	int r_objid, r_name, r_vstate, r_child, r_parent, r_stripe, r_cols, len;
 	struct vblk_comp *comp;
@@ -792,11 +787,11 @@
 		len = r_parent;
 	}
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_CMP3;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	comp = &vb->vblk.comp;
 	ldm_get_vstr (buffer + 0x18 + r_name, comp->state,
@@ -806,7 +801,7 @@
 	comp->parent_id = ldm_get_vnum (buffer + 0x2D + r_child);
 	comp->chunksize = r_stripe ? ldm_get_vnum (buffer+r_parent+0x2E) : 0;

-	return TRUE;
+	return true;
 }

 /**
@@ -817,8 +812,8 @@
  *
  * Read a raw VBLK Disk Group object (version 3) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Disk Group VBLK
- *          FALSE  @vb contents are not defined
+ * Return:  'true'   @vb contains a Disk Group VBLK
+ *          'false'  @vb contents are not defined
  */
 static int ldm_parse_dgr3 (const u8 *buffer, int buflen, struct vblk *vb)
 {
@@ -841,16 +836,16 @@
 		len = r_diskid;
 	}
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_DGR3;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	dgrp = &vb->vblk.dgrp;
 	ldm_get_vstr (buffer + 0x18 + r_name, dgrp->disk_id,
 		sizeof (dgrp->disk_id));
-	return TRUE;
+	return true;
 }

 /**
@@ -861,10 +856,10 @@
  *
  * Read a raw VBLK Disk Group object (version 4) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Disk Group VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Disk Group VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	char buf[64];
 	int r_objid, r_name, r_id1, r_id2, len;
@@ -885,16 +880,16 @@
 		len = r_name;
 	}
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_DGR4;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	dgrp = &vb->vblk.dgrp;

 	ldm_get_vstr (buffer + 0x18 + r_objid, buf, sizeof (buf));
-	return TRUE;
+	return true;
 }

 /**
@@ -905,10 +900,10 @@
  *
  * Read a raw VBLK Disk object (version 3) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Disk VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_dsk3 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Disk VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_dsk3 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	int r_objid, r_name, r_diskid, r_altname, len;
 	struct vblk_disk *disk;
@@ -921,19 +916,19 @@
 	r_altname = ldm_relative (buffer, buflen, 0x18, r_diskid);
 	len = r_altname;
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_DSK3;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	disk = &vb->vblk.disk;
 	ldm_get_vstr (buffer + 0x18 + r_diskid, disk->alt_name,
 		sizeof (disk->alt_name));
 	if (!ldm_parse_guid (buffer + 0x19 + r_name, disk->disk_id))
-		return FALSE;
-
-	return TRUE;
+		return false;
+
+	return true;
 }

 /**
@@ -944,10 +939,10 @@
  *
  * Read a raw VBLK Disk object (version 4) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Disk VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Disk VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	int r_objid, r_name, len;
 	struct vblk_disk *disk;
@@ -958,15 +953,15 @@
 	r_name  = ldm_relative (buffer, buflen, 0x18, r_objid);
 	len     = r_name;
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_DSK4;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	disk = &vb->vblk.disk;
 	memcpy (disk->disk_id, buffer + 0x18 + r_name, GUID_SIZE);
-	return TRUE;
+	return true;
 }

 /**
@@ -977,10 +972,10 @@
  *
  * Read a raw VBLK Partition object (version 3) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Partition VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_prt3 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Partition VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_prt3 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	int r_objid, r_name, r_size, r_parent, r_diskid, r_index, len;
 	struct vblk_part *part;
@@ -1001,11 +996,11 @@
 		len = r_diskid;
 	}
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_PRT3;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	part = &vb->vblk.part;
 	part->start         = BE64         (buffer + 0x24 + r_name);
@@ -1018,7 +1013,7 @@
 	else
 		part->partnum = 0;

-	return TRUE;
+	return true;
 }

 /**
@@ -1029,10 +1024,10 @@
  *
  * Read a raw VBLK Volume object (version 5) into a vblk structure.
  *
- * Return:  TRUE   @vb contains a Volume VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_vol5 (const u8 *buffer, int buflen, struct vblk *vb)
+ * Return:  'true'   @vb contains a Volume VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_vol5 (const u8 *buffer, int buflen, struct vblk *vb)
 {
 	int r_objid, r_name, r_vtype, r_child, r_size, r_id1, r_id2, r_size2;
 	int r_drive, len;
@@ -1068,11 +1063,11 @@

 	len = r_drive;
 	if (len < 0)
-		return FALSE;
+		return false;

 	len += VBLK_SIZE_VOL5;
 	if (len != BE32 (buffer + 0x14))
-		return FALSE;
+		return false;

 	volu = &vb->vblk.volu;

@@ -1087,7 +1082,7 @@
 		ldm_get_vstr (buffer + 0x53 + r_size,  volu->drive_hint,
 			sizeof (volu->drive_hint));
 	}
-	return TRUE;
+	return true;
 }

 /**
@@ -1100,12 +1095,12 @@
  * information common to all VBLK types, then delegates the rest of the work to
  * helper functions: ldm_parse_*.
  *
- * Return:  TRUE   @vb contains a VBLK
- *          FALSE  @vb contents are not defined
- */
-static BOOL ldm_parse_vblk (const u8 *buf, int len, struct vblk *vb)
-{
-	BOOL result = FALSE;
+ * Return:  'true'   @vb contains a VBLK
+ *          'false'  @vb contents are not defined
+ */
+static bool ldm_parse_vblk (const u8 *buf, int len, struct vblk *vb)
+{
+	bool result = false;
 	int r_objid;

 	BUG_ON (!buf || !vb);
@@ -1113,7 +1108,7 @@
 	r_objid = ldm_relative (buf, len, 0x18, 0);
 	if (r_objid < 0) {
 		ldm_error ("VBLK header is corrupt.");
-		return FALSE;
+		return false;
 	}

 	vb->flags  = buf[0x12];
@@ -1152,10 +1147,10 @@
  *
  * N.B.  This function does not check the validity of the VBLKs.
  *
- * Return:  TRUE   The VBLK was added
- *          FALSE  An error occurred
- */
-static BOOL ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb)
+ * Return:  'true'   The VBLK was added
+ *          'false'  An error occurred
+ */
+static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb)
 {
 	struct vblk *vb;
 	struct list_head *item;
@@ -1165,12 +1160,12 @@
 	vb = kmalloc (sizeof (*vb), GFP_KERNEL);
 	if (!vb) {
 		ldm_crit ("Out of memory.");
-		return FALSE;
+		return false;
 	}

 	if (!ldm_parse_vblk (data, len, vb)) {
 		kfree(vb);
-		return FALSE;			/* Already logged */
+		return false;			/* Already logged */
 	}

 	/* Put vblk into the correct list. */
@@ -1196,13 +1191,13 @@
 			if ((v->vblk.part.disk_id == vb->vblk.part.disk_id) &&
 			    (v->vblk.part.start > vb->vblk.part.start)) {
 				list_add_tail (&vb->list, &v->list);
-				return TRUE;
+				return true;
 			}
 		}
 		list_add_tail (&vb->list, &ldb->v_part);
 		break;
 	}
-	return TRUE;
+	return true;
 }

 /**
@@ -1214,10 +1209,10 @@
  * Fragmented VBLKs may not be consecutive in the database, so they are placed
  * in a list so they can be pieced together later.
  *
- * Return:  TRUE   Success, the VBLK was added to the list
- *          FALSE  Error, a problem occurred
- */
-static BOOL ldm_frag_add (const u8 *data, int size, struct list_head *frags)
+ * Return:  'true'   Success, the VBLK was added to the list
+ *          'false'  Error, a problem occurred
+ */
+static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
 {
 	struct frag *f;
 	struct list_head *item;
@@ -1230,7 +1225,7 @@
 	num   = BE16 (data + 0x0E);
 	if ((num < 1) || (num > 4)) {
 		ldm_error ("A VBLK claims to have %d parts.", num);
-		return FALSE;
+		return false;
 	}

 	list_for_each (item, frags) {
@@ -1242,7 +1237,7 @@
 	f = kmalloc (sizeof (*f) + size*num, GFP_KERNEL);
 	if (!f) {
 		ldm_crit ("Out of memory.");
-		return FALSE;
+		return false;
 	}

 	f->group = group;
@@ -1255,7 +1250,7 @@
 	if (f->map & (1 << rec)) {
 		ldm_error ("Duplicate VBLK, part %d.", rec);
 		f->map &= 0x7F;			/* Mark the group as broken */
-		return FALSE;
+		return false;
 	}

 	f->map |= (1 << rec);
@@ -1266,7 +1261,7 @@
 	}
 	memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size);

-	return TRUE;
+	return true;
 }

 /**
@@ -1295,10 +1290,10 @@
  * Now that all the fragmented VBLKs have been collected, they must be added to
  * the database for later use.
  *
- * Return:  TRUE   All the fragments we added successfully
- *          FALSE  One or more of the fragments we invalid
- */
-static BOOL ldm_frag_commit (struct list_head *frags, struct ldmdb *ldb)
+ * Return:  'true'   All the fragments we added successfully
+ *          'false'  One or more of the fragments we invalid
+ */
+static bool ldm_frag_commit (struct list_head *frags, struct ldmdb *ldb)
 {
 	struct frag *f;
 	struct list_head *item;
@@ -1311,13 +1306,13 @@
 		if (f->map != 0xFF) {
 			ldm_error ("VBLK group %d is incomplete (0x%02x).",
 				f->group, f->map);
-			return FALSE;
+			return false;
 		}

 		if (!ldm_ldmdb_add (f->data, f->num*ldb->vm.vblk_size, ldb))
-			return FALSE;		/* Already logged */
-	}
-	return TRUE;
+			return false;		/* Already logged */
+	}
+	return true;
 }

 /**
@@ -1329,16 +1324,16 @@
  * To use the information from the VBLKs, they need to be read from the disk,
  * unpacked and validated.  We cache them in @ldb according to their type.
  *
- * Return:  TRUE   All the VBLKs were read successfully
- *          FALSE  An error occurred
- */
-static BOOL ldm_get_vblks (struct block_device *bdev, unsigned long base,
+ * Return:  'true'   All the VBLKs were read successfully
+ *          'false'  An error occurred
+ */
+static bool ldm_get_vblks (struct block_device *bdev, unsigned long base,
 			   struct ldmdb *ldb)
 {
 	int size, perbuf, skip, finish, s, v, recs;
 	u8 *data = NULL;
 	Sector sect;
-	BOOL result = FALSE;
+	bool result = false;
 	LIST_HEAD (frags);

 	BUG_ON (!bdev || !ldb);


Minor correction for the DPI...

Minor correction for the DPI...

--- src/siege/graphics/font.c
+++ src/siege/graphics/font.c
@@ -362,7 +362,7 @@

     font->npreload = preload;

-    _sgFontSetHeight(font, height, dpi);
+    _sgFontSetHeight(font, height, dpi ? dpi : 96);
     _sgFontCreateCache(font);

     return font;
@@ -375,7 +375,7 @@
         fprintf(stderr, "Warning: Cannot create font %s\n", fname);
         return NULL;
     }
-    return sgFontCreateStream(stream, SG_TRUE, height, dpi ? dpi : 96, preload);
+    return sgFontCreateStream(stream, SG_TRUE, height, dpi, preload);
 }
 void SG_EXPORT sgFontDestroy(SGFont* font)
 {


Add Version to mod shift v

Add Version to mod shift v

--- scrotwm.c
+++ scrotwm.c
@@ -912,7 +912,8 @@
 {
 	bar_version = !bar_version;
 	if (bar_version)
-		strlcpy(bar_vertext, cvstag, sizeof bar_vertext);
+		snprintf(bar_vertext, sizeof bar_vertext, "Version: %s CVS: %s",
+		    SWM_VERSION, cvstag);
 	else
 		strlcpy(bar_vertext, "", sizeof bar_vertext);
 	bar_update();


Fix bug

Fix bug

fix redefinition of ClassForVlistCache

--- Database/Database.h
+++ Database/Database.h
@@ -24,7 +24,6 @@
 #include "../Parser/RDFParser.h"
 #include "../Parser/SparqlParser.h"
 #include "../Query/GeneralEvaluation.h"
-#include "../Util/ClassForVlistCache.h"

 class Database
 {


[NbtkGrid] Set grid reactive when initialising

Otherwise the grid does not receive scroll events, preventing the
scroll-wheel support from working.

Fixes: MB:#1894

--- nbtk/nbtk-grid.c
+++ nbtk/nbtk-grid.c
@@ -492,6 +492,8 @@
   NbtkGridPrivate *priv;

   self->priv = priv = NBTK_GRID_GET_PRIVATE (self);
+
+  clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);

   /* do not unref in the hashtable, the reference is for now kept by the list
    * (double bookkeeping sucks)


Adjust initialization of xdg_surface

Adjust initialization of xdg_surface

--- src/compositor/wayland/xdg_surface.c
+++ src/compositor/wayland/xdg_surface.c
@@ -357,21 +357,15 @@
         return NULL;
     }

-    int retval = ws_wayland_obj_init(&self->shell.wl_obj, resource);
+    int retval;
+    retval = ws_abstract_shell_surface_init(&self->shell, resource, surface,
+                                            &xdg_surface_interface);
     if (retval < 0) {
         goto cleanup;
         return NULL;
     }

     wl_resource_set_implementation(resource, &interface, self, NULL);
-
-    self->shell.surface = surface;
-
-    int ret = ws_surface_set_role(self->shell.surface, &xdg_surface_interface);
-
-    if (ret < 0) {
-        goto cleanup;
-    }

     return self;
 cleanup:


memcg: fix mapcount check in move charge code for anonymous page

Currently the charge on shared anonyous pages is supposed not to moved in
task migration.  To implement this, we need to check that mapcount > 1,
instread of > 2.  So this patch fixes it.

Signed-off-by: Naoya Horiguchi <8e7a128cd0264d3269a891fb3e87507c2985f8af@ah.jp.nec.com>
Reviewed-by: Daisuke Nishimura <d7ce9d9454f80efacebffaaa82023b8c983997f5@mxp.nes.nec.co.jp>
Cc: Andrea Arcangeli <6cb163d975a8c4c46420677e0054b55c39bdb339@redhat.com>
Cc: KAMEZAWA Hiroyuki <634f508bd7c47cf0ee4126243675c3e598920fbc@jp.fujitsu.com>
Cc: Hillf Danton <74636c4e14be88f42bc2a57784d7913ef47ac9b0@gmail.com>
Cc: Johannes Weiner <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@cmpxchg.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- mm/memcontrol.c
+++ mm/memcontrol.c
@@ -5075,7 +5075,7 @@
 		return NULL;
 	if (PageAnon(page)) {
 		/* we don't move shared anon */
-		if (!move_anon() || page_mapcount(page) > 2)
+		if (!move_anon() || page_mapcount(page) > 1)
 			return NULL;
 	} else if (!move_file())
 		/* we ignore mapcount for file pages */


shortchange

shortchange


C cloud client demo: Clarified doc strings and fixed some typos (#297)

--- clients/cloud/c/producer.c
+++ clients/cloud/c/producer.c
@@ -28,9 +28,9 @@

 /**
  * @brief Delivery report callback, triggered by from poll() or flush()
- *        once for message to propagate its final delivery status.
+ *        once for each produce():ed message to propagate its final delivery status.
  *
- *        A non-zero \c rkmessage->err indicates delivery failed.
+ *        A non-zero \c rkmessage->err indicates delivery failed permanently.
  */
 static void dr_cb (rd_kafka_t *rk,
                    const rd_kafka_message_t *rkmessage, void *opaque) {
@@ -109,7 +109,7 @@
                         RD_KAFKA_V_VALUE(json, strlen(json)),
                         /* producev() will make a copy of the message
                          * value (the key is always copied), so we
-                         * cam reuse the same json buffer on the
+                         * can reuse the same json buffer on the
                          * next iteration. */
                         RD_KAFKA_V_MSGFLAGS(RD_KAFKA_MSG_F_COPY),
                         RD_KAFKA_V_OPAQUE(&delivery_counter),
@@ -121,7 +121,7 @@
                 }

                 /* Poll for delivery report callbacks to know the final
-                 * delivery status of of previously produced messages. */
+                 * delivery status of previously produced messages. */
                 rd_kafka_poll(rk, 0);
         }


Allow spaces in chrondor entries

Allow spaces in chrondor entries

--- src/condor_c++_util/condor_crontab.h
+++ src/condor_c++_util/condor_crontab.h
@@ -94,6 +94,7 @@
 									CRONTAB_RANGE \
 									CRONTAB_STEP \
 									CRONTAB_WILDCARD \
+									"\\ " \
 									"\\/*]"

 /**