VFS: Revert irrelevant dcache patches
Subsystems (15)
v2 cover VFS: Revert irrelevant dcache patches
These are some patches which were included in dcache during unionfs development but are not used, or partially used. These do not seem to be relevant to overlayfs either because overlay uses it's own flags to represent whiteouts. Fallthru was never used.
Changes since v1:
- Removed d_backing_inode() completely and replaced function calls with d_inode()
Regards,
Signature · 1 line
Goldwyn
PATCH v2 1/4 Revert: "VFS: Add a fallthrough flag for marking virtual dentries"
From: Goldwyn Rodrigues <[email protected]>
Reverts: commit df1a085af1f6 ("VFS: Add a fallthrough flag for marking virtual dentries")
No users of DCACHE_FALLTHRU.
--- fs/dcache.c | 20 ++------------------ include/linux/dcache.h | 9 --------- 2 files changed, 2 insertions(+), 27 deletions(-)
fs/dcache.c +2 -18
@@ -318,7 +318,7 @@ static inline void __d_set_inode_and_type(struct dentry *dentry, dentry->d_inode = inode; flags =READ_ONCE (dentry->d_flags); - flags &= ~(DCACHE_ENTRY_TYPE |DCACHE_FALLTHRU ); + flags &= ~DCACHE_ENTRY_TYPE ; flags |= type_flags;WRITE_ONCE (dentry->d_flags, flags); }
@@ -327,7 +327,7 @@ static inline void __d_clear_type_and_inode(struct dentry *dentry) {unsigned flags =READ_ONCE (dentry->d_flags); - flags &= ~(DCACHE_ENTRY_TYPE |DCACHE_FALLTHRU ); + flags &= ~DCACHE_ENTRY_TYPE ;WRITE_ONCE (dentry->d_flags, flags); dentry->d_inode =NULL ; }
@@ -1785,22 +1785,6 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) }EXPORT_SYMBOL (d_set_d_op); - -/* -* d_set_fallthru - Mark a dentry as falling through to a lower layer -* @dentry - The dentry to mark -* -* Mark a dentry as falling through to the lower layer (as set with -* d_pin_lower()). This flag may be recorded on the medium. -*/ -void d_set_fallthru (struct dentry *dentry) -{ -spin_lock (&dentry->d_lock); - dentry->d_flags |=DCACHE_FALLTHRU ; -spin_unlock (&dentry->d_lock); -} -EXPORT_SYMBOL (d_set_fallthru); -static unsigned d_flags_for_inode (struct inode *inode) {unsigned add_flags =DCACHE_REGULAR_TYPE ;
include/linux/dcache.h +0 -9
@@ -211,7 +211,6 @@ struct dentry_operations {#define DCACHE_SYMLINK_TYPE 0x00600000/* Symlink (or fallthru to such) */ #define DCACHE_MAY_FREE 0x00800000 -#define DCACHE_FALLTHRU 0x01000000/* Fall through to lower layer */ #define DCACHE_ENCRYPTED_WITH_KEY 0x02000000/* dir is encrypted with a valid key */ #define DCACHE_OP_REAL 0x04000000
@@ -493,14 +492,6 @@ static inline int simple_positive(const struct dentry *dentry)return d_really_is_positive (dentry) && !d_unhashed (dentry); } -extern void d_set_fallthru (struct dentry *dentry); - -static inline bool d_is_fallthru (const struct dentry *dentry) -{ -return dentry->d_flags &DCACHE_FALLTHRU ; -} - -extern int sysctl_vfs_cache_pressure;static inline unsigned long vfs_pressure_ratio (unsigned long val)
Signature · 1 line
2.16.4
PATCH v2 2/4 Revert: "VFS: Add a whiteout dentry type"
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
Reverts commit e7f7d2253c05 ("VFS: Add a whiteout dentry type") No users of DCACHE_WHITEOUT_TYPE.
--- include/linux/dcache.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
include/linux/dcache.h +5 -16
@@ -202,13 +202,13 @@ struct dentry_operations {#define DCACHE_LRU_LIST 0x00080000#define DCACHE_ENTRY_TYPE 0x00700000 -#define DCACHE_MISS_TYPE 0x00000000/* Negative dentry (maybe fallthru to nowhere) */ +#define DCACHE_MISS_TYPE 0x00000000/* Negative dentry */ #define DCACHE_WHITEOUT_TYPE 0x00100000/* Whiteout dentry (stop pathwalk) */ #define DCACHE_DIRECTORY_TYPE 0x00200000/* Normal directory */ #define DCACHE_AUTODIR_TYPE 0x00300000/* Lookupless directory (presumed automount) */ -#define DCACHE_REGULAR_TYPE 0x00400000/* Regular file type (or fallthru to such) */ -#define DCACHE_SPECIAL_TYPE 0x00500000/* Other file type (or fallthru to such) */ -#define DCACHE_SYMLINK_TYPE 0x00600000/* Symlink (or fallthru to such) */ +#define DCACHE_REGULAR_TYPE 0x00400000/* Regular file type */ +#define DCACHE_SPECIAL_TYPE 0x00500000/* Other file type */ +#define DCACHE_SYMLINK_TYPE 0x00600000/* Symlink */ #define DCACHE_MAY_FREE 0x00800000#define DCACHE_ENCRYPTED_WITH_KEY 0x02000000/* dir is encrypted with a valid key */
@@ -393,16 +393,6 @@ static inline unsigned __d_entry_type(const struct dentry *dentry)return dentry->d_flags &DCACHE_ENTRY_TYPE ; } -static inline bool d_is_miss (const struct dentry *dentry) -{ -return __d_entry_type (dentry) ==DCACHE_MISS_TYPE ; -} - -static inline bool d_is_whiteout (const struct dentry *dentry) -{ -return __d_entry_type (dentry) ==DCACHE_WHITEOUT_TYPE ; -} -static inline bool d_can_lookup (const struct dentry *dentry) {return __d_entry_type (dentry) ==DCACHE_DIRECTORY_TYPE ;
@@ -440,8 +430,7 @@ static inline bool d_is_file(const struct dentry *dentry)static inline bool d_is_negative (const struct dentry *dentry) { -// TODO: check d_is_whiteout(dentry) also. -return d_is_miss (dentry); +return __d_entry_type (dentry) ==DCACHE_MISS_TYPE ; }static inline bool d_is_positive (const struct dentry *dentry)
Signature · 1 line
2.16.4
PATCH v2 3/4 Eliminate d_backing_dentry()
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
d_backing_dentry() is not used.
--- include/linux/dcache.h | 15 --------------- 1 file changed, 15 deletions(-)
include/linux/dcache.h +0 -15
@@ -529,21 +529,6 @@ static inline struct inode *d_backing_inode(const struct dentry *upper)return inode; } -/** -* d_backing_dentry - Get upper or lower dentry we should be using -* @upper: The upper layer -* -* This is the helper that should be used to get the dentry of the inode that -* will be used if this dentry were opened as a file. It may be the upper -* dentry or it may be a lower dentry pinned by the upper. -* -* Normal filesystems should not use this to access their own dentries. -*/ -static inline struct dentry *d_backing_dentry (struct dentry *upper) -{ -return upper; -} -/* d_real() flags */ #define D_REAL_UPPER 0x2/* return upper dentry or NULL if non-upper */
Signature · 1 line
2.16.4
PATCH v2 4/4 VFS: eliminate d_backing_inode()
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
d_backing_inode() returns dentry->d_inode, just as d_inode() Convert all d_backing_inode() to d_inode().
Though this patch is big, it just changes all calls of d_backing_inode() to d_inode(). Let me know if this needs to be split.
--- fs/block_dev.c | 2 +- fs/cachefiles/bind.c | 6 ++-- fs/cachefiles/interface.c | 4 +-- fs/cachefiles/namei.c | 56 +++++++++++++++++------------------ fs/cachefiles/rdwr.c | 14 ++++----- fs/cachefiles/security.c | 6 ++-- fs/cachefiles/xattr.c | 26 ++++++++-------- fs/namei.c | 14 ++++----- fs/open.c | 6 ++-- fs/posix_acl.c | 2 +- fs/stat.c | 4 +-- fs/udf/symlink.c | 2 +- include/linux/dcache.h | 19 +----------- kernel/audit_tree.c | 4 +-- kernel/audit_watch.c | 10 +++---- kernel/auditsc.c | 6 ++-- kernel/bpf/inode.c | 4 +-- net/unix/af_unix.c | 6 ++-- net/unix/diag.c | 2 +- security/apparmor/file.c | 6 ++-- security/apparmor/lsm.c | 10 +++---- security/commoncap.c | 8 ++--- security/integrity/evm/evm_crypto.c | 4 +-- security/integrity/evm/evm_main.c | 14 ++++----- security/integrity/ima/ima_appraise.c | 8 ++--- security/lsm_audit.c | 4 +-- security/security.c | 48 +++++++++++++++--------------- security/selinux/hooks.c | 18 +++++------ security/smack/smack_lsm.c | 46 ++++++++++++++-------------- security/tomoyo/condition.c | 2 +- security/tomoyo/realpath.c | 10 +++---- 31 files changed, 177 insertions(+), 194 deletions(-)
fs/block_dev.c +1 -1
@@ -2086,7 +2086,7 @@ struct block_device *lookup_bdev(const char *pathname)if (error)return ERR_PTR (error); - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); error = -ENOTBLK ;if (!S_ISBLK (inode->i_mode)) goto fail;
fs/cachefiles/bind.c +3 -3
@@ -125,9 +125,9 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)/* check parameters */ ret = -EOPNOTSUPP ;if (d_is_negative (root) || - !d_backing_inode (root)->i_op->lookup || - !d_backing_inode (root)->i_op->mkdir || - !(d_backing_inode (root)->i_opflags &IOP_XATTR ) || + !d_inode (root)->i_op->lookup || + !d_inode (root)->i_op->mkdir || + !(d_inode (root)->i_opflags &IOP_XATTR ) || !root->d_sb->s_op->statfs || !root->d_sb->s_op->sync_fs) goto error_unsupported;
fs/cachefiles/interface.c +2 -2
@@ -295,7 +295,7 @@ static void cachefiles_drop_object(struct fscache_object *_object) _object != cache->cache.fsdef ) {_debug ("- retire object OBJ%x" , object->fscache.debug_id); - inode =d_backing_inode (object->dentry); + inode =d_inode (object->dentry);if (inode) i_blocks = inode->i_blocks;
@@ -460,7 +460,7 @@ static int cachefiles_attr_changed(struct fscache_object *_object)fscache_set_store_limit (&object->fscache, ni_size); - oi_size =i_size_read (d_backing_inode (object->backer)); + oi_size =i_size_read (d_inode (object->backer));if (oi_size == ni_size)return 0 ;
fs/cachefiles/namei.c +28 -28
162 lines not on this page · raw message
fs/cachefiles/rdwr.c +7 -7
@@ -74,12 +74,12 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,static int cachefiles_read_reissue (struct cachefiles_object *object,struct cachefiles_one_read *monitor) { -struct address_space *bmapping =d_backing_inode (object->backer)->i_mapping; +struct address_space *bmapping =d_inode (object->backer)->i_mapping;struct page *backpage = monitor->back_page, *backpage2;int ret;_enter ("{ino=%lx},{%lx,%lx}" , -d_backing_inode (object->backer)->i_ino, +d_inode (object->backer)->i_ino, backpage->index, backpage->flags);/* skip if the page was truncated away completely */
@@ -157,7 +157,7 @@ static void cachefiles_read_copier(struct fscache_operation *_op) object =container_of (op->op.object, struct cachefiles_object, fscache); -_enter ("{ino=%lu}" ,d_backing_inode (object->backer)->i_ino); +_enter ("{ino=%lu}" ,d_inode (object->backer)->i_ino); max =8 ;spin_lock_irq (&object->work_lock);
@@ -247,7 +247,7 @@ static int cachefiles_read_backing_file_one(struct cachefiles_object *object,init_waitqueue_func_entry (&monitor->monitor, cachefiles_read_waiter);/* attempt to get hold of the backing page */ - bmapping =d_backing_inode (object->backer)->i_mapping; + bmapping =d_inode (object->backer)->i_mapping; newpage =NULL ;for (;;) {
@@ -407,7 +407,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,if (!object->backer) goto enobufs; - inode =d_backing_inode (object->backer); + inode =d_inode (object->backer);ASSERT (S_ISREG (inode->i_mode));ASSERT (inode->i_mapping->a_ops->bmap);ASSERT (inode->i_mapping->a_ops->readpages);
@@ -464,7 +464,7 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object, struct list_head *list) {struct cachefiles_one_read *monitor =NULL ; -struct address_space *bmapping =d_backing_inode (object->backer)->i_mapping; +struct address_space *bmapping =d_inode (object->backer)->i_mapping;struct page *newpage =NULL , *netpage, *_n, *backpage =NULL ;int ret =0 ;
@@ -700,7 +700,7 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,if (cachefiles_has_space (cache,0 , *nr_pages) <0 ) space =0 ; - inode =d_backing_inode (object->backer); + inode =d_inode (object->backer);ASSERT (S_ISREG (inode->i_mode));ASSERT (inode->i_mapping->a_ops->bmap);ASSERT (inode->i_mapping->a_ops->readpages);
fs/cachefiles/security.c +3 -3
@@ -55,14 +55,14 @@ static int cachefiles_check_cache_dir(struct cachefiles_cache *cache, {int ret; - ret =security_inode_mkdir (d_backing_inode (root), root,0 ); + ret =security_inode_mkdir (d_inode (root), root,0 );if (ret <0 ) {pr_err ("Security denies permission to make dirs: error %d" , ret);return ret; } - ret =security_inode_create (d_backing_inode (root), root,0 ); + ret =security_inode_create (d_inode (root), root,0 );if (ret <0 )pr_err ("Security denies permission to create files: error %d" , ret);
@@ -95,7 +95,7 @@ int cachefiles_determine_cache_security(struct cachefiles_cache *cache,/* use the cache root dir's security context as the basis with * which create files */ - ret =set_create_files_as (new,d_backing_inode (root)); + ret =set_create_files_as (new,d_inode (root));if (ret <0 ) {abort_creds (new);cachefiles_begin_secure (cache, _saved_cred);
fs/cachefiles/xattr.c +13 -13
@@ -33,7 +33,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)int ret;ASSERT (dentry); -ASSERT (d_backing_inode (dentry)); +ASSERT (d_inode (dentry));if (!object->fscache.cookie)strcpy (type,"C3" );
@@ -52,7 +52,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)if (ret != -EEXIST ) {pr_err ("Can't set xattr on %pd [%lu] (err %d)\n" , - dentry,d_backing_inode (dentry)->i_ino, + dentry,d_inode (dentry)->i_ino, -ret); goto error; }
@@ -64,7 +64,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object) goto bad_type_length;pr_err ("Can't read xattr on %pd [%lu] (err %d)\n" , - dentry,d_backing_inode (dentry)->i_ino, + dentry,d_inode (dentry)->i_ino, -ret); goto error; }
@@ -84,14 +84,14 @@ int cachefiles_check_object_type(struct cachefiles_object *object) bad_type_length:pr_err ("Cache object %lu type xattr length incorrect\n" , -d_backing_inode (dentry)->i_ino); +d_inode (dentry)->i_ino); ret = -EIO ; goto error; bad_type: xtype[2 ] =0 ;pr_err ("Cache object %pd [%lu] type %s not %s\n" , - dentry,d_backing_inode (dentry)->i_ino, + dentry,d_inode (dentry)->i_ino, xtype, type); ret = -EIO ; goto error;
@@ -167,7 +167,7 @@ int cachefiles_check_auxdata(struct cachefiles_object *object)int ret;ASSERT (dentry); -ASSERT (d_backing_inode (dentry)); +ASSERT (d_inode (dentry));ASSERT (object->fscache.cookie->def->check_aux); auxbuf =kmalloc (sizeof (struct cachefiles_xattr ) +512 ,GFP_KERNEL );
@@ -183,7 +183,7 @@ int cachefiles_check_auxdata(struct cachefiles_object *object) xlen--; validity =fscache_check_aux (&object->fscache, &auxbuf->data, xlen, -i_size_read (d_backing_inode (dentry))); +i_size_read (d_inode (dentry)));if (validity !=FSCACHE_CHECKAUX_OKAY ) goto error;
@@ -207,7 +207,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,_enter ("%p,#%d" , object, auxdata->len);ASSERT (dentry); -ASSERT (d_backing_inode (dentry)); +ASSERT (d_inode (dentry)); auxbuf =kmalloc (sizeof (struct cachefiles_xattr ) +512 , cachefiles_gfp);if (!auxbuf) {
@@ -228,7 +228,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,cachefiles_io_error_obj (object,"Can't read xattr on %lu (err %d)" , -d_backing_inode (dentry)->i_ino, -ret); +d_inode (dentry)->i_ino, -ret); goto error; }
@@ -253,7 +253,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object, result =fscache_check_aux (&object->fscache, &auxbuf->data, dlen, -i_size_read (d_backing_inode (dentry))); +i_size_read (d_inode (dentry)));switch (result) {/* entry okay as is */
@@ -280,7 +280,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,cachefiles_io_error_obj (object,"Can't update xattr on %lu" " (error %d)" , -d_backing_inode (dentry)->i_ino, -ret); +d_inode (dentry)->i_ino, -ret); goto error; } }
@@ -295,7 +295,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object, bad_type_length:pr_err ("Cache object %lu xattr length incorrect\n" , -d_backing_inode (dentry)->i_ino); +d_inode (dentry)->i_ino); ret = -EIO ; goto error;
@@ -320,7 +320,7 @@ int cachefiles_remove_object_xattr(struct cachefiles_cache *cache,cachefiles_io_error (cache,"Can't remove xattr from %lu" " (error %d)" , -d_backing_inode (dentry)->i_ino, -ret); +d_inode (dentry)->i_ino, -ret); }_leave (" = %d" , ret);
fs/namei.c +7 -7
@@ -1538,7 +1538,7 @@ static int lookup_fast(struct nameidata *nd,* This sequence count validates that the inode matches * the dentry name information from lookup. */ - *inode =d_backing_inode (dentry); + *inode =d_inode (dentry); negative =d_is_negative (dentry);if (unlikely (read_seqcount_retry (&dentry->d_seq, seq)))return -ECHILD ;
@@ -1593,7 +1593,7 @@ static int lookup_fast(struct nameidata *nd, path->dentry = dentry; err =follow_managed (path, nd);if (likely (err >0 )) - *inode =d_backing_inode (path->dentry); + *inode =d_inode (path->dentry);return err; }
@@ -1782,7 +1782,7 @@ static int walk_component(struct nameidata *nd, int flags) } seq =0 ;/* we are already out of RCU mode */ - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); }return step_into (nd, &path, flags, inode, seq);
@@ -2257,7 +2257,7 @@ static int handle_lookup_down(struct nameidata *nd) err =follow_managed (&path, nd);if (unlikely (err <0 ))return err; - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); seq =0 ; }path_to_nameidata (&path, nd);
@@ -2649,7 +2649,7 @@ mountpoint_last(struct nameidata *nd)return -ENOENT ; } path.mnt = nd->path.mnt; -return step_into (nd, &path,0 ,d_backing_inode (path.dentry),0 ); +return step_into (nd, &path,0 ,d_inode (path.dentry),0 ); }/**
@@ -2770,7 +2770,7 @@ EXPORT_SYMBOL(__check_sticky);*/ static int may_delete (struct inode *dir,struct dentry *victim,bool isdir) { -struct inode *inode =d_backing_inode (victim); +struct inode *inode =d_inode (victim);int error;if (d_is_negative (victim))
@@ -3365,7 +3365,7 @@ static int do_last(struct nameidata *nd, } seq =0 ;/* out of RCU mode, so the value doesn't matter */ - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); finish_lookup: error =step_into (nd, &path,0 , inode, seq);if (unlikely (error))
fs/open.c +3 -3
@@ -390,7 +390,7 @@ long do_faccessat(int dfd, const char __user *filename, int mode)if (res) goto out; - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry);if ((mode &MAY_EXEC ) &&S_ISREG (inode->i_mode)) {/*
@@ -854,7 +854,7 @@ int finish_open(struct file *file, struct dentry *dentry,BUG_ON (*opened &FILE_OPENED );/* once it's opened, it's opened */ file->f_path.dentry = dentry; - error =do_dentry_open (file,d_backing_inode (dentry), open, + error =do_dentry_open (file,d_inode (dentry), open,current_cred ());if (!error) *opened |=FILE_OPENED ;
@@ -905,7 +905,7 @@ int vfs_open(const struct path *path, struct file *file,return PTR_ERR (dentry); file->f_path = *path; -return do_dentry_open (file,d_backing_inode (dentry),NULL , cred); +return do_dentry_open (file,d_inode (dentry),NULL , cred); } struct file *dentry_open(const struct path *path, int flags,
fs/posix_acl.c +1 -1
@@ -897,7 +897,7 @@ posix_acl_xattr_set(const struct xattr_handler *handler,static bool posix_acl_xattr_list (struct dentry *dentry) { -return IS_POSIXACL (d_backing_inode (dentry)); +return IS_POSIXACL (d_inode (dentry)); }const struct xattr_handler posix_acl_access_xattr_handler = {
fs/stat.c +2 -2
@@ -69,7 +69,7 @@ EXPORT_SYMBOL(generic_fillattr);int vfs_getattr_nosec (const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) { -struct inode *inode =d_backing_inode (path->dentry); +struct inode *inode =d_inode (path->dentry);memset (stat,0 ,sizeof (*stat)); stat->result_mask |=STATX_BASIC_STATS ;
@@ -393,7 +393,7 @@ static int do_readlinkat(int dfd, const char __user *pathname, retry: error =user_path_at_empty (dfd, pathname, lookup_flags, &path, &empty);if (!error) { -struct inode *inode =d_backing_inode (path.dentry); +struct inode *inode =d_inode (path.dentry); error = empty ? -ENOENT : -EINVAL ;/*
fs/udf/symlink.c +1 -1
@@ -156,7 +156,7 @@ static int udf_symlink_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags) {struct dentry *dentry = path->dentry; -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct page *page;generic_fillattr (inode, stat);
include/linux/dcache.h +1 -18
@@ -512,23 +512,6 @@ static inline struct inode *d_inode_rcu(const struct dentry *dentry)return READ_ONCE (dentry->d_inode); } -/** -* d_backing_inode - Get upper or lower inode we should be using -* @upper: The upper layer -* -* This is the helper that should be used to get at the inode that will be used -* if this dentry were to be opened as a file. The inode may be on the upper -* dentry or it may be on a lower dentry pinned by the upper. -* -* Normal filesystems should not use this to access their own inodes. -*/ -static inline struct inode *d_backing_inode (const struct dentry *upper) -{ -struct inode *inode = upper->d_inode; - -return inode; -} -/* d_real() flags */ #define D_REAL_UPPER 0x2/* return upper dentry or NULL if non-upper */
@@ -564,7 +547,7 @@ static inline struct dentry *d_real(struct dentry *dentry,static inline struct inode *d_real_inode (const struct dentry *dentry) {/* This usage of d_real() results in const dentry */ -return d_backing_inode (d_real ((struct dentry *) dentry,NULL ,0 ,0 )); +return d_inode (d_real ((struct dentry *) dentry,NULL ,0 ,0 )); }struct name_snapshot {
kernel/audit_tree.c +2 -2
@@ -620,7 +620,7 @@ int audit_remove_tree_rule(struct audit_krule *rule)static int compare_root (struct vfsmount *mnt,void *arg) { -return inode_to_key (d_backing_inode (mnt->mnt_root)) == +return inode_to_key (d_inode (mnt->mnt_root)) == (unsigned long )arg; }
@@ -694,7 +694,7 @@ void audit_put_tree(struct audit_tree *tree)static int tag_mount (struct vfsmount *mnt,void *arg) { -return tag_chunk (d_backing_inode (mnt->mnt_root), arg); +return tag_chunk (d_inode (mnt->mnt_root), arg); }/*
kernel/audit_watch.c +5 -5
@@ -148,7 +148,7 @@ int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev)/* Initialize a parent watch entry. */ static struct audit_parent *audit_init_parent (struct path *path) { -struct inode *inode =d_backing_inode (path->dentry); +struct inode *inode =d_inode (path->dentry);struct audit_parent *parent;int ret;
@@ -365,11 +365,11 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent)struct dentry *d =kern_path_locked (watch->path, parent);if (IS_ERR (d))return PTR_ERR (d); -inode_unlock (d_backing_inode (parent->dentry)); +inode_unlock (d_inode (parent->dentry));if (d_is_positive (d)) {/* update watch filter fields */ watch->dev = d->d_sb->s_dev; - watch->ino =d_backing_inode (d)->i_ino; + watch->ino =d_inode (d)->i_ino; }dput (d);return 0 ;
@@ -431,7 +431,7 @@ int audit_add_watch(struct audit_krule *krule, struct list_head **list)return ret;/* either find an old parent or attach a new one */ - parent =audit_find_parent (d_backing_inode (parent_path.dentry)); + parent =audit_find_parent (d_inode (parent_path.dentry));if (!parent) { parent =audit_init_parent (&parent_path);if (IS_ERR (parent)) {
@@ -486,7 +486,7 @@ static int audit_watch_handle_event(struct fsnotify_group *group,switch (data_type) {case (FSNOTIFY_EVENT_PATH ): - inode =d_backing_inode (((const struct path *)data)->dentry); + inode =d_inode (((const struct path *)data)->dentry);break ;case (FSNOTIFY_EVENT_INODE ): inode = (const struct inode *)data;
kernel/auditsc.c +3 -3
@@ -1645,7 +1645,7 @@ static void handle_path(const struct dentry *dentry)rcu_read_lock (); seq =read_seqbegin (&rename_lock);for (;;) { -struct inode *inode =d_backing_inode (d); +struct inode *inode =d_inode (d);if (inode &&unlikely (inode->i_fsnotify_marks)) {struct audit_chunk *chunk; chunk =audit_tree_lookup (inode);
@@ -1770,7 +1770,7 @@ void __audit_inode(struct filename *name, const struct dentry *dentry, unsigned int flags) {struct audit_context *context =audit_context (); -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct audit_names *n;bool parent = flags &AUDIT_INODE_PARENT ;
@@ -1869,7 +1869,7 @@ void __audit_inode_child(struct inode *parent, const unsigned char type) {struct audit_context *context =audit_context (); -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);const char *dname = dentry->d_name.name;struct audit_names *n, *found_parent =NULL , *found_child =NULL ;struct audit_entry *e;
kernel/bpf/inode.c +2 -2
@@ -456,7 +456,7 @@ static void *bpf_obj_do_get(const struct filename *pathname,if (ret)return ERR_PTR (ret); - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); ret =inode_permission (inode,ACC_MODE (flags));if (ret) goto out;
@@ -543,7 +543,7 @@ struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type typint ret =kern_path (name,LOOKUP_FOLLOW , &path);if (ret)return ERR_PTR (ret); - prog =__get_prog_inode (d_backing_inode (path.dentry), type); + prog =__get_prog_inode (d_inode (path.dentry), type);if (!IS_ERR (prog))touch_atime (&path);path_put (&path);
net/unix/af_unix.c +3 -3
@@ -316,7 +316,7 @@ static struct sock *unix_find_socket_byinode(struct inode *i) &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {struct dentry *dentry =unix_sk (s)->path.dentry; -if (dentry &&d_backing_inode (dentry) == i) { +if (dentry &&d_inode (dentry) == i) {sock_hold (s); goto found; }
@@ -904,7 +904,7 @@ static struct sock *unix_find_other(struct net *net, err =kern_path (sunname->sun_path,LOOKUP_FOLLOW , &path);if (err) goto fail; - inode =d_backing_inode (path.dentry); + inode =d_inode (path.dentry); err =inode_permission (inode,MAY_WRITE );if (err) goto put_fail;
@@ -1034,7 +1034,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)if (sun_path[0 ]) { addr->hash =UNIX_HASH_SIZE ; - hash =d_backing_inode (path.dentry)->i_ino & (UNIX_HASH_SIZE -1 ); + hash =d_inode (path.dentry)->i_ino & (UNIX_HASH_SIZE -1 );spin_lock (&unix_table_lock); u->path = path; list = &unix_socket_table[hash];
net/unix/diag.c +1 -1
@@ -25,7 +25,7 @@ static int sk_diag_dump_vfs(struct sock *sk, struct sk_buff *nlskb)if (dentry) {struct unix_diag_vfs uv = { - .udiag_vfs_ino =d_backing_inode (dentry)->i_ino, + .udiag_vfs_ino =d_inode (dentry)->i_ino, .udiag_vfs_dev = dentry->d_sb->s_dev, };
security/apparmor/file.c +3 -3
@@ -161,7 +161,7 @@ int aa_audit_file(struct aa_profile *profile, struct aa_perms *perms,*/ static inline bool is_deleted (struct dentry *dentry) { -if (d_unlinked (dentry) &&d_backing_inode (dentry)->i_nlink ==0 ) +if (d_unlinked (dentry) &&d_inode (dentry)->i_nlink ==0 )return 1 ;return 0 ; }
@@ -470,8 +470,8 @@ int aa_path_link(struct aa_label *label, struct dentry *old_dentry,struct path link = { .mnt = new_dir->mnt, .dentry = new_dentry };struct path target = { .mnt = new_dir->mnt, .dentry = old_dentry };struct path_cond cond = { -d_backing_inode (old_dentry)->i_uid, -d_backing_inode (old_dentry)->i_mode +d_inode (old_dentry)->i_uid, +d_inode (old_dentry)->i_mode };char *buffer =NULL , *buffer2 =NULL ;struct aa_profile *profile;
security/apparmor/lsm.c +5 -5
@@ -220,8 +220,8 @@ static int common_perm(const char *op, const struct path *path, u32 mask,*/ static int common_perm_cond (const char *op,const struct path *path,u32 mask) { -struct path_cond cond = {d_backing_inode (path->dentry)->i_uid, -d_backing_inode (path->dentry)->i_mode +struct path_cond cond = {d_inode (path->dentry)->i_uid, +d_inode (path->dentry)->i_mode };if (!path_mediated_fs (path->dentry))
@@ -261,7 +261,7 @@ static int common_perm_dir_dentry(const char *op, const struct path *dir,static int common_perm_rm (const char *op,const struct path *dir,struct dentry *dentry,u32 mask) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct path_cond cond = { };if (!inode || !path_mediated_fs (dentry))
@@ -361,8 +361,8 @@ static int apparmor_path_rename(const struct path *old_dir, struct dentry *old_d .dentry = old_dentry };struct path new_path = { .mnt = new_dir->mnt, .dentry = new_dentry }; -struct path_cond cond = {d_backing_inode (old_dentry)->i_uid, -d_backing_inode (old_dentry)->i_mode +struct path_cond cond = {d_inode (old_dentry)->i_uid, +d_inode (old_dentry)->i_mode }; error = aa_path_perm(OP_RENAME_SRC, label, &old_path, 0,
security/commoncap.c +4 -4
@@ -301,7 +301,7 @@ int cap_capset(struct cred *new,*/ int cap_inode_need_killpriv (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);int error; error =__vfs_getxattr (dentry, inode,XATTR_NAME_CAPS ,NULL ,0 );
@@ -486,7 +486,7 @@ int cap_convert_nscap(struct dentry *dentry, void **ivalue, size_t size)uid_t nsrootid;const struct vfs_cap_data *cap = *ivalue;__u32 magic, nsmagic; -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct user_namespace *task_ns =current_user_ns (), *fs_ns = inode->i_sb->s_user_ns;kuid_t rootid;
@@ -577,7 +577,7 @@ static inline int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps,*/ int get_vfs_caps_from_disk (const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);__u32 magic_etc;unsigned tocopy, i;int size;
@@ -960,7 +960,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)if (strcmp (name,XATTR_NAME_CAPS ) ==0 ) {/* security.capability gets namespaced */ -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);if (!inode)return -EINVAL ;if (!capable_wrt_inode_uidgid (inode,CAP_SETFCAP ))
security/integrity/evm/evm_crypto.c +2 -2
@@ -191,7 +191,7 @@ static int evm_calc_hmac_or_hash(struct dentry *dentry,size_t req_xattr_value_len, char type, char *digest) { - struct inode *inode = d_backing_inode(dentry); + struct inode *inode = d_inode(dentry);struct xattr_list *xattr;struct shash_desc *desc;size_t xattr_size =0 ;
@@ -302,7 +302,7 @@ static int evm_is_immutable(struct dentry *dentry, struct inode *inode)int evm_update_evmxattr (struct dentry *dentry,const char *xattr_name,const char *xattr_value,size_t xattr_value_len) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct evm_ima_xattr_data xattr_data;int rc =0 ;
security/integrity/evm/evm_main.c +7 -7
@@ -93,7 +93,7 @@ static bool evm_key_loaded(void)static int evm_find_protected_xattrs (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct xattr_list *xattr;int error;int count =0 ;
@@ -191,7 +191,7 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry, (const char *)xattr_data, xattr_len, calc.digest, sizeof(calc.digest));if (!rc) { - inode =d_backing_inode (dentry); + inode =d_inode (dentry);if (xattr_data->type ==EVM_XATTR_PORTABLE_DIGSIG ) {if (iint)
@@ -270,7 +270,7 @@ enum integrity_status evm_verifyxattr(struct dentry *dentry,return INTEGRITY_UNKNOWN ;if (!iint) { - iint =integrity_iint_find (d_backing_inode (dentry)); + iint =integrity_iint_find (d_inode (dentry));if (!iint)return INTEGRITY_UNKNOWN ; }
@@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(evm_verifyxattr);*/ static enum integrity_status evm_verify_current_integrity (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);if (!evm_key_loaded () || !S_ISREG (inode->i_mode) || evm_fixmode)return 0 ;
@@ -329,7 +329,7 @@ static int evm_protect_xattr(struct dentry *dentry, const char *xattr_name,if (evm_status ==INTEGRITY_NOXATTRS ) {struct integrity_iint_cache *iint; - iint =integrity_iint_find (d_backing_inode (dentry)); + iint =integrity_iint_find (d_inode (dentry));if (iint && (iint->flags &IMA_NEW_FILE ))return 0 ;
@@ -346,7 +346,7 @@ static int evm_protect_xattr(struct dentry *dentry, const char *xattr_name, } out:if (evm_status !=INTEGRITY_PASS ) -integrity_audit_msg (AUDIT_INTEGRITY_METADATA ,d_backing_inode (dentry), +integrity_audit_msg (AUDIT_INTEGRITY_METADATA ,d_inode (dentry), dentry->d_name.name,"appraise_metadata" , integrity_status_msg[evm_status], -EPERM ,0 );
@@ -485,7 +485,7 @@ int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)if ((evm_status ==INTEGRITY_PASS ) || (evm_status ==INTEGRITY_NOXATTRS ))return 0 ; -integrity_audit_msg (AUDIT_INTEGRITY_METADATA ,d_backing_inode (dentry), +integrity_audit_msg (AUDIT_INTEGRITY_METADATA ,d_inode (dentry), dentry->d_name.name,"appraise_metadata" , integrity_status_msg[evm_status], -EPERM ,0 );return -EPERM ;
security/integrity/ima/ima_appraise.c +4 -4
@@ -217,7 +217,7 @@ int ima_appraise_measurement(enum ima_hooks func,static const char op[] ="appraise_data" ;const char *cause ="unknown" ;struct dentry *dentry =file_dentry (file); -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);enum integrity_status status =INTEGRITY_UNKNOWN ;int rc = xattr_len, hash_start =0 ;
@@ -382,7 +382,7 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)*/ void ima_inode_post_setattr (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct integrity_iint_cache *iint;int action;
@@ -446,7 +446,7 @@ int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,if (result ==1 ) {if (!xattr_value_len || (xvalue->type >=IMA_XATTR_LAST ))return -EINVAL ; -ima_reset_appraise_flags (d_backing_inode (dentry), +ima_reset_appraise_flags (d_inode (dentry), xvalue->type ==EVM_IMA_XATTR_DIGSIG ); result =0 ; }
@@ -459,7 +459,7 @@ int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name) result =ima_protect_xattr (dentry, xattr_name,NULL ,0 );if (result ==1 ) { -ima_reset_appraise_flags (d_backing_inode (dentry),0 ); +ima_reset_appraise_flags (d_inode (dentry),0 ); result =0 ; }return result;
security/lsm_audit.c +2 -2
@@ -237,7 +237,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,audit_log_d_path (ab," path=" , &a->u.path); - inode =d_backing_inode (a->u.path.dentry); + inode =d_inode (a->u.path.dentry);if (inode) {audit_log_format (ab," dev=" );audit_log_untrustedstring (ab, inode->i_sb->s_id);
@@ -279,7 +279,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,audit_log_format (ab," name=" );audit_log_untrustedstring (ab, a->u.dentry->d_name.name); - inode =d_backing_inode (a->u.dentry); + inode =d_inode (a->u.dentry);if (inode) {audit_log_format (ab," dev=" );audit_log_untrustedstring (ab, inode->i_sb->s_id);
security/security.c +24 -24
180 lines not on this page · raw message
security/selinux/hooks.c +9 -9
@@ -325,7 +325,7 @@ static struct inode_security_struct *inode_security(struct inode *inode)static struct inode_security_struct *backing_inode_security_novalidate (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);return inode->i_security; }
@@ -335,7 +335,7 @@ static struct inode_security_struct *backing_inode_security_novalidate(struct de*/ static struct inode_security_struct *backing_inode_security (struct dentry *dentry) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);__inode_security_revalidate (inode, dentry, true);return inode->i_security;
@@ -520,7 +520,7 @@ static int sb_finish_set_opts(struct super_block *sb) {struct superblock_security_struct *sbsec = sb->s_security;struct dentry *root = sb->s_root; -struct inode *root_inode =d_backing_inode (root); +struct inode *root_inode =d_inode (root);int rc =0 ;if (sbsec->behavior ==SECURITY_FS_USE_XATTR ) {
@@ -1832,7 +1832,7 @@ static inline int dentry_has_perm(const struct cred *cred, struct dentry *dentry, u32 av) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct common_audit_data ad; ad.type =LSM_AUDIT_DATA_DENTRY ;
@@ -1848,7 +1848,7 @@ static inline int path_has_perm(const struct cred *cred, const struct path *path, u32 av) { -struct inode *inode =d_backing_inode (path->dentry); +struct inode *inode =d_inode (path->dentry);struct common_audit_data ad; ad.type =LSM_AUDIT_DATA_PATH ;
@@ -2254,7 +2254,7 @@ static int selinux_binder_transfer_file(struct task_struct *from,return rc;#endif -if (unlikely (IS_PRIVATE (d_backing_inode (dentry)))) +if (unlikely (IS_PRIVATE (d_inode (dentry))))return 0 ; isec =backing_inode_security (dentry);
@@ -3209,7 +3209,7 @@ static int selinux_inode_permission(struct inode *inode, int mask)static int selinux_inode_setattr (struct dentry *dentry,struct iattr *iattr) {const struct cred *cred =current_cred (); -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);unsigned int ia_valid = iattr->ia_valid;__u32 av =FILE__WRITE ;
@@ -3254,7 +3254,7 @@ static bool has_cap_mac_admin(bool audit)static int selinux_inode_setxattr (struct dentry *dentry,const char *name,const void *value,size_t size,int flags) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);struct inode_security_struct *isec;struct superblock_security_struct *sbsec;struct common_audit_data ad;
@@ -3344,7 +3344,7 @@ static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags) { - struct inode *inode = d_backing_inode(dentry); + struct inode *inode = d_inode(dentry);struct inode_security_struct *isec;u32 newsid;int rc;
security/smack/smack_lsm.c +23 -23
125 lines not on this page · raw message
security/tomoyo/condition.c +1 -1
@@ -715,7 +715,7 @@ void tomoyo_get_attributes(struct tomoyo_obj_info *obj) dentry =dget_parent (dentry);break ; } - inode =d_backing_inode (dentry); + inode =d_inode (dentry);if (inode) {struct tomoyo_mini_stat *stat = &obj->stat[i]; stat->uid = inode->i_uid;
security/tomoyo/realpath.c +5 -5
@@ -98,7 +98,7 @@ static char *tomoyo_get_absolute_path(const struct path *path, char * const buff/* go to whatever namespace root we are under */ pos =d_absolute_path (path, buffer, buflen -1 );if (!IS_ERR (pos) && *pos =='/' && pos[1 ]) { -struct inode *inode =d_backing_inode (path->dentry); +struct inode *inode =d_inode (path->dentry);if (inode &&S_ISDIR (inode->i_mode)) { buffer[buflen -2 ] ='/' ; buffer[buflen -1 ] ='\0' ;
@@ -126,7 +126,7 @@ static char *tomoyo_get_dentry_path(struct dentry *dentry, char * const buffer,if (buflen >=256 ) { pos =dentry_path_raw (dentry, buffer, buflen -1 );if (!IS_ERR (pos) && *pos =='/' && pos[1 ]) { -struct inode *inode =d_backing_inode (dentry); +struct inode *inode =d_inode (dentry);if (inode &&S_ISDIR (inode->i_mode)) { buffer[buflen -2 ] ='/' ; buffer[buflen -1 ] ='\0' ;
@@ -169,7 +169,7 @@ static char *tomoyo_get_local_path(struct dentry *dentry, char * const buffer,if (!MAJOR (sb->s_dev)) goto prepend_filesystem_name; { -struct inode *inode =d_backing_inode (sb->s_root); +struct inode *inode =d_inode (sb->s_root);/* * Use filesystem name if filesystem does not support rename() * operation.
@@ -220,7 +220,7 @@ static char *tomoyo_get_local_path(struct dentry *dentry, char * const buffer,static char *tomoyo_get_socket_name (const struct path *path,char *const buffer,const int buflen) { -struct inode *inode =d_backing_inode (path->dentry); +struct inode *inode =d_inode (path->dentry);struct socket *sock = inode ?SOCKET_I (inode) :NULL ;struct sock *sk = sock ? sock->sk :NULL ;if (sk) {
@@ -278,7 +278,7 @@ char *tomoyo_realpath_from_path(const struct path *path) pos = dentry->d_op->d_dname (dentry, buf, buf_len -1 ); goto encode; } - inode =d_backing_inode (sb->s_root); + inode =d_inode (sb->s_root);/* * Get local name for filesystems without rename() operation * or dentry without vfsmount.
Signature · 1 line
2.16.4