Subject: Re: p_flag in struct proc: int -> uint64_t
To: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 10/10/2006 08:20:38
On Oct 10, 2006, at 2:46 AM, Juergen Hannken-Illjes wrote:

> On Mon, Oct 09, 2006 at 03:45:28PM -0700, Jason Thorpe wrote:
>>
>> On Oct 9, 2006, at 1:43 AM, Juergen Hannken-Illjes wrote:
>>
>>> The latter.  Call xxx_set() and xxx_get() with locks held.
>>
>> For setspecific, I could add a setspecific_nowait, but I'm concerned
>> about what the failure mode is supposed to be if it were to fail...
>> would you unwind your state, and try to set the data some other way,
>> or would you fail the operation in some fashion?
>
> I will fail like this:

Right, but what are the implications of fstrans_start() failing?  Is  
it possible for you to unwind and recover from THAT situation, and  
restart the transaction?

>
>   int
>   fstrans_start(struct mount *mp, int flags)
>   {
> 	int error;
> 	struct fstrans_state *fts;
>
> 	if ((fts = lwp_getspecific(curlwp, fstrans_state_key)) == NULL) {
> 		if ((flags & FSTRANS_NOWAIT) != 0) {
> 			if ((fts = pool_get(&fstrans_spl, PR_NOWAIT)) == NULL)
> 				return EWOULDBLOCK;
> 			if ((error = lwp_setspecific_nowait(curlwp,
> 			    fstrans_state_key, fts)) != 0) {
> 				pool_put(&fstrans_spl, fts);
> 				return error;
> 			}
> 		} else {
> 			fts = pool_get(&fstrans_spl, 0);
> 			lwp_setspecific(curlwp, fstrans_state_key, fts);
> 		}
> 		init_state(fts);
> 	}
> 	...
>   }
>
> -- 
> Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig  
> (Germany)

-- thorpej