drivers/loop: Move drivers/loop.c to drivers/loop/losetup.c

This commit is contained in:
Gregory Nutt
2015-11-25 16:23:19 -06:00
parent e665b3dba8
commit b84da6e696
6 changed files with 86 additions and 23 deletions
+1 -7
View File
@@ -27,13 +27,7 @@ config DEV_RANDOM
default n default n
depends on ARCH_HAVE_RNG depends on ARCH_HAVE_RNG
config LOOP source drivers/loop/Kconfig
bool "Enable loop device"
default n
---help---
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
menu "Buffering" menu "Buffering"
+2 -1
View File
@@ -55,6 +55,7 @@ include bch$(DELIM)Make.defs
include input$(DELIM)Make.defs include input$(DELIM)Make.defs
include discrete$(DELIM)Make.defs include discrete$(DELIM)Make.defs
include lcd$(DELIM)Make.defs include lcd$(DELIM)Make.defs
include loop$(DELIM)Make.defs
include mmcsd$(DELIM)Make.defs include mmcsd$(DELIM)Make.defs
include mtd$(DELIM)Make.defs include mtd$(DELIM)Make.defs
include eeprom$(DELIM)Make.defs include eeprom$(DELIM)Make.defs
@@ -76,7 +77,7 @@ ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
CSRCS += dev_null.c dev_zero.c CSRCS += dev_null.c dev_zero.c
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
CSRCS += ramdisk.c loop.c CSRCS += ramdisk.c
ifeq ($(CONFIG_DRVR_WRITEBUFFER),y) ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
CSRCS += rwbuffer.c CSRCS += rwbuffer.c
else else
+16 -13
View File
@@ -21,11 +21,6 @@ dev_null.c and dev_zero.c
want to register these devices (devnull_register() and want to register these devices (devnull_register() and
devzero_register()). devzero_register()).
loop.c
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
pwm.c pwm.c
Provides the "upper half" of a pulse width modulation (PWM) driver. Provides the "upper half" of a pulse width modulation (PWM) driver.
The "lower half" of the PWM driver is provided by device-specific The "lower half" of the PWM driver is provided by device-specific
@@ -36,18 +31,10 @@ ramdisk.c
a block driver that can be mounted as a files system. See a block driver that can be mounted as a files system. See
include/nuttx/fs/ramdisk.h. include/nuttx/fs/ramdisk.h.
timer.c
Provides the "upper half" for a generic timer driver. See
include/nuttx/timers/timer.h for more information.
rwbuffer.c rwbuffer.c
A facility that can be use by any block driver in-order to add A facility that can be use by any block driver in-order to add
writing buffering and read-ahead buffering. writing buffering and read-ahead buffering.
watchdog.c
Provides the "upper half" for a generic watchdog driver. See
include/nuttx/timers/watchdog.h for more information.
Subdirectories of this directory: Subdirectories of this directory:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,6 +81,11 @@ lcd/
Drivers for parallel and serial LCD and OLED type devices. These Drivers for parallel and serial LCD and OLED type devices. These
drivers support interfaces as defined in include/nuttx/lcd/lcd.h drivers support interfaces as defined in include/nuttx/lcd/lcd.h
loop/
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
mmcsd/ mmcsd/
Support for MMC/SD block drivers. MMC/SD block drivers based on Support for MMC/SD block drivers. MMC/SD block drivers based on
SPI and SDIO/MCI interfaces are supported. See include/nuttx/mmcsd.h SPI and SDIO/MCI interfaces are supported. See include/nuttx/mmcsd.h
@@ -153,6 +145,17 @@ spi/
syslog/ syslog/
System logging devices. See include/syslog.h and include/nuttx/syslog/syslog.h System logging devices. See include/syslog.h and include/nuttx/syslog/syslog.h
timers/
Includes support for various timer devices including:
- An "upper half" for a generic timer driver. See
include/nuttx/timers/timer.h for more information.
- An "upper half" for a generic watchdog driver. See
include/nuttx/timers/watchdog.h for more information.
- RTC drivers
usbdev/ usbdev/
USB device drivers. See also include/nuttx/usb/usbdev.h USB device drivers. See also include/nuttx/usb/usbdev.h
+11
View File
@@ -0,0 +1,11 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config LOOP
bool "Enable loop device"
default n
---help---
Supports the standard loop device that can be used to export a
file (or character device) as a block device.
+54
View File
@@ -0,0 +1,54 @@
############################################################################
# drivers/loop/Make.defs
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# Loop device can only be used with mountpoint support
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
# Include loop device support
ifneq ($(CONFIG_LOOP),y)
# CSRCS += loop.c
endif
CSRCS += losetup.c
# Add loop devicer build support
DEPPATH += --dep-path loop
VPATH += :loop
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)loop}
endif
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* drivers/loop.c * drivers/losetup.c
* *
* Copyright (C) 2008-2009, 2011, 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009, 2011, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without