Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branches 'work.misc' and 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull misc vfs updates from Al Viro:
"Misc cleanups from various folks all over the place

I expected more fs/dcache.c cleanups this cycle, so that went into a
separate branch. Said cleanups have missed the window, so in the
hindsight it could've gone into work.misc instead. Decided not to
cherry-pick, thus the 'work.dcache' branch"

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs: dcache: Use true and false for boolean values
fold generic_readlink() into its only caller
fs: shave 8 bytes off of struct inode
fs: Add more kernel-doc to the produced documentation
fs: Fix attr.c kernel-doc
removed extra extern file_fdatawait_range

* 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
kill dentry_update_name_case()

+57 -65
+33
Documentation/filesystems/index.rst
··· 71 71 .. kernel-doc:: fs/block_dev.c 72 72 :export: 73 73 74 + .. kernel-doc:: fs/anon_inodes.c 75 + :export: 76 + 77 + .. kernel-doc:: fs/attr.c 78 + :export: 79 + 80 + .. kernel-doc:: fs/d_path.c 81 + :export: 82 + 83 + .. kernel-doc:: fs/dax.c 84 + :export: 85 + 86 + .. kernel-doc:: fs/direct-io.c 87 + :export: 88 + 89 + .. kernel-doc:: fs/file_table.c 90 + :export: 91 + 92 + .. kernel-doc:: fs/libfs.c 93 + :export: 94 + 95 + .. kernel-doc:: fs/posix_acl.c 96 + :export: 97 + 98 + .. kernel-doc:: fs/stat.c 99 + :export: 100 + 101 + .. kernel-doc:: fs/sync.c 102 + :export: 103 + 104 + .. kernel-doc:: fs/xattr.c 105 + :export: 106 + 74 107 The proc filesystem 75 108 =================== 76 109
+3 -2
fs/attr.c
··· 120 120 * inode_newsize_ok - may this inode be truncated to a given size 121 121 * @inode: the inode to be truncated 122 122 * @offset: the new size to assign to the inode 123 - * @Returns: 0 on success, -ve errno on failure 124 123 * 125 124 * inode_newsize_ok must be called with i_mutex held. 126 125 * ··· 129 130 * returned. @inode must be a file (not directory), with appropriate 130 131 * permissions to allow truncate (inode_newsize_ok does NOT check these 131 132 * conditions). 133 + * 134 + * Return: 0 on success, -ve errno on failure 132 135 */ 133 136 int inode_newsize_ok(const struct inode *inode, loff_t offset) 134 137 { ··· 206 205 /** 207 206 * notify_change - modify attributes of a filesytem object 208 207 * @dentry: object affected 209 - * @iattr: new attributes 208 + * @attr: new attributes 210 209 * @delegated_inode: returns inode, if the inode is delegated 211 210 * 212 211 * The caller must hold the i_mutex on the affected object.
+6 -33
fs/dcache.c
··· 729 729 if (dentry->d_lockref.count > 1) { 730 730 dentry->d_lockref.count--; 731 731 spin_unlock(&dentry->d_lock); 732 - return 1; 732 + return true; 733 733 } 734 - return 0; 734 + return false; 735 735 } 736 736 737 737 /* 738 738 * If we weren't the last ref, we're done. 739 739 */ 740 740 if (ret) 741 - return 1; 741 + return true; 742 742 743 743 /* 744 744 * Careful, careful. The reference count went down ··· 767 767 768 768 /* Nothing to do? Dropping the reference was all we needed? */ 769 769 if (d_flags == (DCACHE_REFERENCED | DCACHE_LRU_LIST) && !d_unhashed(dentry)) 770 - return 1; 770 + return true; 771 771 772 772 /* 773 773 * Not the fast normal case? Get the lock. We've already decremented ··· 784 784 */ 785 785 if (dentry->d_lockref.count) { 786 786 spin_unlock(&dentry->d_lock); 787 - return 1; 787 + return true; 788 788 } 789 789 790 790 /* ··· 793 793 * set it to 1. 794 794 */ 795 795 dentry->d_lockref.count = 1; 796 - return 0; 796 + return false; 797 797 } 798 798 799 799 ··· 2647 2647 return NULL; 2648 2648 } 2649 2649 EXPORT_SYMBOL(d_exact_alias); 2650 - 2651 - /** 2652 - * dentry_update_name_case - update case insensitive dentry with a new name 2653 - * @dentry: dentry to be updated 2654 - * @name: new name 2655 - * 2656 - * Update a case insensitive dentry with new case of name. 2657 - * 2658 - * dentry must have been returned by d_lookup with name @name. Old and new 2659 - * name lengths must match (ie. no d_compare which allows mismatched name 2660 - * lengths). 2661 - * 2662 - * Parent inode i_mutex must be held over d_lookup and into this call (to 2663 - * keep renames and concurrent inserts, and readdir(2) away). 2664 - */ 2665 - void dentry_update_name_case(struct dentry *dentry, const struct qstr *name) 2666 - { 2667 - BUG_ON(!inode_is_locked(dentry->d_parent->d_inode)); 2668 - BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */ 2669 - 2670 - spin_lock(&dentry->d_lock); 2671 - write_seqcount_begin(&dentry->d_seq); 2672 - memcpy((unsigned char *)dentry->d_name.name, name->name, name->len); 2673 - write_seqcount_end(&dentry->d_seq); 2674 - spin_unlock(&dentry->d_lock); 2675 - } 2676 - EXPORT_SYMBOL(dentry_update_name_case); 2677 2650 2678 2651 static void swap_names(struct dentry *dentry, struct dentry *target) 2679 2652 {
+12 -24
fs/namei.c
··· 4655 4655 return len; 4656 4656 } 4657 4657 4658 - /* 4659 - * A helper for ->readlink(). This should be used *ONLY* for symlinks that 4660 - * have ->get_link() not calling nd_jump_link(). Using (or not using) it 4661 - * for any given inode is up to filesystem. 4662 - */ 4663 - static int generic_readlink(struct dentry *dentry, char __user *buffer, 4664 - int buflen) 4665 - { 4666 - DEFINE_DELAYED_CALL(done); 4667 - struct inode *inode = d_inode(dentry); 4668 - const char *link = inode->i_link; 4669 - int res; 4670 - 4671 - if (!link) { 4672 - link = inode->i_op->get_link(dentry, inode, &done); 4673 - if (IS_ERR(link)) 4674 - return PTR_ERR(link); 4675 - } 4676 - res = readlink_copy(buffer, buflen, link); 4677 - do_delayed_call(&done); 4678 - return res; 4679 - } 4680 - 4681 4658 /** 4682 4659 * vfs_readlink - copy symlink body into userspace buffer 4683 4660 * @dentry: dentry on which to get symbolic link ··· 4668 4691 int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen) 4669 4692 { 4670 4693 struct inode *inode = d_inode(dentry); 4694 + DEFINE_DELAYED_CALL(done); 4695 + const char *link; 4696 + int res; 4671 4697 4672 4698 if (unlikely(!(inode->i_opflags & IOP_DEFAULT_READLINK))) { 4673 4699 if (unlikely(inode->i_op->readlink)) ··· 4684 4704 spin_unlock(&inode->i_lock); 4685 4705 } 4686 4706 4687 - return generic_readlink(dentry, buffer, buflen); 4707 + link = inode->i_link; 4708 + if (!link) { 4709 + link = inode->i_op->get_link(dentry, inode, &done); 4710 + if (IS_ERR(link)) 4711 + return PTR_ERR(link); 4712 + } 4713 + res = readlink_copy(buffer, buflen, link); 4714 + do_delayed_call(&done); 4715 + return res; 4688 4716 } 4689 4717 EXPORT_SYMBOL(vfs_readlink); 4690 4718
-2
include/linux/dcache.h
··· 270 270 271 271 extern void d_add(struct dentry *, struct inode *); 272 272 273 - extern void dentry_update_name_case(struct dentry *, const struct qstr *); 274 - 275 273 /* used for rename() and baskets */ 276 274 extern void d_move(struct dentry *, struct dentry *); 277 275 extern void d_exchange(struct dentry *, struct dentry *);
+3 -4
include/linux/fs.h
··· 278 278 279 279 /* 280 280 * Write life time hint values. 281 + * Stored in struct inode as u8. 281 282 */ 282 283 enum rw_hint { 283 284 WRITE_LIFE_NOT_SET = 0, ··· 613 612 struct timespec64 i_ctime; 614 613 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 615 614 unsigned short i_bytes; 616 - unsigned int i_blkbits; 617 - enum rw_hint i_write_hint; 615 + u8 i_blkbits; 616 + u8 i_write_hint; 618 617 blkcnt_t i_blocks; 619 618 620 619 #ifdef __NEED_I_SIZE_ORDERED ··· 2638 2637 2639 2638 extern bool filemap_range_has_page(struct address_space *, loff_t lstart, 2640 2639 loff_t lend); 2641 - extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart, 2642 - loff_t lend); 2643 2640 extern int filemap_write_and_wait(struct address_space *mapping); 2644 2641 extern int filemap_write_and_wait_range(struct address_space *mapping, 2645 2642 loff_t lstart, loff_t lend);