mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: vfs: add d_prune dentry operation vfs: protect i_nlink filesystems: add set_nlink() filesystems: add missing nlink wrappers logfs: remove unnecessary nlink setting ocfs2: remove unnecessary nlink setting jfs: remove unnecessary nlink setting hypfs: remove unnecessary nlink setting vfs: ignore error on forced remount readlinkat: ensure we return ENOENT for the empty pathname for normal lookups vfs: fix dentry leak in simple_fill_super()
This commit is contained in:
commit
d211858837
108 changed files with 301 additions and 235 deletions
|
|
@ -165,6 +165,7 @@ struct dentry_operations {
|
|||
unsigned int, const char *, const struct qstr *);
|
||||
int (*d_delete)(const struct dentry *);
|
||||
void (*d_release)(struct dentry *);
|
||||
void (*d_prune)(struct dentry *);
|
||||
void (*d_iput)(struct dentry *, struct inode *);
|
||||
char *(*d_dname)(struct dentry *, char *, int);
|
||||
struct vfsmount *(*d_automount)(struct path *);
|
||||
|
|
@ -184,8 +185,9 @@ struct dentry_operations {
|
|||
#define DCACHE_OP_COMPARE 0x0002
|
||||
#define DCACHE_OP_REVALIDATE 0x0004
|
||||
#define DCACHE_OP_DELETE 0x0008
|
||||
#define DCACHE_OP_PRUNE 0x0010
|
||||
|
||||
#define DCACHE_DISCONNECTED 0x0010
|
||||
#define DCACHE_DISCONNECTED 0x0020
|
||||
/* This dentry is possibly not currently connected to the dcache tree, in
|
||||
* which case its parent will either be itself, or will have this flag as
|
||||
* well. nfsd will not use a dentry with this bit set, but will first
|
||||
|
|
@ -196,8 +198,8 @@ struct dentry_operations {
|
|||
* dentry into place and return that dentry rather than the passed one,
|
||||
* typically using d_splice_alias. */
|
||||
|
||||
#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */
|
||||
#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */
|
||||
#define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */
|
||||
#define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */
|
||||
|
||||
#define DCACHE_CANT_MOUNT 0x0100
|
||||
#define DCACHE_GENOCIDE 0x0200
|
||||
|
|
|
|||
|
|
@ -768,7 +768,17 @@ struct inode {
|
|||
|
||||
/* Stat data, not accessed from path walking */
|
||||
unsigned long i_ino;
|
||||
unsigned int i_nlink;
|
||||
/*
|
||||
* Filesystems may only read i_nlink directly. They shall use the
|
||||
* following functions for modification:
|
||||
*
|
||||
* (set|clear|inc|drop)_nlink
|
||||
* inode_(inc|dec)_link_count
|
||||
*/
|
||||
union {
|
||||
const unsigned int i_nlink;
|
||||
unsigned int __i_nlink;
|
||||
};
|
||||
dev_t i_rdev;
|
||||
struct timespec i_atime;
|
||||
struct timespec i_mtime;
|
||||
|
|
@ -1754,6 +1764,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
|
|||
__mark_inode_dirty(inode, I_DIRTY_SYNC);
|
||||
}
|
||||
|
||||
/**
|
||||
* set_nlink - directly set an inode's link count
|
||||
* @inode: inode
|
||||
* @nlink: new nlink (should be non-zero)
|
||||
*
|
||||
* This is a low-level filesystem helper to replace any
|
||||
* direct filesystem manipulation of i_nlink.
|
||||
*/
|
||||
static inline void set_nlink(struct inode *inode, unsigned int nlink)
|
||||
{
|
||||
inode->__i_nlink = nlink;
|
||||
}
|
||||
|
||||
/**
|
||||
* inc_nlink - directly increment an inode's link count
|
||||
* @inode: inode
|
||||
|
|
@ -1764,7 +1787,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
|
|||
*/
|
||||
static inline void inc_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink++;
|
||||
inode->__i_nlink++;
|
||||
}
|
||||
|
||||
static inline void inode_inc_link_count(struct inode *inode)
|
||||
|
|
@ -1786,7 +1809,7 @@ static inline void inode_inc_link_count(struct inode *inode)
|
|||
*/
|
||||
static inline void drop_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink--;
|
||||
inode->__i_nlink--;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1799,7 +1822,7 @@ static inline void drop_nlink(struct inode *inode)
|
|||
*/
|
||||
static inline void clear_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink = 0;
|
||||
inode->__i_nlink = 0;
|
||||
}
|
||||
|
||||
static inline void inode_dec_link_count(struct inode *inode)
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
|
|||
#define LOOKUP_EMPTY 0x4000
|
||||
|
||||
extern int user_path_at(int, const char __user *, unsigned, struct path *);
|
||||
extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
|
||||
|
||||
#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path)
|
||||
#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue