I am writing a stackable file system which would rename unlinked files to a particular folder say abc by default. So as any file /xyz is unlinked its renamed to /abc/xyz. I want to do this by overriding the unlink function of stackable file system. I am using wrapfs so I am modifying wrapfs_unlink for this. I have dentry of the unlinked file also I have inode of parent directory , now I need to have inode of /abc and dentry of /abc/xyz to call vfs_rename instead of vfs_unlink. I could find the dentry and vfsmount for the / so I have a dentry for / but I don't know how to get the dentry/inode of /abc I know I can get inode from dentry but I cannot get dentry also. I tried using lookup_one_len /abc is created but still it returns a negative inode , also I tried to use vfs_path_lookup to find the directory /abc it also returns an error. Am I using wrong functions? Or these methods see cache only not the actual directory structure ? Please help.
lookup a directory in kernel module
1k Views Asked by gaurav At
1
There are 1 best solutions below
Related Questions in LINUX
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
- How to offload NAPI poll function to workqueue
- python netifaces - How to get currently used network interface
- Unexpected output from function
- mingw-64 conflicting declarations when cross-compiling
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
Related Questions in FILESYSTEMS
- What kernel level functions are called when we perform write in ext3 file system?
- How to save a file to desired location in c++?
- MongoDB over Traditional File Based System
- How to reliably detect that an atomic move of a directory failed because the target already exists
- Meteor - Create a new folder in the public directory on account creation
- Storing images in MSSQL vs Disk
- Why segment files into chunks for HTTP streaming?
- Difference between stdout and /dev/stdout
- find and remove all closed files that are not modified in some-time
- TypeScript + Node.js FileSystem issue
- Scan folders with non English letters in a given directory
- unknown field 'ioctl' specified in initializer
- how can i encrypt every file with a different key using encFS
- How is a file loaded in the FAT file system?
- Ext.device.filesystem.FileEntry.read() - type: "text" returns blank file
Related Questions in LINUX-KERNEL
- kernel module does not print packet info
- android linux kernel communicate with user space about NETLINK_USER
- How to offload NAPI poll function to workqueue
- Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?
- Bootloader in Assembly with Linux kernel
- pktgen not sending packets more than 1kb big
- Use static analysis tools to check null pointers and memory leaks in Linux device drivers
- How to build Linux kernel to support SO_ATTACH_BPF socket option?
- How do I know the last sched time of a process
- linux kernel compile error....udevd[63]: error getting socket
- Process in background mode trying to read from stdin
- board firmware update through uefi capsule feature from Linux
- spin_lock before writing status register
- Kernel module configuration locked built in?
- Install Subversion 1.7 on Debian jessie
Related Questions in KERNEL-MODULE
- Insmod is not working
- Different privileges in kernel module execution
- "Segmentation fault" when `rmmod` or `modprobe -r`
- Intercept ELF loader in linux kernel: fs/binfmt_elf.c file via loadable kernel module
- Best way to handle ERESTARTSYS in kthread?
- In linux every process is given a 4GB of virtual address space considering a 32-bit architecture
- Missing headers for kernel in bzImage loaded on qemu
- A better way than printk() to leave a kernel module log?
- Unknown symbol in module
- How to call make kernel module calls or disable interrupts?
- insmod not throwing error for a positive return
- Cannot understand what "error: initializer element is not constant" means
- Why is the probe function in my kernel module not being called?
- How to identify *.ko file given CONFIG_* name?
- Example of use pwm_get() in linux kernel
Related Questions in VFS
- wso2 proxy vfs to vfs - two dependant files
- filp_open not working with O_RDWR or O_WRONLY
- How deletion of an opened file works internally?
- FileSystemManager getTime on FTP
- How to get all files present from UNC path java?
- How to change a file that used to be a directory back to directory on linux?
- Why can't I open a JBoss vfs:/ URL?
- Reading an on-disk inode to in-memory
- VFS: file-max limit 1231582 reached
- VFS SFTP upload sending directory structure, not just file
- lookup a directory in kernel module
- Inode vs Vnode Difference
- linux kernel when is file descriptor not accessible by pread?
- How to properly clear VFS Ram filesystem
- WSO2 How to set VFS to a scheduled task
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use the following code to move an object into the trash at unlink.