• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/linux/linux/fs/hfs/

Lines Matching refs:inode

18  * Given an HFS catalog entry initialize an inode for a file.
20 static void init_file_inode(struct inode *inode, hfs_u8 fork)
23 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
26 inode->i_mode = S_IRWXUGO | S_IFREG;
28 inode->i_mode = S_IRUGO | S_IWUGO | S_IFREG;
32 HFS_I(inode)->convert = 0;
36 HFS_I(inode)->convert = 0;
38 HFS_I(inode)->fork = fk;
39 inode->i_size = fk->lsize;
40 inode->i_blocks = fk->psize;
41 inode->i_nlink = 1;
51 * cleanup necessary when the use-count of an inode falls to zero.
53 void hfs_put_inode(struct inode * inode)
55 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
59 if (atomic_read(&inode->i_count) == 1) {
60 struct hfs_hdr_layout *tmp = HFS_I(inode)->layout;
63 HFS_I(inode)->layout = NULL;
73 * Based very closely on fs/msdos/inode.c by Werner Almesberger
77 * an inode and apply then in a filesystem-dependent manner. In this
81 * 3) Since multiple Linux files can share the same on-disk inode under
90 struct inode *inode = dentry->d_inode;
91 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
93 struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
96 error = inode_change_ok(inode, attr); /* basic permission checks */
114 (attr->ia_mode != inode->i_mode))||
124 attr->ia_mode = inode->i_mode | S_IWUGO;
126 attr->ia_mode = inode->i_mode & ~S_IWUGO;
136 inode->i_size = attr->ia_size;
137 if (inode->i_size > HFS_FORK_MAX)
138 inode->i_size = HFS_FORK_MAX;
139 mark_inode_dirty(inode);
142 hdr_truncate(inode, attr->ia_size);
146 error = inode_setattr(inode, attr);
162 entry->modify_date = hfs_u_to_mtime(inode->i_mtime);
168 if (inode->i_mode & S_IWUSR) {
225 struct inode *hfs_iget(struct hfs_cat_entry *entry, ino_t type,
230 struct inode *inode;
237 the same inode then they will all get the same one back.
239 i_mode field of the inode is blank and KNOW that it is
241 'sys_entry' field in the entry and initialize the inode.
244 initialized inode. */
249 if (!(inode = iget(sb, ntohl(entry->cnid) | type))) {
254 if (inode->i_dev != sb->s_dev) {
255 iput(inode); /* automatically does an hfs_cat_put */
256 inode = NULL;
257 } else if (!inode->i_mode || (*sys_entry == NULL)) {
258 /* Initialize the inode */
261 inode->i_rdev = 0;
262 inode->i_ctime = inode->i_atime = inode->i_mtime =
264 inode->i_blksize = HFS_SECTOR_SIZE;
265 inode->i_uid = hsb->s_uid;
266 inode->i_gid = hsb->s_gid;
268 memset(HFS_I(inode), 0, sizeof(struct hfs_inode_info));
269 HFS_I(inode)->magic = HFS_INO_MAGIC;
270 HFS_I(inode)->entry = entry;
271 HFS_I(inode)->tz_secondswest = hfs_to_utc(0);
273 hsb->s_ifill(inode, type, hsb->s_version);
276 inode->i_mode &= ~S_IWUGO;
278 inode->i_mode &= ~hsb->s_umask;
280 if (!inode->i_mode) {
281 iput(inode); /* does an hfs_cat_put */
282 inode = NULL;
288 return inode;
298 * the missing fields of an uninitialized inode under the CAP scheme.
300 void hfs_cap_ifill(struct inode * inode, ino_t type, const int version)
302 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
304 HFS_I(inode)->d_drop_op = hfs_cap_drop_dentry;
306 inode->i_size = sizeof(struct hfs_cap_info);
307 inode->i_blocks = 0;
308 inode->i_nlink = 1;
309 inode->i_mode = S_IRUGO | S_IWUGO | S_IFREG;
310 inode->i_op = &hfs_cap_info_inode_operations;
311 inode->i_fop = &hfs_cap_info_operations;
313 init_file_inode(inode, (type == HFS_CAP_DATA) ?
315 inode->i_op = &hfs_file_inode_operations;
316 inode->i_fop = &hfs_file_operations;
317 inode->i_mapping->a_ops = &hfs_aops;
318 inode->u.hfs_i.mmu_private = inode->i_size;
322 inode->i_blocks = 0;
323 inode->i_size = hdir->files + hdir->dirs + 5;
324 HFS_I(inode)->dir_size = 1;
326 inode->i_mode = S_IRWXUGO | S_IFDIR;
327 inode->i_nlink = hdir->dirs + 4;
328 inode->i_op = &hfs_cap_ndir_inode_operations;
329 inode->i_fop = &hfs_cap_dir_operations;
330 HFS_I(inode)->file_type = HFS_CAP_NORM;
332 inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
333 inode->i_nlink = 2;
334 inode->i_op = &hfs_cap_fdir_inode_operations;
335 inode->i_fop = &hfs_cap_dir_operations;
336 HFS_I(inode)->file_type = HFS_CAP_FNDR;
338 inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
339 inode->i_nlink = 2;
340 inode->i_op = &hfs_cap_rdir_inode_operations;
341 inode->i_fop = &hfs_cap_dir_operations;
342 HFS_I(inode)->file_type = HFS_CAP_RSRC;
352 * the missing fields of an uninitialized inode under the AppleDouble
355 void hfs_dbl_ifill(struct inode * inode, ino_t type, const int version)
357 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
359 HFS_I(inode)->d_drop_op = hfs_dbl_drop_dentry;
362 init_file_inode(inode, HFS_FK_RSRC);
363 inode->i_size += HFS_DBL_HDR_LEN;
364 HFS_I(inode)->default_layout = &hfs_dbl_fil_hdr_layout;
366 inode->i_size = HFS_DBL_HDR_LEN;
367 inode->i_mode = S_IRUGO | S_IWUGO | S_IFREG;
368 inode->i_nlink = 1;
369 HFS_I(inode)->default_layout = &hfs_dbl_dir_hdr_layout;
371 inode->i_op = &hfs_hdr_inode_operations;
372 inode->i_fop = &hfs_hdr_operations;
374 init_file_inode(inode, HFS_FK_DATA);
375 inode->i_op = &hfs_file_inode_operations;
376 inode->i_fop = &hfs_file_operations;
377 inode->i_mapping->a_ops = &hfs_aops;
378 inode->u.hfs_i.mmu_private = inode->i_size;
382 inode->i_blocks = 0;
383 inode->i_nlink = hdir->dirs + 2;
384 inode->i_size = 3 + 2 * (hdir->dirs + hdir->files);
385 inode->i_mode = S_IRWXUGO | S_IFDIR;
386 inode->i_op = &hfs_dbl_dir_inode_operations;
387 inode->i_fop = &hfs_dbl_dir_operations;
388 HFS_I(inode)->file_type = HFS_DBL_NORM;
389 HFS_I(inode)->dir_size = 2;
398 * the missing fields of an uninitialized inode under the Netatalk
401 void hfs_nat_ifill(struct inode * inode, ino_t type, const int version)
403 struct hfs_cat_entry *entry = HFS_I(inode)->entry;
405 HFS_I(inode)->d_drop_op = hfs_nat_drop_dentry;
408 init_file_inode(inode, HFS_FK_RSRC);
409 inode->i_size += HFS_NAT_HDR_LEN;
411 inode->i_size = HFS_NAT_HDR_LEN;
412 inode->i_mode = S_IRUGO | S_IWUGO | S_IFREG;
413 inode->i_nlink = 1;
415 inode->i_op = &hfs_hdr_inode_operations;
416 inode->i_fop = &hfs_hdr_operations;
417 HFS_I(inode)->default_layout = (version == 2) ?
420 init_file_inode(inode, HFS_FK_DATA);
421 inode->i_op = &hfs_file_inode_operations;
422 inode->i_fop = &hfs_file_operations;
423 inode->i_mapping->a_ops = &hfs_aops;
424 inode->u.hfs_i.mmu_private = inode->i_size;
428 inode->i_blocks = 0;
429 inode->i_size = hdir->files + hdir->dirs + 4;
430 inode->i_mode = S_IRWXUGO | S_IFDIR;
431 HFS_I(inode)->dir_size = 1;
433 inode->i_nlink = hdir->dirs + 3;
434 inode->i_op = &hfs_nat_ndir_inode_operations;
435 HFS_I(inode)->file_type = HFS_NAT_NORM;
437 inode->i_nlink = 2;
438 inode->i_op = &hfs_nat_hdir_inode_operations;
439 HFS_I(inode)->file_type = HFS_NAT_HDR;
441 inode->i_fop = &hfs_nat_dir_operations;