From: Benjamin LaHaise <bcrl@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [patch] 2.5.22 add __fput for aio
Date: Mon, 17 Jun 2002 15:47:38 -0400 [thread overview]
Message-ID: <20020617154738.B1457@redhat.com> (raw)
Hello Linus,
This patch splits fput into fput and __fput. __fput is needed by aio
to construct a mechanism for performing fput during io completion,
which typically occurs during interrupt context.
-ben
--
"You will be reincarnated as a toad; and you will be much happier."
diff -urN v2.5.22/fs/file_table.c fput-v2.5.22/fs/file_table.c
--- v2.5.22/fs/file_table.c Thu Jun 6 00:35:32 2002
+++ fput-v2.5.22/fs/file_table.c Mon Jun 17 15:43:10 2002
@@ -100,31 +100,38 @@
void fput(struct file * file)
{
+ if (atomic_dec_and_test(&file->f_count))
+ __fput(file);
+}
+
+/* __fput is needed for aio, which provides a mechanism for doing fput
+ * from an interrupt handler.
+ */
+void __fput(struct file * file)
+{
struct dentry * dentry = file->f_dentry;
struct vfsmount * mnt = file->f_vfsmnt;
struct inode * inode = dentry->d_inode;
- if (atomic_dec_and_test(&file->f_count)) {
- locks_remove_flock(file);
+ locks_remove_flock(file);
- if (file->f_iobuf)
- free_kiovec(1, &file->f_iobuf);
+ if (file->f_iobuf)
+ free_kiovec(1, &file->f_iobuf);
- if (file->f_op && file->f_op->release)
- file->f_op->release(inode, file);
- fops_put(file->f_op);
- if (file->f_mode & FMODE_WRITE)
- put_write_access(inode);
- file_list_lock();
- file->f_dentry = NULL;
- file->f_vfsmnt = NULL;
- list_del(&file->f_list);
- list_add(&file->f_list, &free_list);
- files_stat.nr_free_files++;
- file_list_unlock();
- dput(dentry);
- mntput(mnt);
- }
+ if (file->f_op && file->f_op->release)
+ file->f_op->release(inode, file);
+ fops_put(file->f_op);
+ if (file->f_mode & FMODE_WRITE)
+ put_write_access(inode);
+ file_list_lock();
+ file->f_dentry = NULL;
+ file->f_vfsmnt = NULL;
+ list_del(&file->f_list);
+ list_add(&file->f_list, &free_list);
+ files_stat.nr_free_files++;
+ file_list_unlock();
+ dput(dentry);
+ mntput(mnt);
}
struct file * fget(unsigned int fd)
diff -urN v2.5.22/include/linux/file.h fput-v2.5.22/include/linux/file.h
--- v2.5.22/include/linux/file.h Thu Jun 6 00:35:16 2002
+++ fput-v2.5.22/include/linux/file.h Mon Jun 17 15:43:11 2002
@@ -33,6 +33,7 @@
struct file * fd_array[NR_OPEN_DEFAULT];
};
+extern void FASTCALL(__fput(struct file *));
extern void FASTCALL(fput(struct file *));
extern struct file * FASTCALL(fget(unsigned int fd));
extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
next reply other threads:[~2002-06-17 19:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-17 19:47 Benjamin LaHaise [this message]
2002-06-17 20:11 ` [patch] 2.5.22 add __fput for aio Linus Torvalds
2002-06-17 20:19 ` Benjamin LaHaise
2002-06-17 20:22 ` Linus Torvalds
2002-06-17 20:41 ` Dynamic Timer X.Xiao
2002-06-17 22:27 ` george anzinger
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=20020617154738.B1457@redhat.com \
--to=bcrl@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.