lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081007201053.GB26373@wotan.suse.de>
Date:	Tue, 7 Oct 2008 13:10:53 -0700
From:	Mark Fasheh <mfasheh@...e.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, joel.becker@...cle.com,
	ocfs2-devel@....oracle.com, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 04/39] ocfs2: track local alloc state via debugfs

On Wed, Oct 01, 2008 at 11:11:53PM -0700, Andrew Morton wrote:
> > +static ssize_t ocfs2_la_debug_read(struct file *file, char __user *userbuf,
> > +				   size_t count, loff_t *ppos)
> > +{
> > +	struct ocfs2_super *osb = file->private_data;
> > +	int written, ret;
> > +	char *buf = osb->local_alloc_debug_buf;
> > +
> > +	mutex_lock(&la_debug_mutex);
> > +	memset(buf, 0, LA_DEBUG_BUF_SZ);
> > +
> > +	written = snprintf(buf, LA_DEBUG_BUF_SZ,
> > +			   "0x%x\t0x%llx\t%u\t%u\t0x%x\n",
> > +			   LA_DEBUG_VER,
> > +			   (unsigned long long)osb->la_last_gd,
> > +			   osb->local_alloc_default_bits,
> > +			   osb->local_alloc_bits, osb->local_alloc_state);
> > +
> > +	ret = simple_read_from_buffer(userbuf, count, ppos, buf, written);
> > +
> > +	mutex_unlock(&la_debug_mutex);
> > +	return ret;
> > +}
> 
> In fact it can be made static and local to this function.

Thanks, fixed in 'merge_window' branch of ocfs2.git.
	--Mark

--
Mark Fasheh

From: Mark Fasheh <mfasheh@...e.com>

ocfs2: make la_debug_mutex static

It can also be moved into ocfs2_la_debug_read().

Signed-off-by: Mark Fasheh <mfasheh@...e.com>
---
 fs/ocfs2/localalloc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index 02227c3..b1c634d 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -76,8 +76,6 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
 
 #ifdef CONFIG_OCFS2_FS_STATS
 
-DEFINE_MUTEX(la_debug_mutex);
-
 static int ocfs2_la_debug_open(struct inode *inode, struct file *file)
 {
 	file->private_data = inode->i_private;
@@ -89,6 +87,7 @@ static int ocfs2_la_debug_open(struct inode *inode, struct file *file)
 static ssize_t ocfs2_la_debug_read(struct file *file, char __user *userbuf,
 				   size_t count, loff_t *ppos)
 {
+	static DEFINE_MUTEX(la_debug_mutex);
 	struct ocfs2_super *osb = file->private_data;
 	int written, ret;
 	char *buf = osb->local_alloc_debug_buf;
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ