Thread (11 messages) 11 messages, 3 authors, 2023-02-13

Re: [RFC PATCH v10 6/6] netfs: Change netfs_inode_init to allocate memory to allow opt-in

From: David Howells <dhowells@redhat.com>
Date: 2022-11-03 16:42:36

Dave Wysochanski [off-list ref] wrote:
This saves memory for network filesystems inode that would build
in netfs support, but like to opt-in to netfs on some mounts while
opting-out of netfs on other mounts.
...
 static struct inode *afs_alloc_inode(struct super_block *sb)
 {
 	struct afs_vnode *vnode;
+	int	ret;
 
 	vnode = alloc_inode_sb(sb, afs_inode_cachep, GFP_KERNEL);
 	if (!vnode)
 		return NULL;
 
+	ret = netfs_inode_init(&vnode->netfs, &afs_req_ops);
+	if (ret) {
+		afs_free_inode(AFS_VNODE_TO_I(vnode));
+		return NULL;
+	}
 	atomic_inc(&afs_count_active_inodes);
 
 	/* Reset anything that shouldn't leak from one inode to the next. */
This makes the memory footprint worse for 9p, afs, ceph and cifs - and adds a
time penalty to inode creation and destruction as well (though probably not a
huge amount).

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help