aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 29fa99bde2be..8e88efc565be 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -313,4 +313,16 @@ static inline int ata_ok(u8 status)
313 == ATA_DRDY); 313 == ATA_DRDY);
314} 314}
315 315
316static inline int lba_28_ok(u64 block, u32 n_block)
317{
318 /* check the ending block number */
319 return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
320}
321
322static inline int lba_48_ok(u64 block, u32 n_block)
323{
324 /* check the ending block number */
325 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
326}
327
316#endif /* __LINUX_ATA_H__ */ 328#endif /* __LINUX_ATA_H__ */