Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 22,33 ****
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <fs/fs_subr.h>
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/kmem.h>
--- 22,31 ----
*** 251,261 ****
/*
* No need for the lock, no other thread can be accessing
* this data structure.
*/
! atomic_add_32(&sft->sharefs_refs, 1);
sft->sharefs_real_vp = 0;
/*
* Since the sharetab could easily change on us whilst we
* are dumping an extremely huge sharetab, we make a copy
--- 249,259 ----
/*
* No need for the lock, no other thread can be accessing
* this data structure.
*/
! atomic_inc_32(&sft->sharefs_refs);
sft->sharefs_real_vp = 0;
/*
* Since the sharetab could easily change on us whilst we
* are dumping an extremely huge sharetab, we make a copy
*** 283,293 ****
sft->sharefs_size = 0;
sft->sharefs_snap = NULL;
sft->sharefs_generation = 0;
}
}
! atomic_add_32(&sft->sharefs_refs, -1);
rw_exit(&sharefs_lock);
return (0);
}
--- 281,291 ----
sft->sharefs_size = 0;
sft->sharefs_snap = NULL;
sft->sharefs_generation = 0;
}
}
! atomic_dec_32(&sft->sharefs_refs);
rw_exit(&sharefs_lock);
return (0);
}