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 94f77cce27fa..a8155ca4947f 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -302,4 +302,16 @@ static inline int ata_ok(u8 status)
302 == ATA_DRDY); 302 == ATA_DRDY);
303} 303}
304 304
305static inline int lba_28_ok(u64 block, u32 n_block)
306{
307 /* check the ending block number */
308 return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
309}
310
311static inline int lba_48_ok(u64 block, u32 n_block)
312{
313 /* check the ending block number */
314 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
315}
316
305#endif /* __LINUX_ATA_H__ */ 317#endif /* __LINUX_ATA_H__ */