struct vfsmount *fo_vfsmnt;
int fo_group_count;
- struct dentry *fo_dentry_O; /* the "O"bject directory dentry */
- struct dentry **fo_groups; /* dentries for each group dir */
- struct filter_subdirs *fo_subdirs; /* subdir array per group */
- __u64 *fo_last_objids; // per-group last created objid
+ struct dentry *fo_dentry_O; /* the "O"bject directory dentry */
+ struct dentry **fo_groups; /* dentries for each group dir */
+ struct filter_subdirs *fo_subdirs; /* subdir array per group */
+ __u64 *fo_last_objids; /* per-group last created objid */
struct file **fo_last_objid_files;
+ struct semaphore fo_init_lock; /* group initialization lock */
spinlock_t fo_objidlock; /* protect fo_lastobjid increment */
spinlock_t fo_translock; /* protect fsd_last_rcvd increment */
int create)
{
struct filter_obd *filter = &obd->u.filter;
- int old_count = filter->fo_group_count, group = old_count, rc = 0;
+ int old_count, group, rc = 0;
+ down(&filter->fo_init_lock);
+ old_count = filter->fo_group_count;
for (group = old_count; group <= last_group; group++) {
if (group == 0)
continue; /* no group zero */
if (rc != 0)
break;
}
+ up(&filter->fo_init_lock);
return rc;
}
if (rc)
GOTO(err_mntput, rc);
+ sema_init(&filter->fo_init_lock, 1);
rc = filter_prep(obd);
if (rc)
GOTO(err_mntput, rc);
-
filter->fo_destroy_in_progress = 0;
sema_init(&filter->fo_create_lock, 1);