6 #include <linux/module.h>
7 #include <linux/sched.h>
8 #include <linux/slab.h>
28 return sb_bread(sb, clus_to_blk(sbi, block));
67 insert_inode_hash(inode);
68 mark_inode_dirty(inode);
81 static void omfs_update_checksums(
struct omfs_inode *oi)
85 unsigned char *
ptr = (
unsigned char *) oi;
104 struct buffer_head *bh, *bh2;
136 ((inode->
i_ctime.tv_nsec + 999)/1000);
139 omfs_update_checksums(oi);
144 if (buffer_req(bh) && !buffer_uptodate(bh))
154 memcpy(bh2->b_data, bh->b_data, bh->b_size);
158 if (buffer_req(bh2) && !buffer_uptodate(bh2))
163 ret = (sync_failed) ? -
EIO : 0;
177 return __omfs_write_inode(inode, 1);
184 static void omfs_evict_inode(
struct inode *inode)
204 struct buffer_head *bh;
229 nsecs =
do_div(ctime, 1000) * 1000
L;
261 return ERR_PTR(-
EIO);
276 u64 id = huge_encode_dev(s->
s_bdev->bd_dev);
293 .write_inode = omfs_write_inode,
294 .evict_inode = omfs_evict_inode,
295 .put_super = omfs_put_super,
296 .statfs = omfs_statfs,
313 struct buffer_head *bh;
333 for (count = bitmap_size; count > 0; count -= sb->
s_blocksize) {
334 bh = sb_bread(sb, block++);
344 memset((
void *)*ptr + count, 0xff,
353 for (count = 0; count < array_size; count++)
395 if (!uid_valid(sbi->
s_uid))
402 if (!gid_valid(sbi->
s_gid))
427 static int omfs_fill_super(
struct super_block *sb,
void *
data,
int silent)
429 struct buffer_head *bh, *bh2;
448 if (!parse_options((
char *) data, sbi))
455 bh = sb_bread(sb, 0);
513 "super and root blocks (%llx, %llx)\n",
522 "(%llx, total blocks %llx)\n",
534 ret = omfs_get_imap(sb);
538 sb->
s_op = &omfs_sops;
563 int flags,
const char *dev_name,
void *data)
565 return mount_bdev(fs_type, flags, dev_name, data, omfs_fill_super);
576 static int __init init_omfs_fs(
void)
581 static void __exit exit_omfs_fs(
void)