https://github.com/torvalds/linux
Revision a9c9a6f741cdaa2fa9ba24a790db8d07295761e3 authored by Linus Torvalds on 02 September 2021, 22:09:46 UTC, committed by Linus Torvalds on 02 September 2021, 22:09:46 UTC
Pull SCSI updates from James Bottomley:
 "This series consists of the usual driver updates (ufs, qla2xxx,
  target, smartpqi, lpfc, mpt3sas).

  The core change causing the most churn was replacing the command
  request field request with a macro, allowing us to offset map to it
  and remove the redundant field; the same was also done for the tag
  field.

  The most impactful change is the final removal of scsi_ioctl, which
  has been deprecated for over a decade"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (293 commits)
  scsi: ufs: Fix ufshcd_request_sense_async() for Samsung KLUFG8RHDA-B2D1
  scsi: ufs: ufs-exynos: Fix static checker warning
  scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI
  scsi: lpfc: Use the proper SCSI midlayer interfaces for PI
  scsi: lpfc: Copyright updates for 14.0.0.1 patches
  scsi: lpfc: Update lpfc version to 14.0.0.1
  scsi: lpfc: Add bsg support for retrieving adapter cmf data
  scsi: lpfc: Add cmf_info sysfs entry
  scsi: lpfc: Add debugfs support for cm framework buffers
  scsi: lpfc: Add support for maintaining the cm statistics buffer
  scsi: lpfc: Add rx monitoring statistics
  scsi: lpfc: Add support for the CM framework
  scsi: lpfc: Add cmfsync WQE support
  scsi: lpfc: Add support for cm enablement buffer
  scsi: lpfc: Add cm statistics buffer support
  scsi: lpfc: Add EDC ELS support
  scsi: lpfc: Expand FPIN and RDF receive logging
  scsi: lpfc: Add MIB feature enablement support
  scsi: lpfc: Add SET_HOST_DATA mbox cmd to pass date/time info to firmware
  scsi: fc: Add EDC ELS definition
  ...
2 parent s 23852be + 9b5ac8a
Raw File
Tip revision: a9c9a6f741cdaa2fa9ba24a790db8d07295761e3 authored by Linus Torvalds on 02 September 2021, 22:09:46 UTC
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Tip revision: a9c9a6f
fs_types.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/fs.h>
#include <linux/export.h>

/*
 * fs on-disk file type to dirent file type conversion
 */
static const unsigned char fs_dtype_by_ftype[FT_MAX] = {
	[FT_UNKNOWN]	= DT_UNKNOWN,
	[FT_REG_FILE]	= DT_REG,
	[FT_DIR]	= DT_DIR,
	[FT_CHRDEV]	= DT_CHR,
	[FT_BLKDEV]	= DT_BLK,
	[FT_FIFO]	= DT_FIFO,
	[FT_SOCK]	= DT_SOCK,
	[FT_SYMLINK]	= DT_LNK
};

/**
 * fs_ftype_to_dtype() - fs on-disk file type to dirent type.
 * @filetype: The on-disk file type to convert.
 *
 * This function converts the on-disk file type value (FT_*) to the directory
 * entry type (DT_*).
 *
 * Context: Any context.
 * Return:
 * * DT_UNKNOWN		- Unknown type
 * * DT_FIFO		- FIFO
 * * DT_CHR		- Character device
 * * DT_DIR		- Directory
 * * DT_BLK		- Block device
 * * DT_REG		- Regular file
 * * DT_LNK		- Symbolic link
 * * DT_SOCK		- Local-domain socket
 */
unsigned char fs_ftype_to_dtype(unsigned int filetype)
{
	if (filetype >= FT_MAX)
		return DT_UNKNOWN;

	return fs_dtype_by_ftype[filetype];
}
EXPORT_SYMBOL_GPL(fs_ftype_to_dtype);

/*
 * dirent file type to fs on-disk file type conversion
 * Values not initialized explicitly are FT_UNKNOWN (0).
 */
static const unsigned char fs_ftype_by_dtype[DT_MAX] = {
	[DT_REG]	= FT_REG_FILE,
	[DT_DIR]	= FT_DIR,
	[DT_LNK]	= FT_SYMLINK,
	[DT_CHR]	= FT_CHRDEV,
	[DT_BLK]	= FT_BLKDEV,
	[DT_FIFO]	= FT_FIFO,
	[DT_SOCK]	= FT_SOCK,
};

/**
 * fs_umode_to_ftype() - file mode to on-disk file type.
 * @mode: The file mode to convert.
 *
 * This function converts the file mode value to the on-disk file type (FT_*).
 *
 * Context: Any context.
 * Return:
 * * FT_UNKNOWN		- Unknown type
 * * FT_REG_FILE	- Regular file
 * * FT_DIR		- Directory
 * * FT_CHRDEV		- Character device
 * * FT_BLKDEV		- Block device
 * * FT_FIFO		- FIFO
 * * FT_SOCK		- Local-domain socket
 * * FT_SYMLINK		- Symbolic link
 */
unsigned char fs_umode_to_ftype(umode_t mode)
{
	return fs_ftype_by_dtype[S_DT(mode)];
}
EXPORT_SYMBOL_GPL(fs_umode_to_ftype);

/**
 * fs_umode_to_dtype() - file mode to dirent file type.
 * @mode: The file mode to convert.
 *
 * This function converts the file mode value to the directory
 * entry type (DT_*).
 *
 * Context: Any context.
 * Return:
 * * DT_UNKNOWN		- Unknown type
 * * DT_FIFO		- FIFO
 * * DT_CHR		- Character device
 * * DT_DIR		- Directory
 * * DT_BLK		- Block device
 * * DT_REG		- Regular file
 * * DT_LNK		- Symbolic link
 * * DT_SOCK		- Local-domain socket
 */
unsigned char fs_umode_to_dtype(umode_t mode)
{
	return fs_ftype_to_dtype(fs_umode_to_ftype(mode));
}
EXPORT_SYMBOL_GPL(fs_umode_to_dtype);
back to top