| 
									
										
										
										
											2006-03-26 01:39:16 -08:00
										 |  |  | #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
 | 
					
						
							|  |  |  | #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-07-26 16:09:04 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Spinlock based version of ext2 atomic bitops | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-26 01:39:16 -08:00
										 |  |  | #define ext2_set_bit_atomic(lock, nr, addr)		\
 | 
					
						
							|  |  |  | 	({						\ | 
					
						
							|  |  |  | 		int ret;				\ | 
					
						
							|  |  |  | 		spin_lock(lock);			\ | 
					
						
							| 
									
										
										
										
											2011-03-23 16:42:04 -07:00
										 |  |  | 		ret = __test_and_set_bit_le(nr, addr);	\ | 
					
						
							| 
									
										
										
										
											2006-03-26 01:39:16 -08:00
										 |  |  | 		spin_unlock(lock);			\ | 
					
						
							|  |  |  | 		ret;					\ | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define ext2_clear_bit_atomic(lock, nr, addr)		\
 | 
					
						
							|  |  |  | 	({						\ | 
					
						
							|  |  |  | 		int ret;				\ | 
					
						
							|  |  |  | 		spin_lock(lock);			\ | 
					
						
							| 
									
										
										
										
											2011-03-23 16:42:04 -07:00
										 |  |  | 		ret = __test_and_clear_bit_le(nr, addr);	\ | 
					
						
							| 
									
										
										
										
											2006-03-26 01:39:16 -08:00
										 |  |  | 		spin_unlock(lock);			\ | 
					
						
							|  |  |  | 		ret;					\ | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */
 |