#include "mtdcore.h"
-static DEFINE_MUTEX(mtd_blkdevs_mutex);
static LIST_HEAD(blktrans_majors);
static DEFINE_MUTEX(blktrans_ref_mutex);
if (!dev)
return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
- mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock);
if (dev->open++)
unlock:
mutex_unlock(&dev->lock);
blktrans_dev_put(dev);
- mutex_unlock(&mtd_blkdevs_mutex);
return ret;
}
if (!dev)
return ret;
- mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock);
if (--dev->open)
unlock:
mutex_unlock(&dev->lock);
blktrans_dev_put(dev);
- mutex_unlock(&mtd_blkdevs_mutex);
return ret;
}
if (!dev)
return ret;
- mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock);
if (!dev->mtd)
}
unlock:
mutex_unlock(&dev->lock);
- mutex_unlock(&mtd_blkdevs_mutex);
blktrans_dev_put(dev);
return ret;
}