Changeset 679 for GPL/trunk/include/linux/fs.h
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/include/linux/fs.h
r598 r679 12 12 */ 13 13 14 #include <linux/init.h> 14 15 #include <linux/types.h> 15 16 #include <linux/fcntl.h> … … 20 21 #include <linux/dcache.h> 21 22 #include <linux/vmalloc.h> 22 #include <linux/tqueue.h> 23 #include <linux/pid.h> 24 #include <linux/err.h> 25 #include <linux/workqueue.h> 23 26 24 27 #define FALSE 0 … … 43 46 #define MAY_WRITE 2 44 47 #define MAY_READ 4 45 46 #define FMODE_READ 147 #define FMODE_WRITE 248 48 49 49 #define READ 0 … … 167 167 void * f_list; 168 168 struct dentry *f_dentry; 169 struct file_operations *f_op; 169 const struct file_operations *f_op; 170 struct inode *f_inode; /* cached value */ 171 spinlock_t f_lock; 170 172 atomic_t f_count; 171 173 unsigned int f_flags; … … 184 186 185 187 struct inode { 186 #ifdef TARGET_OS2187 kdev_t i_rdev;188 struct semaphore i_sem;189 union {190 void *generic_ip;191 } u;192 193 #else194 188 void * i_hash; 195 189 void * i_list; … … 227 221 void *generic_ip; 228 222 } u; 229 #endif230 223 }; 231 224 … … 237 230 int (*read) (struct file *, char *, size_t, loff_t *); 238 231 int (*write) (struct file *, const char *, size_t, loff_t *); 232 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); 233 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 239 234 int (*readdir) (struct file *, void *, filldir_t); 240 235 unsigned int (*poll) (struct file *, struct poll_table_struct *); 241 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); 236 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 237 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 242 238 int (*mmap) (struct file *, struct vm_area_struct *); 243 239 int (*open) (struct inode *, struct file *); … … 259 255 260 256 261 extern int register_chrdev(unsigned int, const char *, struct file_operations *);257 extern int register_chrdev(unsigned int, const char *, const struct file_operations *); 262 258 extern int unregister_chrdev(unsigned int, const char *); 263 259 264 260 extern int fasync_helper(int, struct file *, int, struct fasync_struct **); 265 extern void kill_fasync(struct fasync_struct *, int, int); 266 267 #define fops_get(x) (x) 268 #define fops_put(x) do { ; } while (0) 261 extern void kill_fasync(struct fasync_struct **, int, int); 262 263 264 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ 265 #define fops_get(fops) \ 266 (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) 267 #define fops_put(fops) \ 268 do { if (fops) module_put((fops)->owner); } while(0) 269 /* 270 * This one is to be used *ONLY* from ->open() instances. 271 * fops must be non-NULL, pinned down *and* module dependencies 272 * should be sufficient to pin the caller down as well. 273 */ 274 #define replace_fops(f, fops) \ 275 do { \ 276 struct file *__file = (f); \ 277 fops_put(__file->f_op); \ 278 } while(0) 269 279 270 280 #define minor(a) MINOR(a) … … 276 286 #define nonseekable_open(i,f) 0 277 287 288 struct kiocb { 289 struct file *ki_filp; 290 loff_t ki_pos; 291 void (*ki_complete)(struct kiocb *iocb, long ret, long ret2); 292 void *private; 293 int ki_flags; 294 }; 295 296 extern int stream_open(struct inode * inode, struct file * filp); 297 298 /* 299 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond 300 * to O_WRONLY and O_RDWR via the strange trick in do_dentry_open() 301 */ 302 303 /* file is open for reading */ 304 #define FMODE_READ (( fmode_t)0x1) 305 /* file is open for writing */ 306 #define FMODE_WRITE (( fmode_t)0x2) 307 /* file is seekable */ 308 #define FMODE_LSEEK (( fmode_t)0x4) 309 /* file can be accessed using pread */ 310 #define FMODE_PREAD (( fmode_t)0x8) 311 /* file can be accessed using pwrite */ 312 #define FMODE_PWRITE (( fmode_t)0x10) 313 /* File is opened for execution with sys_execve / sys_uselib */ 314 #define FMODE_EXEC (( fmode_t)0x20) 315 /* File is opened with O_NDELAY (only set for block devices) */ 316 #define FMODE_NDELAY (( fmode_t)0x40) 317 /* File is opened with O_EXCL (only set for block devices) */ 318 #define FMODE_EXCL (( fmode_t)0x80) 319 /* File is opened using open(.., 3, ..) and is writeable only for ioctls 320 (specialy hack for floppy.c) */ 321 #define FMODE_WRITE_IOCTL (( fmode_t)0x100) 322 /* 32bit hashes as llseek() offset (for directories) */ 323 #define FMODE_32BITHASH (( fmode_t)0x200) 324 /* 64bit hashes as llseek() offset (for directories) */ 325 #define FMODE_64BITHASH (( fmode_t)0x400) 326 327 /* File needs atomic accesses to f_pos */ 328 #define FMODE_ATOMIC_POS (( fmode_t)0x8000) 329 330 /* File is stream-like */ 331 #define FMODE_STREAM (( fmode_t)0x200000) 332 333 static inline struct inode *file_inode(const struct file *f) 334 { 335 return f->f_inode; 336 } 337 278 338 #endif /* _LINUX_FS_H */
Note:
See TracChangeset
for help on using the changeset viewer.