.. | .. |
---|
270 | 270 | return 0; |
---|
271 | 271 | } |
---|
272 | 272 | |
---|
| 273 | +int hfsplus_getattr(const struct path *path, struct kstat *stat, |
---|
| 274 | + u32 request_mask, unsigned int query_flags) |
---|
| 275 | +{ |
---|
| 276 | + struct inode *inode = d_inode(path->dentry); |
---|
| 277 | + struct hfsplus_inode_info *hip = HFSPLUS_I(inode); |
---|
| 278 | + |
---|
| 279 | + if (inode->i_flags & S_APPEND) |
---|
| 280 | + stat->attributes |= STATX_ATTR_APPEND; |
---|
| 281 | + if (inode->i_flags & S_IMMUTABLE) |
---|
| 282 | + stat->attributes |= STATX_ATTR_IMMUTABLE; |
---|
| 283 | + if (hip->userflags & HFSPLUS_FLG_NODUMP) |
---|
| 284 | + stat->attributes |= STATX_ATTR_NODUMP; |
---|
| 285 | + |
---|
| 286 | + stat->attributes_mask |= STATX_ATTR_APPEND | STATX_ATTR_IMMUTABLE | |
---|
| 287 | + STATX_ATTR_NODUMP; |
---|
| 288 | + |
---|
| 289 | + generic_fillattr(inode, stat); |
---|
| 290 | + return 0; |
---|
| 291 | +} |
---|
| 292 | + |
---|
273 | 293 | int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, |
---|
274 | 294 | int datasync) |
---|
275 | 295 | { |
---|
.. | .. |
---|
320 | 340 | } |
---|
321 | 341 | |
---|
322 | 342 | if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) |
---|
323 | | - blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
---|
| 343 | + blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL); |
---|
324 | 344 | |
---|
325 | 345 | inode_unlock(inode); |
---|
326 | 346 | |
---|
.. | .. |
---|
329 | 349 | |
---|
330 | 350 | static const struct inode_operations hfsplus_file_inode_operations = { |
---|
331 | 351 | .setattr = hfsplus_setattr, |
---|
| 352 | + .getattr = hfsplus_getattr, |
---|
332 | 353 | .listxattr = hfsplus_listxattr, |
---|
333 | 354 | }; |
---|
334 | 355 | |
---|
.. | .. |
---|
483 | 504 | hfsplus_get_perms(inode, &folder->permissions, 1); |
---|
484 | 505 | set_nlink(inode, 1); |
---|
485 | 506 | inode->i_size = 2 + be32_to_cpu(folder->valence); |
---|
486 | | - inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(folder->access_date)); |
---|
487 | | - inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(folder->content_mod_date)); |
---|
488 | | - inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(folder->attribute_mod_date)); |
---|
| 507 | + inode->i_atime = hfsp_mt2ut(folder->access_date); |
---|
| 508 | + inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); |
---|
| 509 | + inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); |
---|
489 | 510 | HFSPLUS_I(inode)->create_date = folder->create_date; |
---|
490 | 511 | HFSPLUS_I(inode)->fs_blocks = 0; |
---|
491 | 512 | if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { |
---|
.. | .. |
---|
521 | 542 | init_special_inode(inode, inode->i_mode, |
---|
522 | 543 | be32_to_cpu(file->permissions.dev)); |
---|
523 | 544 | } |
---|
524 | | - inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(file->access_date)); |
---|
525 | | - inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(file->content_mod_date)); |
---|
526 | | - inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(file->attribute_mod_date)); |
---|
| 545 | + inode->i_atime = hfsp_mt2ut(file->access_date); |
---|
| 546 | + inode->i_mtime = hfsp_mt2ut(file->content_mod_date); |
---|
| 547 | + inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); |
---|
527 | 548 | HFSPLUS_I(inode)->create_date = file->create_date; |
---|
528 | 549 | } else { |
---|
529 | 550 | pr_err("bad catalog entry used to create inode\n"); |
---|