From: Alex Lyashkov <shadow@psoft.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] remove use global lock list from lockd
Date: Tue, 06 Sep 2005 14:05:39 +0300 [thread overview]
Message-ID: <1126004739.3377.8.camel@berloga.shadowland> (raw)
[-- Attachment #1: Type: text/plain, Size: 140 bytes --]
Hello All
What anyone think about this patch?
this patch remove play with global lock list and use interlnal list
nlm_blocked.
--
Alex
[-- Attachment #2: lockd_file_lock.patch --]
[-- Type: text/x-patch, Size: 1993 bytes --]
Index: clntlock.c
===================================================================
RCS file: /home/cvs/kernel_26/fs/lockd/clntlock.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 clntlock.c
--- clntlock.c 23 Feb 2005 11:07:55 -0000 1.1.1.1
+++ clntlock.c 6 Sep 2005 10:44:34 -0000
@@ -137,24 +137,17 @@
/*
* Mark the locks for reclaiming.
- * FIXME: In 2.5 we don't want to iterate through any global file_lock_list.
- * Maintain NLM lock reclaiming lists in the nlm_host instead.
*/
static
void nlmclnt_mark_reclaim(struct nlm_host *host)
{
+ struct nlm_wait *head;
struct file_lock *fl;
- struct inode *inode;
- struct list_head *tmp;
- list_for_each(tmp, &file_lock_list) {
- fl = list_entry(tmp, struct file_lock, fl_link);
-
- inode = fl->fl_file->f_dentry->d_inode;
- if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
- continue;
- if (fl->fl_u.nfs_fl.owner->host != host)
+ for (head = nlm_blocked; head; head = head->b_next) {
+ if (head->b_host != host)
continue;
+ fl = head->b_lock;
if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED))
continue;
fl->fl_u.nfs_fl.flags |= NFS_LCK_RECLAIM;
@@ -202,9 +195,8 @@
{
struct nlm_host *host = (struct nlm_host *) ptr;
struct nlm_wait *block;
- struct list_head *tmp;
struct file_lock *fl;
- struct inode *inode;
+ struct nlm_wait *head;
daemonize("%s-reclaim", host->h_name);
allow_signal(SIGKILL);
@@ -216,14 +208,10 @@
/* First, reclaim all locks that have been marked. */
restart:
- list_for_each(tmp, &file_lock_list) {
- fl = list_entry(tmp, struct file_lock, fl_link);
-
- inode = fl->fl_file->f_dentry->d_inode;
- if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
- continue;
- if (fl->fl_u.nfs_fl.owner->host != host)
+ for (head = nlm_blocked; head; head = head->b_next) {
+ if (head->b_host != host)
continue;
+ fl = head->b_lock;
if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM))
continue;
next reply other threads:[~2005-09-06 11:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-06 11:05 Alex Lyashkov [this message]
2005-10-21 18:37 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1126004739.3377.8.camel@berloga.shadowland \
--to=shadow@psoft.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®