.. | .. |
---|
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 |
---|
.. | .. |
---|
198 | 198 | #define HFSPLUS_SB_HFSX 3 |
---|
199 | 199 | #define HFSPLUS_SB_CASEFOLD 4 |
---|
200 | 200 | #define HFSPLUS_SB_NOBARRIER 5 |
---|
| 201 | +#define HFSPLUS_SB_UID 6 |
---|
| 202 | +#define HFSPLUS_SB_GID 7 |
---|
201 | 203 | |
---|
202 | 204 | static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb) |
---|
203 | 205 | { |
---|
.. | .. |
---|
488 | 490 | struct hfsplus_fork_raw *fork); |
---|
489 | 491 | int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd); |
---|
490 | 492 | int hfsplus_cat_write_inode(struct inode *inode); |
---|
| 493 | +int hfsplus_getattr(const struct path *path, struct kstat *stat, |
---|
| 494 | + u32 request_mask, unsigned int query_flags); |
---|
491 | 495 | int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, |
---|
492 | 496 | int datasync); |
---|
493 | 497 | |
---|
.. | .. |
---|
531 | 535 | void **data, int op, int op_flags); |
---|
532 | 536 | int hfsplus_read_wrapper(struct super_block *sb); |
---|
533 | 537 | |
---|
534 | | -/* time macros */ |
---|
535 | | -#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) |
---|
536 | | -#define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U)) |
---|
| 538 | +/* |
---|
| 539 | + * time helpers: convert between 1904-base and 1970-base timestamps |
---|
| 540 | + * |
---|
| 541 | + * HFS+ implementations are highly inconsistent, this one matches the |
---|
| 542 | + * traditional behavior of 64-bit Linux, giving the most useful |
---|
| 543 | + * time range between 1970 and 2106, by treating any on-disk timestamp |
---|
| 544 | + * under HFSPLUS_UTC_OFFSET (Jan 1 1970) as a time between 2040 and 2106. |
---|
| 545 | + */ |
---|
| 546 | +#define HFSPLUS_UTC_OFFSET 2082844800U |
---|
| 547 | + |
---|
| 548 | +static inline time64_t __hfsp_mt2ut(__be32 mt) |
---|
| 549 | +{ |
---|
| 550 | + time64_t ut = (u32)(be32_to_cpu(mt) - HFSPLUS_UTC_OFFSET); |
---|
| 551 | + |
---|
| 552 | + return ut; |
---|
| 553 | +} |
---|
| 554 | + |
---|
| 555 | +static inline __be32 __hfsp_ut2mt(time64_t ut) |
---|
| 556 | +{ |
---|
| 557 | + return cpu_to_be32(lower_32_bits(ut) + HFSPLUS_UTC_OFFSET); |
---|
| 558 | +} |
---|
537 | 559 | |
---|
538 | 560 | /* compatibility */ |
---|
539 | | -#define hfsp_mt2ut(t) (struct timespec){ .tv_sec = __hfsp_mt2ut(t) } |
---|
| 561 | +#define hfsp_mt2ut(t) (struct timespec64){ .tv_sec = __hfsp_mt2ut(t) } |
---|
540 | 562 | #define hfsp_ut2mt(t) __hfsp_ut2mt((t).tv_sec) |
---|
541 | | -#define hfsp_now2mt() __hfsp_ut2mt(get_seconds()) |
---|
| 563 | +#define hfsp_now2mt() __hfsp_ut2mt(ktime_get_real_seconds()) |
---|
542 | 564 | |
---|
543 | 565 | #endif |
---|