Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e5e529a authored by Ingo Molnar's avatar Ingo Molnar Committed by Anton Altaparmakov
Browse files

NTFS: Semaphore to mutex conversion.



The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 834ba600
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ ToDo/Notes:
	  fs/ntfs/inode.c::ntfs_write_inode().
	- Handle the recently introduced -ENAMETOOLONG return value from
	  fs/ntfs/unistr.c::ntfs_nlstoucs() in fs/ntfs/namei.c::ntfs_lookup().
	- Semaphore to mutex conversion.  (Ingo Molnar)

2.1.26 - Minor bug fixes and updates.

+3 −3
Original line number Diff line number Diff line
@@ -1278,18 +1278,18 @@ unm_done:
		
		tni = locked_nis[nr_locked_nis];
		/* Get the base inode. */
		down(&tni->extent_lock);
		mutex_lock(&tni->extent_lock);
		if (tni->nr_extents >= 0)
			base_tni = tni;
		else {
			base_tni = tni->ext.base_ntfs_ino;
			BUG_ON(!base_tni);
		}
		up(&tni->extent_lock);
		mutex_unlock(&tni->extent_lock);
		ntfs_debug("Unlocking %s inode 0x%lx.",
				tni == base_tni ? "base" : "extent",
				tni->mft_no);
		up(&tni->mrec_lock);
		mutex_unlock(&tni->mrec_lock);
		atomic_dec(&tni->count);
		iput(VFS_I(base_tni));
	}
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static DEFINE_SPINLOCK(ntfs_cb_lock);
/**
 * allocate_compression_buffers - allocate the decompression buffers
 *
 * Caller has to hold the ntfs_lock semaphore.
 * Caller has to hold the ntfs_lock mutex.
 *
 * Return 0 on success or -ENOMEM if the allocations failed.
 */
@@ -84,7 +84,7 @@ int allocate_compression_buffers(void)
/**
 * free_compression_buffers - free the decompression buffers
 *
 * Caller has to hold the ntfs_lock semaphore.
 * Caller has to hold the ntfs_lock mutex.
 */
void free_compression_buffers(void)
{
+5 −5
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
	atomic_set(&ni->count, 1);
	ni->vol = NTFS_SB(sb);
	ntfs_init_runlist(&ni->runlist);
	init_MUTEX(&ni->mrec_lock);
	mutex_init(&ni->mrec_lock);
	ni->page = NULL;
	ni->page_ofs = 0;
	ni->attr_list_size = 0;
@@ -400,7 +400,7 @@ void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
	ni->itype.index.collation_rule = 0;
	ni->itype.index.block_size_bits = 0;
	ni->itype.index.vcn_size_bits = 0;
	init_MUTEX(&ni->extent_lock);
	mutex_init(&ni->extent_lock);
	ni->nr_extents = 0;
	ni->ext.base_ntfs_ino = NULL;
}
@@ -3066,7 +3066,7 @@ int ntfs_write_inode(struct inode *vi, int sync)
	 */
	if (modified) {
		flush_dcache_mft_record_page(ctx->ntfs_ino);
		if (!NInoTestSetDirty(ctx->ntfs_ino)) {
		if (!NInoTestSetDirty(ctx->ntfs_ino))
			mark_ntfs_record_dirty(ctx->ntfs_ino->page,
					ctx->ntfs_ino->page_ofs);
	}
@@ -3075,7 +3075,7 @@ int ntfs_write_inode(struct inode *vi, int sync)
	if (NInoDirty(ni))
		err = write_mft_record(ni, m, sync);
	/* Write all attached extent mft records. */
	down(&ni->extent_lock);
	mutex_lock(&ni->extent_lock);
	if (ni->nr_extents > 0) {
		ntfs_inode **extent_nis = ni->ext.extent_ntfs_inos;
		int i;
@@ -3102,7 +3102,7 @@ int ntfs_write_inode(struct inode *vi, int sync)
			}
		}
	}
	up(&ni->extent_lock);
	mutex_unlock(&ni->extent_lock);
	unmap_mft_record(ni);
	if (unlikely(err))
		goto err_out;
+7 −6
Original line number Diff line number Diff line
@@ -24,12 +24,13 @@
#ifndef _LINUX_NTFS_INODE_H
#define _LINUX_NTFS_INODE_H

#include <linux/mm.h>
#include <asm/atomic.h>

#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/list.h>
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/seq_file.h>

#include "layout.h"
#include "volume.h"
@@ -81,7 +82,7 @@ struct _ntfs_inode {
	 * The following fields are only valid for real inodes and extent
	 * inodes.
	 */
	struct semaphore mrec_lock; /* Lock for serializing access to the
	struct mutex mrec_lock;	/* Lock for serializing access to the
				   mft record belonging to this inode. */
	struct page *page;	/* The page containing the mft record of the
				   inode. This should only be touched by the
@@ -119,7 +120,7 @@ struct _ntfs_inode {
			u8 block_clusters;	/* Number of clusters per cb. */
		} compressed;
	} itype;
	struct semaphore extent_lock;	/* Lock for accessing/modifying the
	struct mutex extent_lock;	/* Lock for accessing/modifying the
					   below . */
	s32 nr_extents;	/* For a base mft record, the number of attached extent
			   inodes (0 if none), for extent records and for fake
Loading