summaryrefslogtreecommitdiffstats
path: root/fs/cramfs
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/cramfs
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/cramfs')
-rw-r--r--fs/cramfs/inflate/zconf.h4
-rw-r--r--fs/cramfs/inode.c144
2 files changed, 16 insertions, 132 deletions
diff --git a/fs/cramfs/inflate/zconf.h b/fs/cramfs/inflate/zconf.h
index adc70c276..0b5ec8838 100644
--- a/fs/cramfs/inflate/zconf.h
+++ b/fs/cramfs/inflate/zconf.h
@@ -83,8 +83,8 @@ typedef uLong FAR uLongf;
typedef void FAR *voidpf;
typedef void *voidp;
-#include <sys/types.h> /* for off_t */
-#include <unistd.h> /* for SEEK_* and off_t */
+#include <linux/types.h> /* for off_t */
+#include <linux/unistd.h> /* for SEEK_* and off_t */
#define z_off_t off_t
#endif /* _ZCONF_H */
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 07c8f15a1..b9ab3c4c4 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -25,7 +25,7 @@
static struct super_operations cramfs_ops;
static struct inode_operations cramfs_file_inode_operations;
static struct inode_operations cramfs_dir_inode_operations;
-static struct inode_operations cramfs_symlink_inode_operations;
+static struct address_space_operations cramfs_aops;
/* These two macros may change in future, to provide better st_ino
semantics. */
@@ -51,13 +51,15 @@ static struct inode *get_cramfs_inode(struct super_block *sb, struct cramfs_inod
result in GNU find, even
without -noleaf option. */
insert_inode_hash(inode);
- if (S_ISREG(inode->i_mode))
+ if (S_ISREG(inode->i_mode)) {
inode->i_op = &cramfs_file_inode_operations;
- else if (S_ISDIR(inode->i_mode))
+ inode->i_data.a_ops = &cramfs_aops;
+ } else if (S_ISDIR(inode->i_mode))
inode->i_op = &cramfs_dir_inode_operations;
- else if (S_ISLNK(inode->i_mode))
- inode->i_op = &cramfs_symlink_inode_operations;
- else {
+ else if (S_ISLNK(inode->i_mode)) {
+ inode->i_op = &page_symlink_inode_operations;
+ inode->i_data.a_ops = &cramfs_aops;
+ } else {
inode->i_size = 0;
init_special_inode(inode, inode->i_mode, cramfs_inode->size);
}
@@ -344,53 +346,9 @@ static int cramfs_readpage(struct dentry *dentry, struct page * page)
return 0;
}
-static struct page *get_symlink_page(struct dentry *dentry)
-{
- return read_cache_page(&dentry->d_inode->i_data, 0, (filler_t *)cramfs_readpage, dentry);
-}
-
-static int cramfs_readlink(struct dentry *dentry, char *buffer, int len)
-{
- struct inode *inode = dentry->d_inode;
- int retval;
-
- if (!inode || !S_ISLNK(inode->i_mode))
- return -EBADF;
-
- retval = inode->i_size;
- if (retval) {
- int len;
- struct page *page = get_symlink_page(dentry);
-
- if (IS_ERR(page))
- return PTR_ERR(page);
- wait_on_page(page);
- len = retval;
- retval = -EIO;
- if (Page_Uptodate(page)) {
- retval = -EFAULT;
- if (!copy_to_user(buffer, (void *) page_address(page), len))
- retval = len;
- }
- page_cache_release(page);
- }
- return retval;
-}
-
-static struct dentry *cramfs_follow_link(struct dentry *dentry, struct dentry *base, unsigned int follow)
-{
- struct page *page = get_symlink_page(dentry);
- struct dentry *result;
-
- if (IS_ERR(page)) {
- dput(base);
- return ERR_PTR(PTR_ERR(page));
- }
-
- result = lookup_dentry((void *) page_address(page), base, follow);
- page_cache_release(page);
- return result;
-}
+static struct address_space_operations cramfs_aops = {
+ readpage: cramfs_readpage
+};
/*
* Our operations:
@@ -398,99 +356,25 @@ static struct dentry *cramfs_follow_link(struct dentry *dentry, struct dentry *b
* A regular file can be read and mmap'ed.
*/
static struct file_operations cramfs_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- NULL, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
};
/*
* A directory can only readdir
*/
static struct file_operations cramfs_directory_operations = {
- NULL, /* lseek - default */
- NULL, /* read */
- NULL, /* write - bad */
- cramfs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ readdir: cramfs_readdir,
};
static struct inode_operations cramfs_file_inode_operations = {
&cramfs_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 */
- NULL, /* get_block */
- cramfs_readpage, /* readpage */
- NULL, /* writepage */
- NULL, /* truncate */
- NULL, /* permission */
- NULL /* revalidate */
};
static struct inode_operations cramfs_dir_inode_operations = {
&cramfs_directory_operations,
NULL, /* create */
cramfs_lookup, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* get_block */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* truncate */
- NULL, /* permission */
- NULL /* revalidate */
-};
-
-static struct inode_operations cramfs_symlink_inode_operations = {
- NULL, /* symlinks do not have files */
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- cramfs_readlink, /* readlink */
- cramfs_follow_link, /* follow_link */
- NULL, /* get_block */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* truncate */
- NULL, /* permission */
- NULL /* revalidate */
};
static struct super_operations cramfs_ops = {