fs: Move inotify.c from fs/notify/ to fs/vfs/

and merge fs/notify/notify.h into fs/vfs/vfs.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2025-06-22 15:19:47 +08:00
committed by Alan C. Assis
parent 1ea0ae8073
commit c9dc89142c
44 changed files with 79 additions and 200 deletions
+6 -2
View File
@@ -53,14 +53,18 @@ set(SRCS
fs_syncfs.c
fs_truncate.c)
# File notify support
if(CONFIG_FS_NOTIFY)
list(APPEND SRCS fs_inotify.c)
endif()
# File lock support
if(NOT "${CONFIG_FS_LOCK_BUCKET_SIZE}" STREQUAL "0")
list(APPEND SRCS fs_lock.c)
endif()
# Certain interfaces are not available if there is no mountpoint support
if(NOT "${CONFIG_PSEUDOFS_SOFTLINKS}" STREQUAL "0")
list(APPEND SRCS fs_link.c fs_symlink.c fs_readlink.c)
endif()
+21
View File
@@ -65,6 +65,27 @@ config SIGNAL_FD_NPOLLWAITERS
endif # SIGNAL_FD
config FS_NOTIFY
bool "FS Notify System"
default n
---help---
The Fsnotify System
if FS_NOTIFY
config FS_NOTIFY_BUCKET_SIZE
int "Dir hash bucket size"
default 64
config FS_NOTIFY_MAX_EVENTS
int "Max events in one notify device"
default 1024
config FS_NOTIFY_FD_POLLWAITERS
int "Max pollwaiters in one notify device"
default 2
endif # FS_NOTIFY
config FS_BACKTRACE
int "VFS backtrace"
default 0
+3 -1
View File
@@ -29,7 +29,9 @@ CSRCS += fs_rename.c fs_rmdir.c fs_select.c fs_sendfile.c fs_stat.c
CSRCS += fs_statfs.c fs_uio.c fs_unlink.c fs_write.c fs_dir.c fs_fsync.c
CSRCS += fs_syncfs.c fs_truncate.c
# Certain interfaces are not available if there is no mountpoint support
ifeq ($(CONFIG_FS_NOTIFY),y)
CSRCS += fs_inotify.c
endif
ifneq ($(CONFIG_FS_LOCK_BUCKET_SIZE),0)
CSRCS += fs_lock.c
-1
View File
@@ -39,7 +39,6 @@
# include <android/fdsan.h>
#endif
#include "notify/notify.h"
#include "inode/inode.h"
#include "sched/sched.h"
#include "vfs.h"
+1 -1
View File
@@ -33,8 +33,8 @@
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Private Functions
+1517
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -34,8 +34,8 @@
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -42,7 +42,7 @@
#include "sched/sched.h"
#include "inode/inode.h"
#include "driver/driver.h"
#include "notify/notify.h"
#include "vfs.h"
/****************************************************************************
* Private Functions
+1 -1
View File
@@ -40,8 +40,8 @@
#include <nuttx/lib/math32.h>
#include "inode/inode.h"
#include "notify/notify.h"
#include "fs_heap.h"
#include "vfs.h"
/****************************************************************************
* Private Types
+1 -1
View File
@@ -35,8 +35,8 @@
#include <nuttx/cancelpt.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Private Functions
+1 -1
View File
@@ -37,9 +37,9 @@
#include <nuttx/fs/fs.h>
#include <nuttx/lib/lib.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "fs_heap.h"
#include "vfs.h"
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -33,8 +33,8 @@
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -37,9 +37,9 @@
#include <nuttx/lib/lib.h>
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "fs_heap.h"
#include "vfs.h"
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -34,8 +34,8 @@
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Public Functions
+1 -1
View File
@@ -33,8 +33,8 @@
#include <nuttx/fs/fs.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -35,8 +35,8 @@
#include <nuttx/cancelpt.h>
#include "notify/notify.h"
#include "inode/inode.h"
#include "vfs.h"
/****************************************************************************
* Private Functions
+18
View File
@@ -27,6 +27,7 @@
* Included Files
****************************************************************************/
#include <nuttx/fs/fs.h>
#include <fcntl.h>
/****************************************************************************
@@ -105,4 +106,21 @@ int file_setlk(FAR struct file *filep, FAR struct flock *flock,
bool nonblock);
#endif /* CONFIG_FS_LOCK_BUCKET_SIZE */
#ifdef CONFIG_FS_NOTIFY
void notify_open(FAR const char *path, int oflags);
void notify_close(FAR const char *path, int oflags);
void notify_close2(FAR struct inode *inode);
void notify_read(FAR struct file *filep);
void notify_write(FAR struct file *filep);
void notify_chstat(FAR struct file *filep);
void notify_unlink(FAR const char *path);
void notify_unmount(FAR const char *path);
void notify_mkdir(FAR const char *path);
void notify_create(FAR const char *path);
void notify_rename(FAR const char *oldpath, bool oldisdir,
FAR const char *newpath, bool newisdir);
void notify_initialize(void);
#endif /* CONFIG_FS_NOTIFY */
#endif /* __FS_VFS_VFS_H */