From: Robert Love <rml@tech9.net>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org, viro@math.psu.edu
Subject: [PATCH] 2.4: UFS lseek cleanup
Date: 11 Mar 2002 18:23:58 -0500 [thread overview]
Message-ID: <1015889043.853.103.camel@phantasy> (raw)
Marcelo,
The following patch continues the 2.4 lseek cleanup by removing a
redundant ufs_file_lseek implementation and having UFS use the standard
generic_file_llseek.
Al (who signed off on this for 2.5) says the implementation assumed it
needed explicit size checking, but the standard generic_file_llseek does
this just fine. So it is redundant and a sane cleanup. The patch is
already in -ac, but not in 2.4.19-pre3.
This is against 2.4.19-pre3, please apply.
Robert Love
diff -urN linux-2.4.19-pre3/fs/ufs/file.c linux/fs/ufs/file.c
--- linux-2.4.19-pre3/fs/ufs/file.c Mon Mar 11 18:08:04 2002
+++ linux/fs/ufs/file.c Mon Mar 11 18:10:20 2002
@@ -37,43 +37,12 @@
#include <linux/pagemap.h>
/*
- * Make sure the offset never goes beyond the 32-bit mark..
- */
-static long long ufs_file_lseek(
- struct file *file,
- long long offset,
- int origin )
-{
- long long retval;
- struct inode *inode = file->f_dentry->d_inode;
-
- switch (origin) {
- case 2:
- offset += inode->i_size;
- break;
- case 1:
- offset += file->f_pos;
- }
- retval = -EINVAL;
- /* make sure the offset fits in 32 bits */
- if (((unsigned long long) offset >> 32) == 0) {
- if (offset != file->f_pos) {
- file->f_pos = offset;
- file->f_reada = 0;
- file->f_version = ++event;
- }
- retval = offset;
- }
- return retval;
-}
-
-/*
* We have mostly NULL's here: the current defaults are ok for
* the ufs filesystem.
*/
struct file_operations ufs_file_operations = {
- llseek: ufs_file_lseek,
+ llseek: generic_file_llseek,
read: generic_file_read,
write: generic_file_write,
mmap: generic_file_mmap,
reply other threads:[~2002-03-11 23:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1015889043.853.103.camel@phantasy \
--to=rml@tech9.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=viro@math.psu.edu \
/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.