#endif
};
-struct inode_operations lafs_dir_ino_operations = {
+const struct inode_operations lafs_dir_ino_operations = {
.lookup = lafs_lookup,
.create = lafs_create,
.link = lafs_link,
.splice_write = generic_file_splice_write,
};
-struct inode_operations lafs_file_ino_operations = {
+const struct inode_operations lafs_file_ino_operations = {
.setattr = lafs_setattr,
};
-struct address_space_operations lafs_file_aops = {
+const struct address_space_operations lafs_file_aops = {
.readpage = lafs_readpage,
.readpages = lafs_readpages,
.writepage = lafs_writepage,
= i->quota_inodes[2] = NULL;
memcpy(i->name, l->name, 64);
i->name[64] = 0;
+
+ /* Make this look like a directory */
+ ino->i_mode = S_IFDIR;
+ ino->i_uid = 0;
+ ino->i_gid = 0;
+ ino->i_size = 0;
+ ino->i_op = &lafs_subset_ino_operations;
+ ino->i_fop = &lafs_subset_file_operations;
break;
}
putdref(db, MKREF(trunc));
}
-struct inode_operations lafs_special_ino_operations = {
+const struct inode_operations lafs_special_ino_operations = {
.setattr = lafs_setattr,
.truncate = lafs_truncate,
};
return a-b>0;
}
-extern struct inode_operations lafs_file_ino_operations;
-extern struct inode_operations lafs_dir_ino_operations;
-extern struct inode_operations lafs_link_ino_operations;
-extern struct inode_operations lafs_special_ino_operations;
+const extern struct inode_operations lafs_file_ino_operations;
+const extern struct inode_operations lafs_dir_ino_operations;
+const extern struct inode_operations lafs_subset_ino_operations;
+const extern struct inode_operations lafs_link_ino_operations;
+const extern struct inode_operations lafs_special_ino_operations;
const extern struct file_operations lafs_file_file_operations;
const extern struct file_operations lafs_dir_file_operations;
-extern struct address_space_operations lafs_file_aops;
-
-extern struct address_space_operations lafs_index_operations;
+const extern struct file_operations lafs_subset_file_operations;
+const extern struct address_space_operations lafs_file_aops;
+const extern struct address_space_operations lafs_index_operations;
#define SYNC 0
#define ASYNC 1
#include "lafs.h"
-struct inode_operations lafs_link_ino_operations = {
+const struct inode_operations lafs_link_ino_operations = {
.readlink = generic_readlink,
.follow_link = page_follow_link_light,
.put_link = page_put_link,
LAFSI(ino)->type = TypeInodeFile;
LAFSI(ino)->metadata_size = (sizeof(struct la_inode) +
sizeof(struct fs_metadata));
+ ino->i_op = &lafs_subset_ino_operations;
+ ino->i_fop = &lafs_subset_file_operations;
+ /* FIXME we lose md->parent here - what to do?? */
md = &LAFSI(ino)->md.fs;
md->usagetable = 0;
md->update_time = CURRENT_TIME.tv_sec;
kfree(k);
}
+const struct file_operations lafs_subset_file_operations = {
+};
+
+const struct inode_operations lafs_subset_ino_operations = {
+};
+
+
struct file_system_type lafs_fs_type = {
.owner = THIS_MODULE,
.name = "lafs",
mount -t lafs_subset /mnt/1/foo /mnt/2
rm /mnt/2/foo1
ls -lai /mnt/2
+ls -lai /mnt/1/foo
umount /mnt/2
cd /
(sleep 20 ; echo t > /proc/sysrq-trigger ; sleep 2 ; echo b > /proc/sysrq-trigger; ) &