16 #include <linux/sched.h>
32 loff_t
pos,
unsigned len,
unsigned flags,
33 struct page **pagep,
void **fsdata)
40 &HFSPLUS_I(mapping->
host)->phys_size);
42 loff_t isize = mapping->
host->i_size;
43 if (pos + len > isize)
64 switch (inode->
i_ino) {
66 tree = HFSPLUS_SB(sb)->ext_tree;
69 tree = HFSPLUS_SB(sb)->cat_tree;
72 tree = HFSPLUS_SB(sb)->attr_tree;
109 }
while (--i && nidx < tree->node_count);
116 const struct iovec *iov, loff_t
offset,
unsigned long nr_segs)
118 struct file *file = iocb->
ki_filp;
119 struct inode *inode = file->
f_path.dentry->d_inode->i_mapping->host;
122 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
130 loff_t isize = i_size_read(inode);
131 loff_t
end = offset + iov_length(iov, nr_segs);
147 .readpage = hfsplus_readpage,
148 .writepage = hfsplus_writepage,
149 .write_begin = hfsplus_write_begin,
151 .bmap = hfsplus_bmap,
152 .releasepage = hfsplus_releasepage,
156 .readpage = hfsplus_readpage,
157 .writepage = hfsplus_writepage,
158 .write_begin = hfsplus_write_begin,
160 .bmap = hfsplus_bmap,
161 .direct_IO = hfsplus_direct_IO,
162 .writepages = hfsplus_writepages,
170 static struct dentry *hfsplus_file_lookup(
struct inode *dir,
175 struct inode *inode =
NULL;
182 inode = HFSPLUS_I(dir)->rsrc_inode;
190 hip = HFSPLUS_I(inode);
211 HFSPLUS_I(dir)->rsrc_inode =
inode;
220 hlist_add_fake(&inode->
i_hash);
222 mark_inode_dirty(inode);
224 d_add(dentry, inode);
228 static void hfsplus_get_perms(
struct inode *inode,
237 if (!i_uid_read(inode) && !mode)
241 if (!i_gid_read(inode) && !mode)
251 HFSPLUS_I(inode)->userflags = perms->
userflags;
262 static int hfsplus_file_open(
struct inode *inode,
struct file *file)
265 inode = HFSPLUS_I(inode)->rsrc_inode;
272 static int hfsplus_file_release(
struct inode *inode,
struct file *file)
277 inode = HFSPLUS_I(inode)->rsrc_inode;
283 HFSPLUS_SB(sb)->hidden_dir,
NULL);
291 static int hfsplus_setattr(
struct dentry *dentry,
struct iattr *
attr)
293 struct inode *inode = dentry->
d_inode;
301 attr->
ia_size != i_size_read(inode)) {
310 mark_inode_dirty(inode);
317 struct inode *inode = file->
f_mapping->host;
320 int error = 0, error2;
360 .lookup = hfsplus_file_lookup,
362 .setattr = hfsplus_setattr,
377 .open = hfsplus_file_open,
378 .release = hfsplus_file_release,
398 hip = HFSPLUS_I(inode);
421 inode->
i_op = &hfsplus_file_inode_operations;
422 inode->
i_fop = &hfsplus_file_operations;
432 insert_inode_hash(inode);
433 mark_inode_dirty(inode);
444 HFSPLUS_SB(sb)->folder_count--;
448 HFSPLUS_SB(sb)->file_count--;
470 for (count = 0, i = 0; i < 8; i++)
502 hfsplus_cat_entry
entry;
508 HFSPLUS_I(inode)->linkid = 0;
522 HFSPLUS_I(inode)->create_date = folder->
create_date;
523 HFSPLUS_I(inode)->fs_blocks = 0;
542 inode->
i_op = &hfsplus_file_inode_operations;
543 inode->
i_fop = &hfsplus_file_operations;
565 struct inode *main_inode =
inode;
567 hfsplus_cat_entry
entry;
570 main_inode = HFSPLUS_I(inode)->rsrc_inode;