File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ struct netfs_i_context {
126
126
#if IS_ENABLED (CONFIG_FSCACHE )
127
127
struct fscache_cookie * cache ;
128
128
#endif
129
+ loff_t remote_i_size ; /* Size of the remote file */
129
130
};
130
131
131
132
/*
@@ -324,6 +325,21 @@ static inline void netfs_i_context_init(struct inode *inode,
324
325
325
326
memset (ctx , 0 , sizeof (* ctx ));
326
327
ctx -> ops = ops ;
328
+ ctx -> remote_i_size = i_size_read (inode );
329
+ }
330
+
331
+ /**
332
+ * netfs_resize_file - Note that a file got resized
333
+ * @inode: The inode being resized
334
+ * @new_i_size: The new file size
335
+ *
336
+ * Inform the netfs lib that a file got resized so that it can adjust its state.
337
+ */
338
+ static inline void netfs_resize_file (struct inode * inode , loff_t new_i_size )
339
+ {
340
+ struct netfs_i_context * ctx = netfs_i_context (inode );
341
+
342
+ ctx -> remote_i_size = new_i_size ;
327
343
}
328
344
329
345
/**
You can’t perform that action at this time.
0 commit comments