* [PATCH] 2.4: UFS lseek cleanup
@ 2002-03-11 23:23 Robert Love
0 siblings, 0 replies; only message in thread
From: Robert Love @ 2002-03-11 23:23 UTC (permalink / raw)
To: marcelo; +Cc: linux-kernel, viro
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,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-03-11 23:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-11 23:23 [PATCH] 2.4: UFS lseek cleanup Robert Love
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.