.. | .. |
---|
51 | 51 | #include <linux/rwsem.h> |
---|
52 | 52 | #include <linux/xattr.h> |
---|
53 | 53 | #include <linux/exportfs.h> |
---|
| 54 | +#include <linux/hashtable.h> |
---|
54 | 55 | |
---|
55 | 56 | #include <asm/unaligned.h> |
---|
56 | 57 | |
---|
.. | .. |
---|
192 | 193 | sector_t last_failed_block_index_read; |
---|
193 | 194 | |
---|
194 | 195 | unsigned long getattr_time; |
---|
195 | | - u32 getattr_mask; |
---|
| 196 | + unsigned long mapping_time; |
---|
| 197 | + int attr_valid; |
---|
| 198 | + kuid_t attr_uid; |
---|
| 199 | + kgid_t attr_gid; |
---|
| 200 | + unsigned long bitlock; |
---|
| 201 | + |
---|
| 202 | + DECLARE_HASHTABLE(xattr_cache, 4); |
---|
196 | 203 | }; |
---|
197 | 204 | |
---|
198 | 205 | /* per superblock private orangefs info */ |
---|
.. | .. |
---|
217 | 224 | unsigned long writes; |
---|
218 | 225 | }; |
---|
219 | 226 | |
---|
| 227 | +struct orangefs_cached_xattr { |
---|
| 228 | + struct hlist_node node; |
---|
| 229 | + char key[ORANGEFS_MAX_XATTR_NAMELEN]; |
---|
| 230 | + char val[ORANGEFS_MAX_XATTR_VALUELEN]; |
---|
| 231 | + ssize_t length; |
---|
| 232 | + unsigned long timeout; |
---|
| 233 | +}; |
---|
| 234 | + |
---|
| 235 | +struct orangefs_write_range { |
---|
| 236 | + loff_t pos; |
---|
| 237 | + size_t len; |
---|
| 238 | + kuid_t uid; |
---|
| 239 | + kgid_t gid; |
---|
| 240 | +}; |
---|
| 241 | + |
---|
220 | 242 | extern struct orangefs_stats orangefs_stats; |
---|
221 | 243 | |
---|
222 | 244 | /* |
---|
223 | | - * NOTE: See Documentation/filesystems/porting for information |
---|
| 245 | + * NOTE: See Documentation/filesystems/porting.rst for information |
---|
224 | 246 | * on implementing FOO_I and properly accessing fs private data |
---|
225 | 247 | */ |
---|
226 | 248 | static inline struct orangefs_inode_s *ORANGEFS_I(struct inode *inode) |
---|
.. | .. |
---|
329 | 351 | /* |
---|
330 | 352 | * defined in inode.c |
---|
331 | 353 | */ |
---|
| 354 | +vm_fault_t orangefs_page_mkwrite(struct vm_fault *); |
---|
332 | 355 | struct inode *orangefs_new_inode(struct super_block *sb, |
---|
333 | 356 | struct inode *dir, |
---|
334 | 357 | int mode, |
---|
335 | 358 | dev_t dev, |
---|
336 | 359 | struct orangefs_object_kref *ref); |
---|
337 | 360 | |
---|
338 | | -int orangefs_setattr(struct dentry *dentry, struct iattr *iattr); |
---|
| 361 | +int __orangefs_setattr(struct inode *, struct iattr *); |
---|
| 362 | +int orangefs_setattr(struct dentry *, struct iattr *); |
---|
339 | 363 | |
---|
340 | 364 | int orangefs_getattr(const struct path *path, struct kstat *stat, |
---|
341 | 365 | u32 request_mask, unsigned int flags); |
---|
.. | .. |
---|
355 | 379 | struct inode *orangefs_iget(struct super_block *sb, |
---|
356 | 380 | struct orangefs_object_kref *ref); |
---|
357 | 381 | |
---|
358 | | -ssize_t orangefs_inode_read(struct inode *inode, |
---|
359 | | - struct iov_iter *iter, |
---|
360 | | - loff_t *offset, |
---|
361 | | - loff_t readahead_size); |
---|
362 | | - |
---|
363 | 382 | /* |
---|
364 | 383 | * defined in devorangefs-req.c |
---|
365 | 384 | */ |
---|
.. | .. |
---|
369 | 388 | void orangefs_dev_cleanup(void); |
---|
370 | 389 | int is_daemon_in_service(void); |
---|
371 | 390 | bool __is_daemon_in_service(void); |
---|
| 391 | + |
---|
| 392 | +/* |
---|
| 393 | + * defined in file.c |
---|
| 394 | + */ |
---|
| 395 | +int orangefs_revalidate_mapping(struct inode *); |
---|
| 396 | +ssize_t wait_for_direct_io(enum ORANGEFS_io_type, struct inode *, loff_t *, |
---|
| 397 | + struct iov_iter *, size_t, loff_t, struct orangefs_write_range *, int *, |
---|
| 398 | + struct file *); |
---|
| 399 | +ssize_t do_readv_writev(enum ORANGEFS_io_type, struct file *, loff_t *, |
---|
| 400 | + struct iov_iter *); |
---|
372 | 401 | |
---|
373 | 402 | /* |
---|
374 | 403 | * defined in orangefs-utils.c |
---|
.. | .. |
---|
386 | 415 | size_t size, |
---|
387 | 416 | int flags); |
---|
388 | 417 | |
---|
389 | | -int orangefs_inode_getattr(struct inode *inode, int new, int bypass, |
---|
390 | | - u32 request_mask); |
---|
| 418 | +#define ORANGEFS_GETATTR_NEW 1 |
---|
| 419 | +#define ORANGEFS_GETATTR_SIZE 2 |
---|
| 420 | + |
---|
| 421 | +int orangefs_inode_getattr(struct inode *, int); |
---|
391 | 422 | |
---|
392 | 423 | int orangefs_inode_check_changed(struct inode *inode); |
---|
393 | 424 | |
---|
394 | | -int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr); |
---|
| 425 | +int orangefs_inode_setattr(struct inode *inode); |
---|
395 | 426 | |
---|
396 | 427 | bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op); |
---|
397 | 428 | |
---|
.. | .. |
---|
400 | 431 | extern struct mutex orangefs_request_mutex; |
---|
401 | 432 | extern int op_timeout_secs; |
---|
402 | 433 | extern int slot_timeout_secs; |
---|
| 434 | +extern int orangefs_cache_timeout_msecs; |
---|
403 | 435 | extern int orangefs_dcache_timeout_msecs; |
---|
404 | 436 | extern int orangefs_getattr_timeout_msecs; |
---|
405 | 437 | extern struct list_head orangefs_superblocks; |
---|
.. | .. |
---|
426 | 458 | #define ORANGEFS_OP_CANCELLATION 4 /* this is a cancellation */ |
---|
427 | 459 | #define ORANGEFS_OP_NO_MUTEX 8 /* don't acquire request_mutex */ |
---|
428 | 460 | #define ORANGEFS_OP_ASYNC 16 /* Queue it, but don't wait */ |
---|
| 461 | +#define ORANGEFS_OP_WRITEBACK 32 |
---|
429 | 462 | |
---|
430 | 463 | int service_operation(struct orangefs_kernel_op_s *op, |
---|
431 | 464 | const char *op_name, |
---|