Lines Matching refs:fd

55  * A handle is different than an fd because you can use dup()
56 * to create a new handle that accesses the *same* fd. The two
57 * handles will use the same offset (part of the fd). We only close
58 * down the fd when there are no more handles accessing it.
60 * More than one fd can currently access one file, but each fd
76 int handleCount:10; /* Number of handles for this fd */
155 struct yaffsfs_FileDes *fd = yaffsfs_HandleToFileDes(handle);
157 if (fd && fd->handleCount > 0 &&
158 fd->inodeId >= 0 && fd->inodeId < YAFFSFS_N_HANDLES)
159 return &yaffsfs_inode[fd->inodeId];
284 struct yaffsfs_FileDes *fd;
292 fd = &yaffsfs_fd[i];
293 if (fd->handleCount < 1) {
294 memset(fd, 0, sizeof(struct yaffsfs_FileDes));
295 fd->inodeId = -1;
296 fd->handleCount = 1;
302 /* Dump the handle because we could not get a fd */
332 struct yaffsfs_FileDes *fd;
335 fd = &yaffsfs_fd[fdId];
336 fd->handleCount--;
337 if (fd->handleCount < 1) {
338 if (fd->inodeId >= 0) {
339 yaffsfs_PutInode(fd->inodeId);
340 fd->inodeId = -1;
364 struct yaffsfs_FileDes *fd;
370 fd = yaffsfs_HandleToFileDes(i);
376 if (fd && fd->handleCount > 0 && obj && obj->my_dev == dev) {
377 fd->handleCount = 0;
378 yaffsfs_PutInode(fd->inodeId);
379 fd->inodeId = -1;
780 struct yaffsfs_FileDes *fd = NULL;
830 fd = yaffsfs_HandleToFileDes(handle);
971 fd->inodeId = inodeId;
972 fd->reading = readRequested;
973 fd->writing = writeRequested;
974 fd->append = (oflag & O_APPEND) ? 1 : 0;
975 fd->position = 0;
976 fd->shareRead = shareRead;
977 fd->shareWrite = shareWrite;
982 if ((oflag & O_TRUNC) && fd->writing)
1069 struct yaffsfs_FileDes *fd = NULL;
1086 fd = yaffsfs_HandleToFileDes(handle);
1089 if (!fd || !obj) {
1093 } else if (!fd->reading) {
1104 startPos = fd->position;
1165 fd->position = startPos + totalRead;
1191 struct yaffsfs_FileDes *fd = NULL;
1208 fd = yaffsfs_HandleToFileDes(handle);
1211 if (!fd || !obj) {
1215 } else if (!fd->writing) {
1222 if (fd->append)
1227 startPos = fd->position;
1284 fd->position = startPos + totalWritten;
1295 int yaffs_write(int fd, const void *buf, unsigned int nbyte)
1297 return yaffsfs_do_write(fd, buf, nbyte, 0, 0);
1300 int yaffs_pwrite(int fd, const void *buf, unsigned int nbyte, loff_t offset)
1302 return yaffsfs_do_write(fd, buf, nbyte, 1, offset);
1352 struct yaffsfs_FileDes *fd = NULL;
1357 fd = yaffsfs_HandleToFileDes(handle);
1360 if (!fd || !obj)
1363 else if (!fd->writing)
1380 struct yaffsfs_FileDes *fd = NULL;
1386 fd = yaffsfs_HandleToFileDes(handle);
1389 if (!fd || !obj)
1398 if ((fd->position + offset) >= 0)
1399 pos = (fd->position + offset);
1407 fd->position = pos;
1678 int yaffs_fstat(int fd, struct yaffs_stat *buf)
1690 obj = yaffsfs_HandleToObject(fd);
1772 int yaffs_futime(int fd, const struct yaffs_utimbuf *buf)
1779 obj = yaffsfs_HandleToObject(fd);
1854 int yaffs_fsetxattr(int fd, const char *name,
1867 obj = yaffsfs_HandleToObject(fd);
1939 int yaffs_fgetxattr(int fd, const char *name, void *data, int size)
1951 obj = yaffsfs_HandleToObject(fd);
2024 int yaffs_flistxattr(int fd, char *data, int size)
2036 obj = yaffsfs_HandleToObject(fd);
2109 int yaffs_fremovexattr(int fd, const char *name)
2121 obj = yaffsfs_HandleToObject(fd);
2140 int yaffs_get_wince_times(int fd, unsigned *wctime,
2148 obj = yaffsfs_HandleToObject(fd);
2175 int yaffs_set_wince_times(int fd,
2184 obj = yaffsfs_HandleToObject(fd);
2334 int yaffs_fchmod(int fd, mode_t mode)
2345 obj = yaffsfs_HandleToObject(fd);