Commit 6b9438e1 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

[PATCH] fat_lock is used as a mutex, convert it to using the new mutex primitive

The fat code uses the fat_lock always in a mutex way (taking and releasing
the lock in the same function), the patch below converts it into the new
mutex primitive.  Please consider this patch for the code.
Signed-off-by: default avatarArjan van de Ven <arjan@infradead.org>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f82945df
...@@ -267,19 +267,19 @@ static struct fatent_operations fat32_ops = { ...@@ -267,19 +267,19 @@ static struct fatent_operations fat32_ops = {
static inline void lock_fat(struct msdos_sb_info *sbi) static inline void lock_fat(struct msdos_sb_info *sbi)
{ {
down(&sbi->fat_lock); mutex_lock(&sbi->fat_lock);
} }
static inline void unlock_fat(struct msdos_sb_info *sbi) static inline void unlock_fat(struct msdos_sb_info *sbi)
{ {
up(&sbi->fat_lock); mutex_unlock(&sbi->fat_lock);
} }
void fat_ent_access_init(struct super_block *sb) void fat_ent_access_init(struct super_block *sb)
{ {
struct msdos_sb_info *sbi = MSDOS_SB(sb); struct msdos_sb_info *sbi = MSDOS_SB(sb);
init_MUTEX(&sbi->fat_lock); mutex_init(&sbi->fat_lock);
switch (sbi->fat_bits) { switch (sbi->fat_bits) {
case 32: case 32:
......
...@@ -184,6 +184,7 @@ struct fat_slot_info { ...@@ -184,6 +184,7 @@ struct fat_slot_info {
#include <linux/string.h> #include <linux/string.h>
#include <linux/nls.h> #include <linux/nls.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mutex.h>
struct fat_mount_options { struct fat_mount_options {
uid_t fs_uid; uid_t fs_uid;
...@@ -226,7 +227,7 @@ struct msdos_sb_info { ...@@ -226,7 +227,7 @@ struct msdos_sb_info {
unsigned long max_cluster; /* maximum cluster number */ unsigned long max_cluster; /* maximum cluster number */
unsigned long root_cluster; /* first cluster of the root directory */ unsigned long root_cluster; /* first cluster of the root directory */
unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */
struct semaphore fat_lock; struct mutex fat_lock;
unsigned int prev_free; /* previously allocated cluster number */ unsigned int prev_free; /* previously allocated cluster number */
unsigned int free_clusters; /* -1 if undefined */ unsigned int free_clusters; /* -1 if undefined */
struct fat_mount_options options; struct fat_mount_options options;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment