]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: copy layout, max_size and truncate_size on successful sync create
authorJeff Layton <jlayton@kernel.org>
Thu, 2 Jan 2020 12:11:38 +0000 (07:11 -0500)
committerJeff Layton <jlayton@kernel.org>
Fri, 10 Jan 2020 16:51:05 +0000 (11:51 -0500)
commit0413b3ae939801ceb4bd8ea6ec2c03ba1dc73178
treeb00a7368d89caa4787b8eda5332c69fc3bc1919f
parent19284b9f650fdc530fd59a8d323883c4c8ff96c6
ceph: copy layout, max_size and truncate_size on successful sync create

It doesn't do much good to do an asynchronous create unless we can do
I/O to it before the create reply comes in. That means we need layout
info the new file before we've gotten the response from the MDS.

All files created in a directory will initially inherit the same layout,
so copy off the requisite info from the first synchronous create in the
directory. Save it in the same fields in the directory inode, as those
are otherwise unsed for dir inodes. This means we need to be a bit
careful about only updating layout info on non-dir inodes.

Also, zero out the layout when we drop Dc caps in the dir.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/caps.c
fs/ceph/file.c
fs/ceph/inode.c