Skip to contentSkip to conversation

Documentation/filesystems: fix documentation for ->getattr()

PATCH In review Eric Biggers 2 participants 2 messages Mar 11, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation/filesystems: fix documentation for ->getattr()

From: Eric Biggers <[email protected]>

Following the recent merge of statx, correct the documented prototype for the ->getattr() inode operation, and add an entry to the porting file.

---
 Documentation/filesystems/Locking | 3 +--
 Documentation/filesystems/porting | 6 ++++++
 Documentation/filesystems/vfs.txt | 3 +--
 3 files changed, 8 insertions(+), 4 deletions(-)
Documentation/filesystems/Locking +1 -2
index fdcfdd79682a..fe25787ff6d4 100644
@@ -58,8 +58,7 @@ prototypes:
 	int (*permission) (struct inode *, int, unsigned int);
 	int (*get_acl)(struct inode *, int);
 	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (const struct path *, struct dentry *, struct kstat *,
-			u32, unsigned int);
+	int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);
 	ssize_t (*listxattr) (struct dentry *, char *, size_t);
 	int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
 	void (*update_time)(struct inode *, struct timespec *, int);
Documentation/filesystems/porting +6 -0
index 95280079c0b3..5fb17f49f7a2 100644
@@ -600,3 +600,9 @@ in your dentry operations instead.
 [recommended]
 	->readlink is optional for symlinks.  Don't set, unless filesystem needs
 	to fake something for readlink(2).
+--
+[mandatory]
+	->getattr() is now passed a struct path rather than a vfsmount and
+	dentry separately, and it now has request_mask and query_flags arguments
+	to specify the fields and sync type requested by statx.  Filesystems not
+	supporting any statx-specific features may ignore the new arguments.
Documentation/filesystems/vfs.txt +1 -2
index 569211703721..94dd27ef4a76 100644
@@ -382,8 +382,7 @@ struct inode_operations {
 	int (*permission) (struct inode *, int);
 	int (*get_acl)(struct inode *, int);
 	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (const struct path *, struct dentry *, struct kstat *,
-			u32, unsigned int);
+	int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);
 	ssize_t (*listxattr) (struct dentry *, char *, size_t);
 	void (*update_time)(struct inode *, struct timespec *, int);
 	int (*atomic_open)(struct inode *, struct dentry *, struct file *,
Signature · 1 line
2.12.0
#1 lore raw
Quoted 19 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Following the recent merge of statx, correct the documented prototype for the ->getattr() inode operation, and add an entry to the porting file.

---

Documentation/filesystems/Locking | 3 +--
Documentation/filesystems/porting | 6 ++++++
Documentation/filesystems/vfs.txt | 3 +--
3 files changed, 8 insertions(+), 4 deletions(-)
Documentation/filesystems/Locking +0 -0
index fdcfdd79682a..fe25787ff6d4 100644

Documentation/filesystems/Locking prototypes: · line 62

Quoted 5 lines
Documentation/filesystems/Locking +0 -2
@@ -58,8 +58,7 @@ prototypes:
 	int (*permission) (struct inode *, int, unsigned int);
 	int (*get_acl)(struct inode *, int);
 	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (const struct path *, struct dentry *, struct kstat *,
-			u32, unsigned int);

IMHO, having the interface documentation with "u32" and "unsigned int" is not very helpful. It would be much better if the actual argument names were given here. That isn't needed for self-descriptive arguments like "struct path" and "struct kstat", but it is in this case.

Quoted 16 lines
Documentation/filesystems/porting +6 -0
index 95280079c0b3..5fb17f49f7a2 100644
@@ -600,3 +600,9 @@ in your dentry operations instead.
+--
+[mandatory]
+	->getattr() is now passed a struct path rather than a vfsmount and
+	dentry separately, and it now has request_mask and query_flags arguments
+	to specify the fields and sync type requested by statx.  Filesystems not
+	supporting any statx-specific features may ignore the new arguments.
Documentation/filesystems/vfs.txt +0 -0
index 569211703721..94dd27ef4a76 100644

Documentation/filesystems/vfs.txt struct inode_operations { · line 385

Quoted 6 lines
Documentation/filesystems/vfs.txt +1 -2
@@ -382,8 +382,7 @@ struct inode_operations {
 	int (*permission) (struct inode *, int);
 	int (*get_acl)(struct inode *, int);
 	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (const struct path *, struct dentry *, struct kstat *,
-			u32, unsigned int);
+	int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);

Same here...

Cheers, Andreas