Lines Matching refs:dev

1196  * @dev:	a pointer to the NTFS_DEVICE to open
1199 * @dev->d_name must hold the device name, the rest is ignored.
1206 static int ntfs_device_win32_open(struct ntfs_device *dev, int flags)
1214 if (NDevOpen(dev)) {
1219 numparams = sscanf(dev->d_name, "/dev/hd%c%u", &drive_char, &part);
1221 && (dev->d_name[1] == ':')
1222 && (dev->d_name[2] == '\0')) {
1223 drive_char = dev->d_name[0];
1229 ntfs_log_debug("win32_open(%s) -> file.\n", dev->d_name);
1230 err = ntfs_device_win32_open_file(dev->d_name, &fd, flags);
1233 ntfs_log_debug("win32_open(%s) -> drive %d.\n", dev->d_name,
1239 dev->d_name, drive_id, part);
1245 dev->d_name, drive_char);
1251 dev->d_name);
1256 ntfs_log_debug("win32_open(%s) -> %p, offset 0x%llx.\n", dev->d_name,
1257 dev, fd.part_start);
1260 NDevSetReadOnly(dev);
1261 dev->d_private = (win32_fd*)ntfs_malloc(sizeof(win32_fd));
1262 memcpy(dev->d_private, &fd, sizeof(win32_fd));
1263 NDevSetOpen(dev);
1264 NDevClearDirty(dev);
1270 * @dev: ntfs device obtained via ->open
1282 static s64 ntfs_device_win32_seek(struct ntfs_device *dev, s64 offset,
1286 win32_fd *fd = (win32_fd *)dev->d_private;
1436 * @dev: ntfs device obtained via ->open
1443 static s64 ntfs_device_win32_read(struct ntfs_device *dev, void *b, s64 count)
1446 win32_fd *fd = (win32_fd *)dev->d_private;
1525 * @dev: ntfs device obtained via ->open
1530 static int ntfs_device_win32_close(struct ntfs_device *dev)
1532 win32_fd *fd = (win32_fd *)dev->d_private;
1535 ntfs_log_trace("Closing device %p.\n", dev);
1536 if (!NDevOpen(dev)) {
1541 if (!NDevReadOnly(dev)) {
1553 NDevClearOpen(dev);
1568 * @dev: ntfs device obtained via ->open
1576 static int ntfs_device_win32_sync(struct ntfs_device *dev)
1581 if (!NDevReadOnly(dev) && NDevDirty(dev)) {
1582 win32_fd *fd = (win32_fd *)dev->d_private;
1599 NDevClearDirty(dev);
1628 * @dev: ntfs device obtained via ->open
1635 static s64 ntfs_device_win32_write(struct ntfs_device *dev, const void *b,
1639 win32_fd *fd = (win32_fd *)dev->d_private;
1658 if (NDevReadOnly(dev)) {
1665 NDevSetDirty(dev);
1760 * @dev: ntfs device obtained via ->open
1768 static int ntfs_device_win32_stat(struct ntfs_device *dev, struct stat *buf)
1770 win32_fd *fd = (win32_fd *)dev->d_private;
1773 if ((dev->d_name[1] == ':') && (dev->d_name[2] == '\0'))
1802 * @dev: ntfs device obtained via ->open
1810 static __inline__ int ntfs_win32_hdio_getgeo(struct ntfs_device *dev,
1813 win32_fd *fd = (win32_fd *)dev->d_private;
1825 * @dev: ntfs device obtained via ->open
1833 static __inline__ int ntfs_win32_blksszget(struct ntfs_device *dev,int *argp)
1835 win32_fd *fd = (win32_fd *)dev->d_private;
1850 static int ntfs_device_win32_ioctl(struct ntfs_device *dev,
1854 win32_fd *fd = (win32_fd *)dev->d_private;
1882 return ntfs_win32_hdio_getgeo(dev, (struct hd_geometry *)argp);
1891 return ntfs_win32_blksszget(dev, (int *)argp);
1906 static s64 ntfs_device_win32_pread(struct ntfs_device *dev, void *b,
1913 fd = (win32_fd*)dev->d_private;
1917 if (ntfs_device_win32_seek(dev, offset, 0) == -1)
1920 got = ntfs_device_win32_read(dev, b, count);
1926 static s64 ntfs_device_win32_pwrite(struct ntfs_device *dev, const void *b,
1933 fd = (win32_fd*)dev->d_private;
1937 if (ntfs_device_win32_seek(dev, offset, 0) == -1)
1940 put = ntfs_device_win32_write(dev, b, count);
2020 int ntfs_device_win32_ftruncate(struct ntfs_device *dev, s64 size)
2026 fd = (win32_fd*)dev->d_private;