affs-for-5.5-tag
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE8rQSAMVO+zA4DBdWxWXV+ddtWDsFAl3YC+sACgkQxWXV+ddt WDtcJg/+JESwug/t+8+JWoajhwcMtLcQqqdPIWcfGq+9S7kIcKeoNtboO9Axj8d7 rxubmkk9zHEVgQtA5TWW9kdnNBjTnslHvCvD6m7g6AJGtiNdOofbc/2EaEmDP05f 6N7ZBOQ+l8jwgeZqRO2H2/Xh+Le9pjchhljcRgJ0eVVgPklSh5e4KrWkqOb4UwCm iZCHXPB8AeLxTfGL1yy5wklh4nKZF3DMDaT7+20YyKzNtJjmbS/2WPivr9uWd25D QHUeHk+yOJoRICAX4/8xFk+x7FLJTutfAsvwJM90a5+HR2/msyC7ahzIYguPBtaX Aa5hlP79ug6UhtB9RIUULjZiBYQS38qhlEmAE7RA4/sYFzbm6AkSQTnOxBennivN 2+ev64xeDEKNx//pWM52OHyWuDJbGBeBMdr4I8LtYEoyBgQC5kDnecodV81q9c79 ROTBmjP9gQFxkk3OoP44haky6t3HPqN/jCfFOvo0VxbEyVluRS1BZQ5+IjZIgSFU Zg5L9OHA93+PsZsNnas9Zd07YuMBXK3X4g//veWmY/eWursC6cn3IGhsGlxl0X1a g07jiZCLElmKV66UTdKqn+ByV1n0TreAjSn1Wr3NtYuBiqTAKh0xrbMlbE6n1db7 z+yKBRlcGBVvQQpI0AZB29aeeleNvDGDLuz+hE8K4rFFUCUb1zs= =NomJ -----END PGP SIGNATURE----- Merge tag 'affs-for-5.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull AFFS updates from David Sterba: "A minor bugfix and cleanup for AFFS" * tag 'affs-for-5.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: affs: fix a memory leak in affs_remount affs: Replace binary semaphores with mutexes
This commit is contained in:
commit
ae36607b66
@ -43,8 +43,8 @@ struct affs_ext_key {
|
||||
*/
|
||||
struct affs_inode_info {
|
||||
atomic_t i_opencnt;
|
||||
struct semaphore i_link_lock; /* Protects internal inode access. */
|
||||
struct semaphore i_ext_lock; /* Protects internal inode access. */
|
||||
struct mutex i_link_lock; /* Protects internal inode access. */
|
||||
struct mutex i_ext_lock; /* Protects internal inode access. */
|
||||
#define i_hash_lock i_ext_lock
|
||||
u32 i_blkcnt; /* block count */
|
||||
u32 i_extcnt; /* extended block count */
|
||||
@ -293,30 +293,30 @@ affs_adjust_bitmapchecksum(struct buffer_head *bh, u32 val)
|
||||
static inline void
|
||||
affs_lock_link(struct inode *inode)
|
||||
{
|
||||
down(&AFFS_I(inode)->i_link_lock);
|
||||
mutex_lock(&AFFS_I(inode)->i_link_lock);
|
||||
}
|
||||
static inline void
|
||||
affs_unlock_link(struct inode *inode)
|
||||
{
|
||||
up(&AFFS_I(inode)->i_link_lock);
|
||||
mutex_unlock(&AFFS_I(inode)->i_link_lock);
|
||||
}
|
||||
static inline void
|
||||
affs_lock_dir(struct inode *inode)
|
||||
{
|
||||
down(&AFFS_I(inode)->i_hash_lock);
|
||||
mutex_lock_nested(&AFFS_I(inode)->i_hash_lock, SINGLE_DEPTH_NESTING);
|
||||
}
|
||||
static inline void
|
||||
affs_unlock_dir(struct inode *inode)
|
||||
{
|
||||
up(&AFFS_I(inode)->i_hash_lock);
|
||||
mutex_unlock(&AFFS_I(inode)->i_hash_lock);
|
||||
}
|
||||
static inline void
|
||||
affs_lock_ext(struct inode *inode)
|
||||
{
|
||||
down(&AFFS_I(inode)->i_ext_lock);
|
||||
mutex_lock(&AFFS_I(inode)->i_ext_lock);
|
||||
}
|
||||
static inline void
|
||||
affs_unlock_ext(struct inode *inode)
|
||||
{
|
||||
up(&AFFS_I(inode)->i_ext_lock);
|
||||
mutex_unlock(&AFFS_I(inode)->i_ext_lock);
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ static void init_once(void *foo)
|
||||
{
|
||||
struct affs_inode_info *ei = (struct affs_inode_info *) foo;
|
||||
|
||||
sema_init(&ei->i_link_lock, 1);
|
||||
sema_init(&ei->i_ext_lock, 1);
|
||||
mutex_init(&ei->i_link_lock);
|
||||
mutex_init(&ei->i_ext_lock);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
@ -561,14 +561,9 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
||||
int root_block;
|
||||
unsigned long mount_flags;
|
||||
int res = 0;
|
||||
char *new_opts;
|
||||
char volume[32];
|
||||
char *prefix = NULL;
|
||||
|
||||
new_opts = kstrdup(data, GFP_KERNEL);
|
||||
if (data && !new_opts)
|
||||
return -ENOMEM;
|
||||
|
||||
pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data);
|
||||
|
||||
sync_filesystem(sb);
|
||||
@ -579,7 +574,6 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
||||
&blocksize, &prefix, volume,
|
||||
&mount_flags)) {
|
||||
kfree(prefix);
|
||||
kfree(new_opts);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user