| .. | .. |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | #include "blocklayoutxdr.h" |
|---|
| 17 | 17 | #include "pnfs.h" |
|---|
| 18 | +#include "filecache.h" |
|---|
| 18 | 19 | |
|---|
| 19 | 20 | #define NFSDDBG_FACILITY NFSDDBG_PNFS |
|---|
| 20 | 21 | |
|---|
| .. | .. |
|---|
| 82 | 83 | bex->soff = iomap.addr; |
|---|
| 83 | 84 | break; |
|---|
| 84 | 85 | } |
|---|
| 85 | | - /*FALLTHRU*/ |
|---|
| 86 | + fallthrough; |
|---|
| 86 | 87 | case IOMAP_HOLE: |
|---|
| 87 | 88 | if (seg->iomode == IOMODE_READ) { |
|---|
| 88 | 89 | bex->es = PNFS_BLOCK_NONE_DATA; |
|---|
| 89 | 90 | break; |
|---|
| 90 | 91 | } |
|---|
| 91 | | - /*FALLTHRU*/ |
|---|
| 92 | + fallthrough; |
|---|
| 92 | 93 | case IOMAP_DELALLOC: |
|---|
| 93 | 94 | default: |
|---|
| 94 | 95 | WARN(1, "pnfsd: filesystem returned %d extent\n", iomap.type); |
|---|
| .. | .. |
|---|
| 121 | 122 | { |
|---|
| 122 | 123 | loff_t new_size = lcp->lc_last_wr + 1; |
|---|
| 123 | 124 | struct iattr iattr = { .ia_valid = 0 }; |
|---|
| 124 | | - struct timespec ts; |
|---|
| 125 | 125 | int error; |
|---|
| 126 | 126 | |
|---|
| 127 | | - ts = timespec64_to_timespec(inode->i_mtime); |
|---|
| 128 | 127 | if (lcp->lc_mtime.tv_nsec == UTIME_NOW || |
|---|
| 129 | | - timespec_compare(&lcp->lc_mtime, &ts) < 0) |
|---|
| 130 | | - lcp->lc_mtime = timespec64_to_timespec(current_time(inode)); |
|---|
| 128 | + timespec64_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) |
|---|
| 129 | + lcp->lc_mtime = current_time(inode); |
|---|
| 131 | 130 | iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; |
|---|
| 132 | | - iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = timespec_to_timespec64(lcp->lc_mtime); |
|---|
| 131 | + iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; |
|---|
| 133 | 132 | |
|---|
| 134 | 133 | if (new_size > i_size_read(inode)) { |
|---|
| 135 | 134 | iattr.ia_valid |= ATTR_SIZE; |
|---|
| .. | .. |
|---|
| 171 | 170 | struct nfs4_client *clp, |
|---|
| 172 | 171 | struct nfsd4_getdeviceinfo *gdp) |
|---|
| 173 | 172 | { |
|---|
| 174 | | - if (sb->s_bdev != sb->s_bdev->bd_contains) |
|---|
| 173 | + if (bdev_is_partition(sb->s_bdev)) |
|---|
| 175 | 174 | return nfserr_inval; |
|---|
| 176 | 175 | return nfserrno(nfsd4_block_get_device_info_simple(sb, gdp)); |
|---|
| 177 | 176 | } |
|---|
| .. | .. |
|---|
| 383 | 382 | struct nfs4_client *clp, |
|---|
| 384 | 383 | struct nfsd4_getdeviceinfo *gdp) |
|---|
| 385 | 384 | { |
|---|
| 386 | | - if (sb->s_bdev != sb->s_bdev->bd_contains) |
|---|
| 385 | + if (bdev_is_partition(sb->s_bdev)) |
|---|
| 387 | 386 | return nfserr_inval; |
|---|
| 388 | 387 | return nfserrno(nfsd4_block_get_device_info_scsi(sb, clp, gdp)); |
|---|
| 389 | 388 | } |
|---|
| .. | .. |
|---|
| 406 | 405 | nfsd4_scsi_fence_client(struct nfs4_layout_stateid *ls) |
|---|
| 407 | 406 | { |
|---|
| 408 | 407 | struct nfs4_client *clp = ls->ls_stid.sc_client; |
|---|
| 409 | | - struct block_device *bdev = ls->ls_file->f_path.mnt->mnt_sb->s_bdev; |
|---|
| 408 | + struct block_device *bdev = ls->ls_file->nf_file->f_path.mnt->mnt_sb->s_bdev; |
|---|
| 410 | 409 | |
|---|
| 411 | 410 | bdev->bd_disk->fops->pr_ops->pr_preempt(bdev, NFSD_MDS_PR_KEY, |
|---|
| 412 | 411 | nfsd4_scsi_pr_key(clp), 0, true); |
|---|