summaryrefslogtreecommitdiffstats
path: root/fs/ext2/file.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
commit529c593ece216e4aaffd36bd940cb94f1fa63129 (patch)
tree78f1c0b805f5656aa7b0417a043c5346f700a2cf /fs/ext2/file.c
parent0bd079751d25808d1972baee5c4eaa1db2227257 (diff)
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'fs/ext2/file.c')
-rw-r--r--fs/ext2/file.c81
1 files changed, 10 insertions, 71 deletions
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index df010f223..5c4639175 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -21,13 +21,6 @@
#include <linux/fs.h>
#include <linux/sched.h>
-
-
-#define NBUF 32
-
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
static loff_t ext2_file_lseek(struct file *, loff_t, int);
static int ext2_open_file (struct inode *, struct file *);
@@ -73,40 +66,6 @@ static loff_t ext2_file_lseek(
return offset;
}
-static inline void remove_suid(struct inode *inode)
-{
- unsigned int mode;
-
- /* set S_IGID if S_IXGRP is set, and always set S_ISUID */
- mode = (inode->i_mode & S_IXGRP)*(S_ISGID/S_IXGRP) | S_ISUID;
-
- /* was any of the uid bits set? */
- mode &= inode->i_mode;
- if (mode && !capable(CAP_FSETID)) {
- inode->i_mode &= ~mode;
- mark_inode_dirty(inode);
- }
-}
-
-/*
- * Write to a file (through the page cache).
- */
-static ssize_t
-ext2_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
- ssize_t retval;
-
- retval = generic_file_write(file, buf, count,
- ppos, block_write_partial_page);
- if (retval > 0) {
- struct inode *inode = file->f_dentry->d_inode;
- remove_suid(inode);
- inode->i_ctime = inode->i_mtime = CURRENT_TIME;
- mark_inode_dirty(inode);
- }
- return retval;
-}
-
/*
* Called when an inode is released. Note that this is different
* from ext2_file_open: open gets called at every open, but release
@@ -137,37 +96,17 @@ static int ext2_open_file (struct inode * inode, struct file * filp)
* the ext2 filesystem.
*/
static struct file_operations ext2_file_operations = {
- ext2_file_lseek, /* lseek */
- generic_file_read, /* read */
- ext2_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- ext2_ioctl, /* ioctl */
- generic_file_mmap, /* mmap */
- ext2_open_file,
- NULL, /* flush */
- ext2_release_file, /* release */
- ext2_sync_file, /* fsync */
- NULL, /* fasync */
+ llseek: ext2_file_lseek,
+ read: generic_file_read,
+ write: generic_file_write,
+ ioctl: ext2_ioctl,
+ mmap: generic_file_mmap,
+ open: ext2_open_file,
+ release: ext2_release_file,
+ fsync: ext2_sync_file,
};
struct inode_operations ext2_file_inode_operations = {
- &ext2_file_operations,/* default file operations */
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- ext2_get_block, /* get_block */
- block_read_full_page, /* readpage */
- block_write_full_page, /* writepage */
- ext2_truncate, /* truncate */
- NULL, /* permission */
- NULL, /* revalidate */
+ &ext2_file_operations,
+ truncate: ext2_truncate,
};