| .. | .. |
|---|
| 117 | 117 | wait_queue_head_t lock_wq; |
|---|
| 118 | 118 | atomic_t refcnt; |
|---|
| 119 | 119 | unsigned int page_offset; |
|---|
| 120 | | - struct page *page[0]; |
|---|
| 120 | + struct page *page[]; |
|---|
| 121 | 121 | }; |
|---|
| 122 | 122 | |
|---|
| 123 | 123 | #define HFS_BNODE_LOCK 0 |
|---|
| .. | .. |
|---|
| 488 | 488 | struct hfsplus_fork_raw *fork); |
|---|
| 489 | 489 | int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd); |
|---|
| 490 | 490 | int hfsplus_cat_write_inode(struct inode *inode); |
|---|
| 491 | +int hfsplus_getattr(const struct path *path, struct kstat *stat, |
|---|
| 492 | + u32 request_mask, unsigned int query_flags); |
|---|
| 491 | 493 | int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, |
|---|
| 492 | 494 | int datasync); |
|---|
| 493 | 495 | |
|---|
| .. | .. |
|---|
| 531 | 533 | void **data, int op, int op_flags); |
|---|
| 532 | 534 | int hfsplus_read_wrapper(struct super_block *sb); |
|---|
| 533 | 535 | |
|---|
| 534 | | -/* time macros */ |
|---|
| 535 | | -#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) |
|---|
| 536 | | -#define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U)) |
|---|
| 536 | +/* |
|---|
| 537 | + * time helpers: convert between 1904-base and 1970-base timestamps |
|---|
| 538 | + * |
|---|
| 539 | + * HFS+ implementations are highly inconsistent, this one matches the |
|---|
| 540 | + * traditional behavior of 64-bit Linux, giving the most useful |
|---|
| 541 | + * time range between 1970 and 2106, by treating any on-disk timestamp |
|---|
| 542 | + * under HFSPLUS_UTC_OFFSET (Jan 1 1970) as a time between 2040 and 2106. |
|---|
| 543 | + */ |
|---|
| 544 | +#define HFSPLUS_UTC_OFFSET 2082844800U |
|---|
| 545 | + |
|---|
| 546 | +static inline time64_t __hfsp_mt2ut(__be32 mt) |
|---|
| 547 | +{ |
|---|
| 548 | + time64_t ut = (u32)(be32_to_cpu(mt) - HFSPLUS_UTC_OFFSET); |
|---|
| 549 | + |
|---|
| 550 | + return ut; |
|---|
| 551 | +} |
|---|
| 552 | + |
|---|
| 553 | +static inline __be32 __hfsp_ut2mt(time64_t ut) |
|---|
| 554 | +{ |
|---|
| 555 | + return cpu_to_be32(lower_32_bits(ut) + HFSPLUS_UTC_OFFSET); |
|---|
| 556 | +} |
|---|
| 537 | 557 | |
|---|
| 538 | 558 | /* compatibility */ |
|---|
| 539 | | -#define hfsp_mt2ut(t) (struct timespec){ .tv_sec = __hfsp_mt2ut(t) } |
|---|
| 559 | +#define hfsp_mt2ut(t) (struct timespec64){ .tv_sec = __hfsp_mt2ut(t) } |
|---|
| 540 | 560 | #define hfsp_ut2mt(t) __hfsp_ut2mt((t).tv_sec) |
|---|
| 541 | | -#define hfsp_now2mt() __hfsp_ut2mt(get_seconds()) |
|---|
| 561 | +#define hfsp_now2mt() __hfsp_ut2mt(ktime_get_real_seconds()) |
|---|
| 542 | 562 | |
|---|
| 543 | 563 | #endif |
|---|